Introducing the Oracle Public Cloud Java Service
Join the DZone community and get the full member experience.
Join For FreeWho expected that to happen: Oracle is working on a public cloud offering and the signs of the approaching official launch are there. Nearly a year after the
official announcement I was invited to join the so called "Early Access" program to test-drive the new service and give feedback. Thanks to Reza Shafii
who is the product manager in charge I have the allowance to dish the
dirt a bit. Even if I am not allowed to show you some screenshots from
the UI there is plenty to talk about. And today I am willing to give you
a first test-drive of the developer experience with NetBeans.
Preparations
Create your Java EE Application
All you have to do now is to create a new Java EE Web Application with NetBeans. Give it a name (I'm calling it MyCloud) and add a new local WebLogic 10 server in the "Add..." Server dialogue. Don't forget to chose Java EE 5 as EE version. Let's add JSF 2.0 and Primefaces 3.2 on the Framework tab. Click "Finish". If NetBeans is complaining about missing server libraries, let it deploy them. That's it for now. Right Click your app and Run it. This will fire up your local WebLogic domain and point your browser to http://localhost:7001/MyCloud/ or whatever your app is called. as you can see, the Primefaces components are also working. Not spectacular.
Add Cloud...
Next you have to add some cloud. Switch to the services tab, right click on the cloud node and select "Add Cloud...". Chose "Oracle Cloud" and click Next. You will have to fill in a couple of information here.
- Identity Domain. The individual or group identity of your Oracle Cloud account.
- Java Service Name. The name of the Java Service.
- Database Service Name. The name of the Database Service.
- Administrator. Your identity as Oracle Cloud administrator.
- Password. Your Oracle Cloud administrator password.
- SDK. Path to your local copy of the Oracle Cloud SDK. Click Configure to browse for this file.
Click "Finish" if everything is filled out correctly. NetBeans verifies your provided information against the OPC and you now have the Oracle Cloud in it. Additionally you find a new server "Oracle Cloud Remote" which is actually the server hook you have to specify in your projects run configuration. Go there. Switch it from local "Oracle WebLogic Server" to "Oracle Cloud Remote" and hit OK. Now you are all set for the cloud deployment.
Run in the Cloud...
Right click and "Run" your project. You see a lot of stuff happen. First of all NetBeans is doing the normal build and afterwards is starting the distribution. First of all this is uploading the bundle (MyCload.war) to the cloud. It get's scanned for viruses and needs to pass the Whitelist scan (more on this later). If both succeeds the deployment happens and your application is opened in your system's default browser:
That was a typical development round-trip with the Oracle Public Cloud Java Service. Develop and test locally deploy and run in the cloud.
Some more NetBeans goodies
But for what is the "Oracle Cloud" entry in the Cloud services good for? For now this is very simple. You can use it to access your deployment jobs and the according log-files.
Every deployment gets a unique number and you see the deployments status. Together with the log excerpts you are able to track that down further. Let's try some more. Add a servlet named "Test" and try to use some malicious code ;)
System.exit(0);
First indication that something is wrong here is dashed code hint.
ERROR - Path:D:\MyCloud\dist\MyCloud.war (1 Error) ERROR - Class:net.eisele.opc.servlet.Test (1 Error) ERROR - 1:Method exit not allowed from java.lang.System.(Line No:41 Method Name:java.lang.System->exit(int)) ERROR - D:\MyCloud\dist\MyCloud.war Failed with 1 error(s)
It is disappointing but there are limitations (aka White List) in place
which prevent you from using every single Java functionality you know.
For the very moment I am not going to drill this down further. All early
access members had to say something about the restrictions and Oracle
listened carefully. A lot of things are moving here and it simply is too
early to make any statements about the final white list. A lot of 3rd
party libraries (e.g. primefaces) are tested and run smoothly. Those
aren't affected by the white list at all.
Bottom Line
That is all for today. I am not going to show you anything else of the
OPC. And I know that you can't test-drive the service your own. You need
to have the Javacloud SDK in place which isn't publicly available
today. But it will be. And there will be a chance to test-drive the
cloud for free. A trial. And I am looking forward showing you some more
of the stuff that is possible. As soon as it becomes available. As of
today you can register for access and get notified as the service is ready to sign you up!
Published at DZone with permission of Markus Eisele, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.
Comments