You can use an Integrated Development Environment (IDE) such as Eclipse to deploy and undeploy an application to an Oracle Java Cloud Service instance.
Prerequisites for Deploying Using an IDE
Complete the following tasks before deploying an application:
Create an Oracle Java Cloud Service instance.
By default, if you created your service instance in an Oracle Cloud Infrastructure Classic region, remote access to the Administration Server in your instance on port
7002is disabled for security purposes. If you did not enable console access while creating your service instance, see Enable Console Access for a Service Instance.
Install the IDE on your local machine.
If you want to use Eclipse, then also install Oracle Enterprise Pack for Eclipse (download location: http://www.oracle.com/technetwork/developer-tools/eclipse/downloads/index.html)
Connect the IDE to a Remote WebLogic Server
To deploy an application to Oracle Java Cloud Service, you must first establish a connection between the IDE and Oracle WebLogic Server.
- Use the Oracle Java Cloud Service console to identify the public IP address of your Administration Server.
- Start Oracle Enterprise Pack for Eclipse.
- Click Workbench.
- Select Window – Show View – Others...
serverin the search box, click the Servers entry, and click OK.The Servers view panel is displayed in the bottom half of the Workbench.
- In the Servers view panel, click No servers are available. Click this link to create a new server...
- Click Oracle, then select the WebLogic Server version of your Oracle Java Cloud Service instance, and click Next.
- In the New Server dialog box, click the browse icon next to WebLogic home, and select your WebLogic Server home directory.
Note:Make sure that the local version of WebLogic Server you’re running is the same version as the instance running on the cloud service. If they are not the same version, then you can’t make a connection.
- Click the browse icon next to Java home, and select your Java home directory.
- Select Remote.
- Set the Remote Host to the IP address of your Oracle Java Cloud Service instance.
- Set Port to 7002. This is the SSL port of your Oracle Java Cloud Service instance.
- Make sure that Use SSL port is checked.
- Set User to the WebLogic Server administrator credentials you specified when you created the Oracle Java Cloud Service instance.
- Click Test Connection.
- In the Success dialog box, click OK.In the Eclipse console, a new connection is added to the Servers view panel. A Validating server... status message is displayed. After the connection is established, the status changes to Started.
Use an IDE to Deploy an Application to a Cluster
You can deploy the application to the administration server by using the Eclipse IDE, for example. You can deploy an application to a cluster by setting properties to add the cluster as a target.
- If you have not done so already, start the Oracle Enterprise Pack for Eclipse (OEPE).
- If Project Explorer is not visible, select Window – Show View – Project Explorer.
- Under Project Explorer, right-click and select Import – WAR file .
- In the War Import dialog, click the Browse button, navigate to the directory where your application resides, and select it. Click Open.
- On the WAR Import dialog, click Finish.
- If an Open Associated Perspective dialog appears, click Yes to associate the perspective of the project to Java Enterprise Edition (Java EE).
- On the Eclipse console, select the Servers tab.By default, the IDE deploys your application to the Oracle Java Cloud Service administration server. You need to deploy the application to a cluster rather than to the Administration Server.
- On the Servers tab, right click on the server connection established previously to the administration server.
- Select Properties.The Properties dialog is displayed.
- Select WebLogic – Publishing – Advanced.
- Click on the green plus sign to add the cluster as the target.A new line is added under Targets.
- Click on Browse.The names of the administration server and the cluster are listed on the Target Name dialog.
- To delete the Administration Server as a target, select the target name and click on the red cross icon next to the Administration Server name.
- To add the cluster as a target, click on the green plus sign.A new line is added under Targets.
- Click Browse and select the cluster where you want to deploy the application.The Administration Server and the cluster are listed in the Target Name dialog.
- Click on the cluster and click OK.
- Click Apply, and then click OK.
- Click on the Servers tab.
- On the Servers tab, right click on the server connection and select Add and Remove...The application is then listed in the available applications section of the Add and Remove dialog.
- Select the name of the application and click Add.
- Click Finish.In the bottom right corner of the Eclipse console, the status of the publish request is displayed.
- Click the icon next to the publish request status message to see the details of the request.The status of the request will become Active.
- On the Servers tab, expand the server connection to see that the application is deployed.
Use an IDE to Undeploy an Application
After you deploy an application, you can undeploy it by using an IDE.
- If you have not done so already, start Oracle Enterprise Pack for Eclipse (OEPE).You can click on the icon on your desktop or search for eclipse on the Windows Start menu.
- Select the Servers tab of the Eclipse console.
- Expand the server connection for the server on which the application resides.
- Locate the application under Published Modules.
- Right-click on the application and select Remove.The application is removed from the published modules list.