Go to primary content

# Using the Oracle Application Container Cloud Service

OEPE includes integration for Oracle Application Container Cloud which allows you to develop and deploy applications on Oracle Application Container Cloud Service.

You can create applications for deployment on Application Container Cloud Service. Oracle Application Container Cloud Service includes Oracle Java SE Cloud Service, which lets you deploy Java applications to the Oracle Cloud, and Oracle Node Cloud Service, which lets you deploy Node.js applications to the Oracle Cloud. You can also deploy PHP applications.

You can develop an application for deployment to Application Container Cloud Service using OEPE’s development tools, or using Oracle Developer Cloud Service. See Using the Oracle Developer Cloud Service.

For more information about Application Container Cloud Service see, `http://cloud.oracle.com/application-container-cloud`.

## Working with the Oracle Application Container

There are a number of tasks which you can perform from the container node in Oracle Cloud view.

The Applications node in Oracle Cloud view is the Oracle Application Container Cloud Service instance that OEPE is connected to. There are a number of tasks that you can perform from Oracle Cloud view, including:

- Activating and deactivating the container instance.

- Accessing the Oracle Application Container Cloud Service through a web user interface.

- Performing actions on the deployed applications, such as start, stop, delete.

- Generating applications logs.

- Generating Java Flight Recording (JFR) for an application instance.

- Scaling an application up or down.

- View the application log file in the Storage Service container.

- View past log files in the Properties page of an application instance.

- View past JFR in the Properties page of a Java application instance.

### How to Activate an Oracle Application Container Service

Activate Oracle Application Container Cloud Service from the Oracle Cloud view to work with the applications.

You can create a connection to Oracle Application Container Cloud Service from the Oracle Cloud view, described in How to Create an Oracle Cloud Connection.

Once you have created a connection, you can activate Oracle Application Container Cloud Service:

1. In the Oracle Cloud view, double-click the `Applications` node or right-click and choose Activate, as shown below.

   Figure: Cloud View - Activating the Application Container Cloud Service

### What Happens When You Activate the Oracle Application Container Service

Activating the Oracle Application Container Cloud Service in the Oracle Cloud view allows you to work with the applications.

Once you have activated the Oracle Application Container Cloud Service you can see the applications deployed on the Application Container Cloud Service, as shown below.

Figure: Applications in Oracle Cloud View

The application container `Applications` and the applications deployed to it are also displayed in the Servers view. There are fewer options available from the applications listed under the application container in the Servers view. You can only Delete an application from the container, or display the application properties from the Oracle Cloud view.

Icon | Type of Application
--- | ---
| Java SE application.
| Node.js application.
| PHP application.

To see the application instances running on the container, expand the application node. You can see properties of the instance by right-clicking and choosing Properties.

The options available from the container node in the Oracle Cloud view are:

- Deactivate—To deactivate the Application Container Server.

- Refresh—To refresh the of the Cloud View.

- Open Service console—To access Oracle Application Container Cloud Service through a web user interface.

- Add and Remove—To add and remove resources.

- Properties—To view properties of the container.

The options available from the application nodes under the container are:

- Update—To apply an update. To activate a runtime update immediately, you must restart the application. (Started applications only.)

- Delete—Any running instances of the deployed application are stopped. The deployed application and its configuration data are deleted. You cannot undo application deletion.

- Restart—To stop an application and start it immediately. (Started applications only.)

- Start—To start all stopped instances. (Stopped applications only.)

- Stop—To stop the running instances and free up the memory. (Started applications only.)

- Scale Application—To increase or decrease the number of instances of the application. (Started applications only.) See ???

- Open in Browser—To open the application in the Application Console in a browser. (Started applications only.)

- Properties—To display properties of the application.

### How to Deactivate an Application Container Cloud Service Instance

You can deactivate an instance by right-clicking `Applications` in the Oracle Cloud view, and choosing `Deactivate`.

The SSH tunnel is disconnected and the `Applications` instance is removed from the Servers view.

### How to Open the Application in a Browser

View the application running in Oracle Application Container Cloud Service in a browser.

- You can open the application by right-clicking the instance in the Oracle Cloud view, and choosing Open in Browser.

