All Products
Search
Document Center

Serverless App Engine:Deploy Java applications

Last Updated:Sep 12, 2025

You can package your Java application into a JAR or WAR file and then deploy it to Serverless App Engine (SAE).

Procedure

  1. Log on to the SAE console, choose Applications > Applications in the left-side navigation pane, select a deployment region at the top, and then click Create Application.

    If Applications > Applications is not in the navigation bar, choose Applications > Microservice Applications.
  2. Select an application version.

    Important

    Lightweight Edition and Professional Edition are currently in the invitation-only testing phase. For users who are not participating in invitation-only testing, the created application is Standard Edition, and you do not need to select an application version.

    • Lightweight Edition: Provides the minimum set of functions required for application operation, does not support Application Monitoring and Microservice Governance functions.

    • Standard Edition: Comes with Basic Application Monitoring functions, Advanced Application Monitoring and Microservice Governance functions require additional activation and purchase.

    • Professional Edition: Comes with Advanced Application Monitoring and Microservice Governance functions, no additional activation or purchase required.

  3. On the Create Application page, specify an Application Name and configure the following parameters.

    1. Select the Namespace to which the application belongs. Namespace is equivalent to K8s Namespace and can be used for resource isolation in different environments. After an application is created, you cannot change its namespace.

      • System Created: Use the default namespace, vSwitch, and security group created by the system in the current region.

      • Existing Namespace: Select the namespace, vSwitch, and security group that you created in advance.

    2. For Application Deployment Method, select Code Package Deployment, and click Set Code Package Deployment on the right.For Technology Stack Language, select Java. For Code Package Type, select JAR Package Deployment or WAR Package Deployment. Select a Java environment that is compatible with your code.Set the following parameters, and then click OK.

      Parameters for configuring a JAR or WAR package

      JAR package

      Parameter

      Description

      Application Runtime Environment

      • Standard Java Application Runtime Environment: For Spring Boot or Dubbo JAR packages.

      • EDAS-Container-XXX: For HSF JAR packages.

      File Upload Method

      Upload a local code package or enter the URL of the code package.

      Version

      Enter an application version number or Use A Timestamp As The Version Number.

      Time Zone Settings

      Select the time zone for the application.

      Custom Runtime Environment Settings

      (Optional) After you enable this feature, you can pre-install tools, download or modify files, and install runtime dependencies or extensions for the application as needed.

      Customize The Runtime Environment Using The Command Line: The following are examples.

      CentOS-based runtime environment

      #!/bin/bash
      
      # Install vim
      yum install -y vim

      Debian-based runtime environment

      #!/bin/bash
      
      # Install vim
      apt install vim

      Alpine-based runtime environment

      #!/bin/bash
      
      # Install vim
      apk add vim

      WAR package

      Parameter

      Description

      Application Runtime Environment

      • apache-tomcat-XXX: Suitable for Spring Boot or Dubbo WAR packages.

      • EDAS-Container-XXX: Suitable for HSF WAR packages.

      File Upload Method

      Upload a local code package or enter the URL of the code package.

      Version

      Enter the application version number or Use Timestamp As Version Number.

      Time Zone Settings

      Select the time zone for the application.

      Custom Runtime Environment Settings

      (Optional) After you enable this feature, you can pre-install tools, download or modify files, and install runtime dependencies or extensions for the application as needed.

      Customize The Runtime Environment Using The Command Line: The following are examples.

      CentOS-based runtime environment

      #!/bin/bash
      
      # Install vim
      yum install -y vim

      Debian-based runtime environment

      #!/bin/bash
      
      # Install vim
      apt install vim

      Alpine-based runtime environment

      #!/bin/bash
      
      # Install vim
      apk add vim
      Java Tomcat Settings

      Optional. After you enable Custom Configuration, set the Java Tomcat parameters. These parameters include Application Port, Tomcat Context, Maximum Threads, and Tomcat Encoding. The custom configuration overwrites the Tomcat configuration file /home/admin/xxx-tomcat-xxx/conf/server.xml in the application runtime environment.

      If the custom configuration does not meet your needs, use configuration injection to inject a custom server.xml file. This file overwrites the Tomcat configuration file in the application runtime environment.

    3. In the Capacity Settings section, configure Single Instance Type, and Instances.

  4. (Optional) Click Next: Advanced Settings to configure features as needed.

    • Startup command

      JAR package

      The startup command format is Java[-options] -jar jarfile[args]. Set options and args as needed. For more information, see Set a startup command.

      WAR package

      The startup command format is java [-options] org.apache.catalina.startup.Bootstrap "$@" start. Set options as needed. For more information, see Set a startup command.

    • Runtime environment and lifecycle management

    • Network access and service invocation

    • Data persistence

      Store application data in NAS, OSS, or database to prevent data loss due to application changes or shutdowns. Note that NAS, OSS, and databases require additional fees.

    • Logs and monitoring

      • After deploying an application, you can view real-time logs and view resource usage and payload without additional configuration. In addition, you can output logs to SLS or Kafka for unified management and analysis. Note that SLS and Kafka require additional fees.

      • ARMS Monitoring helps you get the application running status, quickly pinpoint error interfaces and slow interfaces, gain insight into performance bottlenecks, and reproduce call parameters, thereby greatly improving the efficiency of online problem diagnosis.

        • For Standard Edition applications, you can view ARMS Basic Edition monitoring data after deployment without additional configuration.You can also activate and purchase ARMS Pro monitoring.

        • For Professional Edition applications, enable Application Monitoring in Advanced Settings and complete application deployment, then you can View ARMS Pro Monitoring Data. No additional fees are required.

    • Other features

      • Microservice Governance enables Lossless Online And Offline, Traffic Protection, End-to-end Grayscale, and Same-zone Routing Priority for Java applications.

        • For Standard Edition applications, go to the application details page after completing application deployment to activate and purchase MSE Microservice Governance features.

        • For Professional Edition applications, enable Microservice Governance in Advanced Settings, then you can configure Lossless Online And Offline. For more features, go to the application details page after completing application deployment to configure. No additional fees are required.

      • Solve the problem of resource waste caused by the CPU required during the startup loading phase being higher than usual by enabling the CPU Burst feature (only applicable to Standard Edition and Professional Edition).

      • Implement decoupling and standardization of non-business functions from the main container by adding Sidecar containers.

  5. Click Create Application.

    • Creating an application takes about 1-2 minutes. You can determine whether the application is deployed successfully by viewing the change records. If the deployment fails, no application instance will be generated. Troubleshoot faults based on the error information in Change History.

    • You can view the created applications in Applications > Applications. If you need to change the application configuration after deployment, click the target application to enter its details page, and then click Deploy Application. Note that the application will automatically restart to make the new configuration take effect. Perform operations during off-peak hours to minimize impacts on your business.

    • You can log on to application instances through Webshell to interact with application instances through console commands.

    • After creating an application, you can manually adjust the number of instances and instance specifications, or automatically adjust the number of instances by configuring Auto Scaling policies. You can also reduce costs by enabling idle mode.