Skip to content

Deploying the Generated Service

Before you can deploy a service, you must generate it. See Generating an OData Service.

After generation, the Java EE WAR file should be found in your project's target subfolder.

Note

For production usage, the generated Java EE web application (OData service) can be deployed to the SAP Cloud Platform, or the service can be deployed to an on-premise Apache TomEE or Eclipse Virgo, using SAP Cloud Platform Connector together with SAP Cloud Platform Mobile Services to enable connectivity to the OData service by mobile clients.

Automated Deployment During Service Generation

See the -cf:push and -local:deploy options.

See the example tasks.json for automated deployment when using SAP Business Application Studio or Visual Studio Code.

Manual Deployment to a Local or On-Premise Web Application Server

The procedure for deployment of the generated Java EE WAR file depends on the target server environment. Consult the relevant documentation for the target server environment for full details.

A number of web application servers may make hot redeployment difficult (without restarting the server and manually deleting some files), due to the running server retaining file locks.

A fail-proof approach for redeployment into Tomcat and TomEE is as follows:

  • Stop the server.

  • Delete the server's webapps\<app> folder.

  • Delete the server's webapps\<app>.war file.

  • Copy the new WAR file into the server's webapps folder.

Manual Deployment to SAP Cloud Platform – Cloud Foundry Environment

Using SAP Cloud Platform Cockpit for Cloud Foundry

This procedure refers to the SAP Cloud Platform Cockpit, and is subject to change if the cockpit UI changes. If in doubt, please consult the Develop Applications topic in the SAP Cloud Platform documentation.

If you don't yet have a SAP Cloud Platform account for Cloud Foundry, start by signing up.

  1. Once you are in the cockpit, navigate to your Subaccount, then your Space.

  2. Click on the Deploy Application button.

  3. For the File Location, browse to the WAR file in your project's target folder.

  4. For the Manifest Location, browse to the manifest.yml in your project folder.

  5. Click on the Deploy button.

  6. See also Securing the Generated Service.

Using the cf Command-Line Tool

If not already done, Install Cloud Foundry Tools.

  • Use the cf api command to select your target Cloud Foundry environment.

  • Use the cf login command to authenticate yourself with Cloud Foundry.

  • Use the cf push command to deploy your application to Cloud Foundry.

  • Use the cf routes command to find the URL for accessing your service.

Example push command:

cf push -f c:\projects\myapp\manifest.yml

Manual Deployment to SAP Cloud Platform – Neo Environment

Using SAP Cloud Platform Cockpit for Neo

This procedure refers to the SAP Cloud Platform Cockpit, and is subject to change if the cockpit UI changes. If in doubt, please consult the Develop Applications topic in the SAP Cloud Platform documentation.

If you don't yet have a SAP Cloud Platform account for Neo, start by signing up.

  1. Once you are in the cockpit, go to Applications > Java Applications, and select Deploy Application.

  2. Select the WAR file by browsing your local computer for the WAR file in your project's target folder.

  3. Specify an application name: the name you enter here is how the app is referred to in the Neo environment. Select the runtime Java EE 7 Web Profile TomEE 7 and select Deploy. When completed, select Done. Don't start the service yet; however, you can select the name to see its details.

  4. If you aren't using the in-memory database, you must bind your application to the correct database instance. Go to Configuration > Data Source Bindings. Select New Binding. Leave the data source as <default\>. Select the database ID and the database user/password for your database. Select Save.

  5. Start your application.

  6. See also Securing the Generated Service.

Using the neo Command-Line Tool

If not already done, Install Neo Console Client.

Example deploy command:

neo deploy --host hanatrial.ondemand.com --account *myuser*trial --application myapp --source
    c:\projects\myapp\target\odata-service-1.0.0.war --user myuser --runtime neo-javaee7-wp

Available bind commands:

neo help bind-db
neo help bind-hana-dbms
neo help bind-schema

Example start command:

neo start --host hanatrial.ondemand.com --account *myuser*trial --application myapp --user *myuser*

For detailed instructions, see the SAP Cloud Platform documentation: Development > Applications in the Neo Environment > Java: Development > Deploying and Updating Applications > Deploy on the Cloud with the Console Client.


Last update: August 12, 2020