The default browser shows the application running.

### How to Scale an Application

You can scale out an application to increase the number of instances, and scale in to reduce them to the minimum of 1. You can scale up and application to increase the size in GB of each instance, or scale down to reduce it to the minimum of 1GB.

To scale the application:

1. In the Oracle Cloud view, right-click the application and choose Scale Application.
2. In the Scale Application dialog, change the value of the memory, or the instances, or both. The defaults for both are `1`.

(Optional) Enter the result of the procedure here.

### How to Generate Application Logs

Generate logs of Application Container server instances.

To generate a log of the application instance:

1. In the Oracle Cloud view, expand the application and the instance.
2. Right-click Logs and choose Generate Log.

The log is generated and displayed in OEPE. The file is listed under Logs for the application in the Oracle Cloud view.

### How to Generate Java Flight Recordings

Generate a Java Flight Recorder recording for an instance of an application, which includes profiling and event information.

Java Flight Recorder (JFR) collects and saves detailed performance characteristics for historic analysis and profiling. It presents diagnostic information in logically grouped tables, charts, and dials. You can record 60 seconds of information at a time on each application. If you have multiple instances, each instance generates a recording. Then you can examine the data retrieved using Java Mission Control, and make necessary adjustments based on that data.

The Java Mission Control (JMC) is a set of tools that run on the JDK and interact with a JVM to deliver advanced, unobtrusive Java monitoring and management. See the Java Mission Control User’s Guide in the Java Components Documentation

Java Mission Control is available as part of the JDK. Before you begin, navigate to `jdk-install``/bin` and double-click `jmc.exe`. For information about

To generate a Java Flight Recording:

1. In the Oracle Cloud view, expand the application and the instance.
2. Right-click Recordings and choose Generate Recording.

The JFR recording is generated with a name which reflects the date and time and it is opened in JMC. The recording is alsolisted under the Recordings node for the application in the Oracle Cloud view.

## Oracle Application Container Cloud Service Sample Applications

OEPE provides a set of sample applications that implement several use cases. You can open these sample applications in OEPE to explore the source code and deploy to the Application Container Cloud Service to view the runtime behavior.

The sample applications are:

- `Employee Service Java Web application` is an example of a simple standalone web application using Servlets, Java Server Pages (JSP), Bootstrap and Tomcat embedded so that it can deployed to Oracle Application Container Cloud Service.

- `Corporate Directory JPA Java Web Application` is a similar application, but it has a database using JPA.

- `Node.js REST Web Service and HTML5 application` is an example of a Node.js RESTful application and includes an HTML5 application to test the REST service locally and in the Cloud.

- `Node.js WebSocket Chat Server` is an example of a Node.js WebSocket Chat client/server application .

To open and work with the sample applications:

1. Choose the Java EE perspective.
2. Open the New Examples dialog by selecting File > New > Example.
3. From the New Examples dialog, choose the sample application to open.

The application is displayed in the Project Explorer. Expand the project node and open the `README` file for additional information, for example, configuring Maven in OEPE.

## Developing and Deploying Java SE Applications

Develop and deploy Java SE applications to Oracle Application Container Cloud Service.

You can develop Java SE applications for deployment to Application Container Cloud Service in OEPE.

### About the manifest.json File

The `manifest.json` file specifies the metadata for an Oracle Application Container Cloud Service application.

The `manifest.json` file is located under the application node of the project in the project explorer. When you double-click it the file opens in OEPE in the Design View.

For information about the syntax of `manifest.json`, see Creating Metadata Files

The following is an example of a `manifest.json` file.

    {
        "runtime":{
            "majorVersion": "8"
        },
        "command": "java -jar corporatedirectory-jpa-1.0-SNAPSHOT-jar-with-dependencies.jar",
        "release": {
            "build": "Build 1",
            "commit": "commit message",
            "version": "0.01"
        },
        "notes": "Java application generated by Oracle Enterprise Pack for Eclipse"
    }

When you run an ACCS application locally, it runs using the value of the command in the `manifest.json` file, for example, `java -jar employees-app-1.0-SNAPSHOT-jar-with-dependencies.jar`.

### About the deployment.json File

