Deployment of a Java EE application to Java Cloud Service (Oracle Public Cloud JCS)

0
Share this on .. Tweet about this on TwitterShare on LinkedIn0Share on Facebook0Share on Google+0Email this to someoneShare on Tumblr0Buffer this page

In this previous articleGetting started with Java Cloud Service on the Oracle Public Cloud (WebLogic as a Service) – I have taken  you on a introductory tour into JCS. That article describes how to get going – how to provision a JCS instance – associated with an instance in DBaaS and with backup set up with Storage CS.

In the article you are currently reading, I show you how to use this instance for deploying a Java EE application onto – and subsequently invoking that application.

Since the same consoles are available to us with JCS as with on premises WLS, we can perform an application deployment in the same way from the console by uploading a WAR or EAR file as we can do on premises. I tried my hand at a fairly large application – without any Java EE dependencies (no EJB, JMS or JDBC data source requirements): the ADF Faces Rich Client components Demo application – available from http://www.oracle.com/technetwork/developer-tools/adf/downloads/index.html . The downloaded file is about 105 MB. The subsequent deployment of this file to JCS fails: the step takes quite long – because 105 MB have to be uploaded again, from my laptop into the Oracle Public Cloud. This console could be extended by Oracle perhaps to also offer to upload directly from a URL. On three attempts, after about three minutes into the upload, the deployment process fails. Either on the JCS end or in the browser to server communication is a problem. I am not sure what it is caused by. For now, I will simply try my hand at a smaller WAR.

 

Plan B or Take Two at deploying a Java EE application

Instead of looking around for a suitable ready to deploy WAR file, it is probably even more rewarding to quickly develop a Java EE application, build it as a WAR file and deploy it to my new JCS instance. Using JDeveloper, I quickly whip up a JAX-WS application: a simple Java Class that with some JAX-WS applications is turned to a SOAP Web Service (by right clicking the Class and selecting the option Create Web Service):

image_thumb82

The functionality of this service should be fairly obvious from the code. The WSDL that the derived service exposes can be previewed in JDeveloper:

image_thumb81

Deployment of the service can be done from the project navigator: right click on the ViewController project:

image_thumb79

and select Deploy | WebServices.

Select WAR as the target. Complete the wizard:

image_thumb77

The WAR file is generated:

image_thumb76

With this WAR file under my belt (download it from VerySimpleJCSTestApplication-ViewController-context-root), I return to the WLS Admin Console for the JCS instance and re-enter the deployment dialog.

Upload the WAR file that contains the Greeter Web Service

image_thumb74

Step through the deployment wizard:

image_thumb72

image_thumb70

image_thumb69

image_thumb68

image_thumb66

Then activate the changes:

image_thumb64

click on the control tab

image_thumb63

and activate the application:

image_thumb61

image_thumb60

image_thumb59

Go to the Testing tab for the Web Service:

image_thumb58

This tells us the URLs for the WSDL for the web service; note that there are two endpoints, because we have a two-node cluster and the application was deployed on both managed servers.

The end point to use is https://public-IP-address_for-loadbalancer/VerySimpleJCSTestApplication-ViewController-context-root/Greeter?WSDL. Note that is an HTTPS address – using the default SSL port 443. The WSDL can be viewed in the browser:

SNAGHTML41480f7_thumb1

I create a new SoapUI project for this WSDL:

SNAGHTML414d637_thumb1

and then send a test request to the service – from SoapUI on my laptop to the JCS instance on the internet:

image_thumb55

This clearly proves that the JCS instance is running, that the application deployment was successful and that the load balancer is also doing its job.

I have also performed a little load test from SoapUI:

image_thumb56

375 service requests were sent; the average response time – including network latency – is a little over 40 ms. A second load test yielded an average response time of 270 ms. A third was back down to just over 40.

It is interesting how this is little load test is perceived from the JCS end – in the Service Metrics console:

image_thumb84Resources

Download the very simple WAR file for the Greeter application discussed in this article: VerySimpleJCSTestApplication-ViewController-context-root.

Share this on .. Tweet about this on TwitterShare on LinkedIn0Share on Facebook0Share on Google+0Email this to someoneShare on Tumblr0Buffer this page

About Author

Lucas Jellema, active in IT (and with Oracle) since 1994. Oracle ACE Director and Oracle Developer Champion. Solution architect and developer on diverse areas including SQL, JavaScript, Docker, Machine Learning, Java, SOA and microservices, events in various shapes and forms and many other things. Author of the Oracle Press books: Oracle SOA Suite 11g Handbook and Oracle SOA Suite 12c Handbook. Frequent presenter on community events and conferences such as JavaOne, Oracle Code and Oracle OpenWorld.

Leave a Reply