Java Magazine, Jan/Feb 2017
ORACLE COM JAVAMAGAZINE JANUARY FEBRUARY 2017 53 cloud Cloud Service and Oracle Java Cloud Service It also ofers continuous integration and development if integrated with Oracle Developer Cloud Service Although applications in Oracle Application Container Cloud Service run in a Docker container based on Oracle Linux the service is intended for you to run your applications not for you to run your Docker containers A key benefit of Oracle Application Container Cloud Service over running Docker containers yourself is that for your Java applications the service comes set up with Oracle Java SE Advanced which includes Flight Recorder diagnostics and profiling capabilities Oracle will take care of Java patching and upgrades The service also handles load balancing and scaling your application By using it you get to operate at a higher level of abstraction and dont have to worry about the underlying Java setup the Oracle Linux base or the Docker container How to Deploy to Oracle Application Container Cloud Service To use Oracle Application Container Cloud Service you dont need to code your application any diferently Understanding the service is mostly about packaging deploying and managing your application Instead of spending time on elaborate code snippets in this article Ill pick up one of the sample applications in the service documentation and see how you can go about tweaking it a bit and then packaging and running it with Oracle Application Container Cloud Service I use NetBeans to make the application easier to understand Lets begin by downloading the code for the Java SE 8 Creating a Web App with Bootstrap and Tomcat Embedded for Oracle Application Container Cloud Service tutorial Its a simple standalone web application that uses servlets JavaServer Pages JSPs the Bootstrap front end framework and an embedded version of Tomcat If youre a Java EE developer used to deploying WAR and EAR files on application servers you might wonder why we need an embedded Tomcat server Its worth pointing out here that the Oracle Application Container Cloud Service environment has Java running on it but there is no server there to run your Java EE application Its up to you to package the server as part of your application Unzip the downloaded code and you will find a Maven project and the requisite project files I use NetBeans to better understand the project and its constituent parts especially how the project is configured for deployment on Oracle Application Container Cloud Service Most IDEs support Maven projects so you could use some other IDE If you prefer you could even use Maven commands from the command prompt Using NetBeans and Maven Open the NetBeans IDE and select File Open Project from the menu Next select the directory where you extracted the code NetBeans will figure out that its a Maven project and handle it accordingly As shown in Figure 1 you have web pages a few Java classes dependencies and the Maven pom xml file The project object model contains project information and the configuration that is used by Maven to build the project Open the Figure 1 NetBeans Project view
You must have JavaScript enabled to view digital editions.