The optional `deployment.json` file specifies metadata for an Oracle Application Container Cloud Service application such as how much memory to allocate to the application, how many application instances to create initially, additional environment variables, and service bindings to other Oracle Cloud services.

When present, the `deployment.json` file is located under the application node of the project in the project explorer. When you double-click it the file opens in OEPE in the Design View

For information about the syntax of `deployment`, see Creating Metadata Files

The following is an example of a `deployment.json` file.

    {
      "services": [
        {
          "name": "MyDB",
          "type": "DBAAS",
          "username": "employee",
          "password": "employee"
        }
      ]}

### How to Create Java Web Applications

Create Java Web applications for deployment to Oracle Application Container Cloud Service.

Before you begin

- Create a connection to Oracle Cloud.

- Activate Application Container Cloud Service.

To create the application:

1. With Java EE perspective open, create a Dynamic Web Project by choosing File > New > Dynamic Web Project.
   The New Dynamic Web Project wizard opens.
2. Complete the first page of the wizard as follows:
   - Project name—Enter a name for the application.
   - Specify the project location.
   - If you have a connection to Application Container Cloud Service, it is selected as the target runtime.To select a different target runtime, click New Runtime and in the New Server Runtime Environment dialog ensure that Application Container Cloud is selected and click Next. The new target runtime will use a default service name of `javamb_APAAS`.
   - Check that the dynamic web module version is 3.1 or later.
   - Choose the configuration. You can choose additional facets to be enabled for the project by clicking Modify.

     - Default Configuration for target runtime. Choose this to get started with your application. You can install additional project facets later to provide additional functionality.

     - Minimal Configuration. Only the minimal required facets are installed. You can install additional facets later to provide additional functionality.

     - Custom Configuration.

3. Click Next three times to get to the Oracle Application Container Cloud Service page.
   - If you have not configured a JDK in the Java > Installed JREs page of the Preferences dialog you can enter it here.
   - Choose whether to bundle a Tomcat or Jetty web container.

When you click Finish the project is generated. It contains:

- A `manifest.json` that specifies what command Oracle Application Container Cloud should run

  .

- The Maven assembly configuration `pom.xml` required to package the application into the type of archive required by Application Container Cloud Service.

You can test the packaged Application Container Cloud Service application locally before deploying to Oracle Cloud.

The `Employee Service Java Web application` is an example of a simple standalone web application using Servlets, Java Server Pages (JSP), Bootstrap and Tomcat embedded so that it can deployed to Oracle Application Container Cloud Service. See Oracle Application Container Cloud Service Sample Applications.

### How to Create Java SE Applications

Create Java SE applications for deployment to Oracle Application Container Cloud Service.

Before you begin

- Create a connection to Oracle Cloud.

- Activate Application Container Cloud Service.

To create the application:

1. With Java EE perspective open, create a Java utility project by choosing File>New>Other.
2. In the New dialog, expand Java EE and choose Utility Project. Click Next.
   (Optional) Enter the result of the step here.
3. Complete the first page of the wizard as follows:
   - Project name—Enter a name for the application.
   - Specify the project location.
   - If you have a connection to Application Container Cloud Service, it is selected as the target runtime.To select a different target runtime, click New Runtime and in the New Server Runtime Environment dialog ensure that Application Container Cloud is selected and click Next. The new target runtime will use a default service name of `javamb_APAAS`.
   - Check that the dynamic web module version is 3.1 or later.
   - Choose the configuration. You can choose additional facets to be enabled for the project by clicking Modify.

     - Default Configuration for target runtime. Choose this to get started with your application. You can install additional project facets later to provide additional functionality.

     - Minimal Configuration. Only the minimal required facets are installed. You can install additional facets later to provide additional functionality.

     - Custom Configuration.

4. Click Next three times to get to the Oracle Application Container Cloud Service page.
   - If you have not configured a JDK in the Java > Installed JREs page of the Preferences dialog you can enter it here.
   - Choose whether to bundle a Tomcat or Jetty web container.

Test the packaged Application Container Cloud Service application locally before deploying to Oracle Cloud.

The `Corporate Directory JPA Java Web Application` is an example of a simple standalone web application using Servlets, Java Server Pages (JSP), Bootstrap and Tomcat embedded, and database using JPA, so that it can deployed to Oracle Application Container Cloud Service. See Oracle Application Container Cloud Service Sample Applications.

### How to Import Maven Projects

Import and configure existing Maven projects for deployment to Oracle Application Container Cloud Service.

Before you begin

- Create a connection to Oracle Cloud.

- Activate Application Container Cloud Service.

To import a Maven project:

1. With Java EE perspective open, choose File > Import.
2. In the Import dialog, expand Maven and choose Existing Maven Projects. Click Next.
3. In the Import Maven Projects, navigate to the root folder of the Maven project where the `pom.xml` is located. Select `pom.xml` and click Finish.
   The project is imported and converted into Eclipse M2E project. It is listed in the Project Explorer.
4. Configure the project with Application Container Cloud Service facets. This identifies the project as an Application Container Cloud Service project, and it generates the `manifest.json` and specific assembly and build steps in the `pom.xml` to package the application into an ACCS archive.
   1. In the Project Explorer, right-click the project and choose Configure > Configure Oracle ACCS Application.
   2. In the Modify Faceted Project dialog ensure that the Java and Oracle Application Container Cloud Java Application facets are selected and click Next.
   3. If the Maven project already includes `manifest.json` and build instructions packaging the Java project into Application Container Cloud Service Zip archive, do not generate Maven build script.
   4. To keep the existing `pom.xml` without generating the `assembly.xml` and the related Application Container Cloud Service zip archive, select Skip generating Maven build script.

Test the packaged Application Container Cloud Service application locally before deploying to Oracle Cloud.

### How to Run Applications Locally

You can test run an Oracle Application Container Cloud Service application locally before deploying it to Oracle Cloud.

To run an application locally:

1. Right-click the project in the project explorer and choose Run as > Packaged Oracle ACCS Application.
   The Edit Configuration dialog opens.
2. In the Edit Configuration dialog specify environment variables required by application. For example, running a Java SE ACCS application that uses Oracle Database as a Service (DBSaaS) locally will need environment variables for the `DBAAS_DEFAULT_CONNECT_DESCRIPTOR`, `DBAAS_USER_NAME`, and `DBAAS_USER_PASSWORD` added in the Environment tab of the Edit Configuration dialog.

The application runs locally using the command specified in the `manifest.json` file.

### How to Deploy Java SE Applications

Once you have tested the application locally in OEPE, you can deploy to Application Container Cloud Service.

To deploy to Application Container Cloud Service:

1. In the Project Explorer, right-click the Container node of the Oracle Cloud connection and choose Add and Remove.
2. In the Add and Remove dialog, move the resources that you want to deploy from the Available list to the Configured list and click Finish.

When the application has been deployed to the Application Container Cloud Service you can see it under the Applications node in the Oracle Cloud view.

## Developing and Deploying Node.js Applications

Develop and deploy Node.js applications to Oracle Application Container Cloud Service.

You can develop Node.js applications for deployment to Application Container Cloud Service in OEPE.

## Integration with Oracle Developer Cloud Service

Oracle Application Container Cloud Service is integrated with Oracle Developer Cloud Service in OEPE.

When an Application Container Cloud Service project is created in OEPE, it includes a Maven pom.xml which builds and packages the application as an ACCS archive. As such, it can easily be pushed to Developer Cloud Service.

To push an ACCS application to Developer Cloud Service:

1. Drag the project from Project Explorer and drop it onto the Developer node in Oracle Cloud view.
2. When prompted, uncheck Maven pom.xml generation and click Finish.
3. Open the Developer Cloud Service project in a browser. Right-click the project and choose Open in Browser.
   Wait for the Hudson build job to finish.
4. In the Developer Cloud Service open in the browser, select the Deploy tab and create a new deployment configuration. For Deployment Target, click New and select Application Container Cloud.
5. Select the Hudson Job and ZIP file to deploy.

Hudson job is auto-created and produces archive files ready to deploy to Application Container Cloud Service.

Once the Hudson project build succeeds in Developer Cloud Service, you can create a new deployment configuration targeting Application Container Cloud Service and select the archive file in the deployment configuration page.