1 2 3 Previous Next


67 posts

In an earlier post I wrote about Getting to Know the Developer Cloud Service. There wasn't an IDE used in that post and I'm a big fan of IDEs. So in this post we'll look at how Eclipse, in combination with the Oracle Developer Cloud Service, can be used to support the complete application lifecycle, from inception to production. In between we'll create bugs, create code branches, initiate code reviews, and merge code branches. We'll also slip in some continuous integration and continuous delivery. This is often also referred to as DevOps.


  • You have Maven installed.
  • You've installed the Oracle Enterprise Pack for Eclipse (OEPE) or added the OEPE plugin repository to your existing Eclipse installation. You have to be at a minimum version of OEPE 12.1.3 6 (the latest at the time of this writing).
  • You have an Oracle Developer Cloud Service (DevCS) account. You can Try It for free.
  • You have a Java Cloud Service (JCS) instance available for deployment. JCS trials are available to you via your local Oracle sales consultant.
  • A local installation of WebLogic Server. The version must match the JCS version. WebLogic is free for desktop development environments.

Configure Oracle Enterprise Pack for Eclipse (OEPE)

  • The Oracle Cloud window is available from the Java EE perspective, so switch to that perspective if necessary
  • From the Oracle Cloud window, click the Connect link:

  • Add your Developer Cloud Service connection information:

  • Active your Java Cloud Service instance:

  • To activate, you need your private key file and the directory location of your local WebLogic runtime:

  • Once Activated, you can start the SSH tunnel:

Create Developer Cloud Service Project

  1. Log into the Developer Cloud Service and create a new project,DevOps Example:

           A Private project is accessible to invited members only. A Shared project is visible to all members of the team, however, team members still need to be added in order to interact with the project, which we'll do in a later step.
  2. If desired you can select from a project template. Project templates contain Git source repositories, wiki pages, Maven artifacts, and build jobs that are cloned to the new project. For this example we will be starting without a template.

  3. Finally, select your preferred Wiki Markup language. I'll be using Confluence in this example.

  4. Then wait a few seconds as your project is provisioned:

  5. After which you'll be presented with the home page of your project:

    The home page contains a steam of information about what has happened in our project, such as changes to source, code reviews, build jobs and wiki updates. Actually, you can configure any RSS/Atom feed of interest.

Add Project Team Members

Since I've set the Project Security as Shared, all members of my team can see the project. However, I will need to add them so they can interact with the project.

  1. On the Home page, switch to the Team view:

  2. Then click the "Click to add a new team member" label:

Now Catalina and Raymond will be able to fully interact with the project.

Create a Project Wiki

The Wiki allows us to collaborate as a team. For our purposes, we'll create a simple Wiki outlining our project goals.

  1. Switch to the Wiki tab and click New Page:

  2. Enter some text:

  3. If necessary, click the Help button to view the Confluence Markup Cheat Sheet:

  4. Preview your work:

  5. Optionally add Attachments:

  6. And optionally restrict access rights to All (non-project members), Members and Owners or just Owners:

  7. And finally Save the page:


Now we will switch to Eclipse, where we will create a new Maven project. For our purposes, the project will be a simple web application, created using the maven-archtype-webapp.

  1. Switch to Eclipse

  2. File > New > Maven Project

  3. Select maven-archetype-webapp:

  4. Set the GroupID and ArtifactID and click Finish to generate the project.

  5. The POM is missing the Java Servlet dependency, hence the red x:

  6. Double-click the pom.xml and switch to the Dependencies tab and Add the Servlet API:

  7. Save and close pom.xml. In a few seconds, the red x should clear from the Project Explorer window:


Is it now time to put our project under source code control.

  1. Create a Git Repository (File > New > Other > Git > Git Repository) and browse to the project location:

  2. Right-click the project and select Team > Add to Index:

  3. Right-click the project again and select Team > Commit. Then add a message and select Commit and Push, which will also push the changes to the Developer Cloud Service:

  4. When you are prompted for the Destination Git Repository, return to the Developer Cloud Service and select the Code tab. This page provides everything you need, whether you're working with Git from the command line, and IDE or a tool like SourceTree.

  5. Copy and Paste the HTTP URI from Developer Cloud Service to the URI field of the Push Branch master dialog. Also, enter your Developer Cloud Service password and optionally select Store in Secure Store.

  6. Click Next:

  7. And click Next to review the Push confirmation:

  8. Wait a few seconds for the Push Results dialog:

Developer Cloud Service - Build Project

Now that we have project code we can configure a build in our project.

  1. Switch to the Home tab where you can see the activity stream thus far on our project:

  2. Copy the HTTP URI for the Git repository as we will need it in the next step when we configure our build.

  3. Navigate to the Build page:

  1. There's a Sample_Maven_Build that can be used for reference (and will probably successfully build our project), but let's create a build from scratch. Select New Job:

  2. Under Source Code, select Git and paste the Git repository URL:

  3. Under Build Triggers, set the SCM polling schedule to * * * * * (every minute). This is standard Cronschedule formatting. This will trigger a build anytime Git is updated.

  4. Add a build step to invoke Maven 3. The defaults for this step suffice:

  5. Finally, under Post-build Actions, select Archive the artifacts and add target/* to the Files to Archive. This will archive the devopsexample.war for deployment.

  6. Click Save.

  7. Click Build Now. An executor will pick up the build and the build will be queued. With in a minute the build should kick off. You can click the Console icon to monitor its progress:


  8. You can see the build status and retrieve the artifacts from the build job # page:

Developer Cloud Service - Deploy Project

Once we have a successful build, we can deploy the project to the Oracle Java Cloud Service. The project can also be deployed to directly from Eclipse, just as you would to any remotely configured server. For this exercise, we will configure the Developer Cloud Service to deploy our project.

Oracle Developer Cloud Service deploys applications to the Oracle Java Cloud Service server through an SSH tunnel to the Oracle Java Cloud Service Instance Admin VM. Authentication is done through an Oracle Developer Cloud Service generated private-public key pair. You must import the public key into the Oracle Java Cloud Service Instance Admin VM to allow Oracle Developer Cloud Service access to the VM. Follow the steps at Installing the Oracle Developer Cloud Service Public Key in the Oracle Java Cloud Service VM to complete this one time exercise.

  1. Get the Public IP address of the Administration Server Domain from the Java Cloud Service Console:

  2. Switch to the Deploy tab:

  3. Click New Configuration and fill in the details. I've configured the deploy to occur with each successful build:

  4. For the Java Service, you need to configure the remote target (JCS):

  5. Supply the IP address you selected in step 1 and supply your WebLogic server administration credentials (set when you created the JCS instance):

  6. Click Test Connection:

  7. Click Use Connection:

  8. Click Save, which will create the Deployment:

  9. Right-click the gear and select Start:

  10. Wait while the application is started:

  11. And within a minute the deployment succeeds:

Run the Application

For this exercise, we need to know the IP address of our load balancer, which is also available in the image of the Alpha01JCS instance above: Therefore we could expect our application to be available at, but it's not. Unless explicitly specified in a deployment descriptor, the Developer Cloud Service generates its own context root. To find it, we need to look in the WebLogic Admin Console.

  1. Click the Java Service link to launch the WebLogic Admin Console.
  2. Navigate to the Deployments page where you'll find devopsexample:

  3. Click the devopsexample deployment to find the Context Root:

  4. The application is accessible at

Developer Lifecycle - Issues/Tasks

Now that we've successfully created and deployed our application, let's work through some developer lifecycle issues (bugs, code reviews, etc.). I know one problem that we want to fix is the context root of our project. In addition, we'll make the home page more personal. We'll start by submitting an issue to address both of these items (yes, these two issue should be tracked separately).

Developer Cloud Service - Issues

  1. Switch to the Issues page:

  2. Click New Issue and enter some values. Note, the content for most of the fields you see on this page are configurable from the Administration page, including the ability to add custom fields.

  3. Click Create Issue.

Eclipse - Tasks

The Oracle Developer Cloud Service is integrated with the Mylyntask and application lifecycle management framework. Let's see how this works.

  1. In the Oracle Cloud window, expand the Developer node, which will reveal your Developer Cloud Service projects:

  2. Double-click the DevOps Example project to activate it. Then do the same for Issue and Mine, which we cause Eclipse to fetch the issue from the Developer Cloud Service:

  3. At this point, the issue is also viewable in the Eclipse Task List window:

  4. Double-click either location to open the task:

  5. Accept the task and click Submit. The Status update is reflected in the Developer Cloud Service:

Eclipse - Git/Tasks

We will create a new branch to work on this task.

  1. Right-click the project and select Team > Switch To > New Branch:

  2. Name the branch Task 1 and click Finish:

  3. In the Task List, right-click the task and select Activate. This will associate the task with the issue:

  4. Open index.jsp and change the heading to Hello DevOps Example:

  5. Ctrl+N and add a new Oracle WebLogic Web Module Descriptor:

  6. And place it in the src/main/webapp/WEB-INF folder:

  7. And set the Context Root to devopsexample:

  8. Right-click the project and Select Team > Commit. Because of the Task association, the commit knows these changes apply to Task 1. Select weblogic.xml to include it in the commit:

  9. Select Commit and Push:

  10. Click Next:

  11. Click Finish and wait for the Push Results:

Developer Cloud Service - Merge Request

Now we'll initiate a code review. If all looks acceptable, we'll merge the code into the master branch.

  1. Switch to the Developer Cloud Service Merge Requests tab:

  2. Click New Request. Select the Repository (there's only 1 at the moment in this project), Target Branch, Review Branch, Reviewers (yes, I'm reviewing my own code for this example):

  3. Click Create, which will open the Review:

  4. Click the commit (6fefe85 in my case) to view a summary of the changes:

  5. From here the review team can click any line to add a comment. For example:

  6. When I'm finished with my review, I can Publish my comments:

  7. Once satisfied, click Approve:

  8. And the Reviewers pane will update to reflect my status to the rest of the review team. Notice I can also always add additional reviewers at any time.

  9. Once all reviewers approve, click Merge to merge the changes into the master branch:

The Fun Begins

  • Recall we triggered our builds to run after a source code commit. Checking the build page I see a new build did indeed run:

  • Recall we triggered our deploys to occur after a successful build. Checking the Deploy page I see a new deploy did indeed happen:

  • Most importantly, does our application now behave as desired:

In a development environment, if I wanted to bypass the review cycle, I would simply commit my changes to the master branch, which would trigger the automatic build and deploy. Alternatively, I could have a development branch to which I commit to directly and then a QA branch which undergoes a code review. The possibilities are up to your design.

Cleaning Up and Other Tidbits

To put a bow on what might be the longest blog I've ever written, let's return to Eclipse.

Resolve the Task

  1. Switch to Task 1 and notice it's marked as having incoming changes:

  2. Click the link to refresh the task, then submit the task Resolved as Fixed.

Pull the Latest Master

  1. With index.jsp open in the editor, switch back to the master branch (Team > Switch To > Master).
  2. You'll notice index.jsp reverts to Hello World!.
  3. Right-click the project and select Team > Pull:

  4. index.jsp refreshes to show Hello DevOps Example!.

View/Run Builds from Eclipse

You can monitor the build status, as well as launch builds, directly from Eclipse.

  1. In the Oracle Cloud Window, double-click the builds:

  2. Double-click Build #2 to view its details:

  3. Finally, you can right-click the build job to launch a build from Eclipse:

Validating Oracle Java Cloud Service HA

One of my favorite applications from my Sun Java System Application Server days was the Cluster JSP Sample Application. In a cluster configuration fronted by a load balancer, this simple JSP provides a nice summary of which cluster node handled the request as well as the ability to test session failover. Therefore, why not try it on the Oracle Java Cloud Service (JCS):

Cluster - HA JSP Sample

I have a JCS instance with 2 managed server nodes, Alpha01J_server_1 and Alpha01J_server_2:

Instance Alpha01JCS

My Load Balancer Policy is set to Round Robin. If I start a new session (by using a different browser), the load balancer will direct me to managed server Alpha01J_server_2 hosted on alpha01jcs-wls-2:

So I have easily confirmed that the load balancer is working as expected. Let's add some data to the session hosted on Alpha01J_server_1 hosted on alpha01jcs-wls-1:

Cluster - HA JSP Sample with session data m

Now let's simulate a failure condition. To do that, I will SSH into alpha01jcs-wls-1 and kill the Alpha01J_server_1 WebLogic server process:

SSH Kill Alpha01JCS

When I then return to my application and reload the page, my execution server has failed over to alpha01jcs-wls-2 and my session data remains intact:

Cluster - HA JSP Sample with Session Failover

Through the WebLogic Administration Console, I can verify all sessions have failed over to Alpha01J_server_2.

Server Failover Status

You'll also notice that the node manager has already started my failed Alpha01J_server_1 server.

One other point to note, the application needs to inform WebLogic that its session should be replicated. This is done via the session-descriptor in the WebLogic deployment descriptor, so I added the following weblogic.xml to the sample application:

<?xml version = '1.0' encoding = 'windows-1252'?>
<weblogic-web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.oracle.com/weblogic/weblogic-web-app http://xmlns.oracle.com/weblogic/weblogic-web-app/1.5/weblogic-web-app.xsd"


Finally, if you wish to experiment with the application yourself, I have uploaded it here: custerjsp.war.


The Oracle Storage Cloud Service provides both REST and Java APIs for managing storage containers. As the REST APIs are OpenStack Swift compliant, you can also use third party tools such as the CloudBerry Explorer for OpenStack to manage your storage containers.

The values needed to add a new OpenStack Storage Account connection will be found in the REST Endpoint, which you can find on your Oracle Storage Cloud Service Details page:

Oracle Storage Cloud Service Details


Add New OpenStack Storage Account

Set the User name setting to: Storage-<your Oracle Cloud Identity Domain>:<your Oracle Cloud User Name>.

The API key is your Oracle Cloud Password.

The Authentication Service ishttps://storage.us2.oraclecloud.com/auth/v1.0.

Un-check the option to Use Keystone authentication.

Testing the Connection should show you a Connection success:

Connection Success

Once connected you will be able to manage your storage containers:

CloudBerry Explorer for OpenStack Storage

Object Properties


Oracle Developer Cloud Service is included as a free entitlement with Oracle Java Cloud Service and Oracle Messaging Cloud Service. The Developer Cloud Service includes all the tools you need to support the team development lifecycle. There are popular open source tools such as Git, Maven and Hudson. There's also task management, code reviews and a wiki.

The easiest way to experience the Oracle Developer Cloud Service is through a trial of the Oracle Java Cloud Service - SaaS Extension (click the "Try It" button).

Try It!

In this article I will introduce the Developer Cloud Service by using Maven to create a new web application, Git to manage the application source and Hudson to build and deploy my application to the Java Cloud Service.


If you plan to follow along, this tutorial also assumes you already have Maven and Gitinstalled. I will be using the Git Console from my desktop to interface with the Developer Cloud Service. The tutorial also assumes, of course, that you have access to the Developer Cloud Service!

Create a New Project

As a first step, log into the Developer Cloud Service and create a new project.

All Projects

Give the project a Name, Description and select the Privacy setting (for team projects you should select Organization Private):

Create Project Name

For this example, we will not be using a template:

Create Project - Template

And finally, chose the Wiki markup style you prefer and click Create Project to begin:

Create Project - Properties

As the project is being created, you can watch as the services are being provisioned for you. This should only take a couple of seconds:

Service Provisioning

Soon, project service provisioning is complete and you're ready to start using your new project:


Develop an Application

Here we'll use Maven to quickly create a web application. I'm going to do this from the Git Console so I'll have a consistent local user interface throughout this tutorial. This is the Maven command I'll be running, which creates a fully functional Hello World web application:

mvn archetype:generate -DgroupId=HelloDeveloperCloudService -DartifactId=HelloDeveloperCloudService -DarchetypeArtifactId=maven-archetype-webapp -DinteractiveMode=false

mvn generate

Let's now put the application under source control management.


We begin by creating a Git repository for our web application. If you're not already familiar with Git, their Try Git tutorial provides an excellent introduction.

Change into the newly created application directory and run:

 git init


Next we need to add the files to the repository index and stage them for commit:

git add .

git add

Now commit the new files to the local repository.

git commit -m "Add initial webapp files"

git commit

Now we need to add our remote repository (the one in the Developer Cloud) to Git. For this you'll need to copy the Git source code repository URL from your Developer Cloud Service project. 'dcs' is the name we will use to refer to this repository going forward:

git remote add dcs {copy https URL from Developer Cloud Service project}

git remote add

Now push our web application project files to the Developer Cloud Service. The name of our remote is 'dcs' and the default local branch name is 'master'. The -u tells Git to remember the parameters, so that next time we can simply run git push and Git will know what to do.

git push -u dcs master

At this point you'll also be prompted for your Developer Cloud Service password:

git push


Now that our source code is in the Oracle Cloud, we can run a Hudson build Job. The Developer Cloud Service comes pre-configured with a sample Maven build job that will properly build this application.

If you first want to see your code, click the Browse tab and click View Commits:


View Commits

Click the Build tab, where you'll see the provided Sample_Maven_Build:


Click the Sample_Maven_Build link to open the job:


Feel free to review the configuration (click the Configure link). When you're ready, click the Build Now link. The build will get queued, waiting for an executor:

Waiting for Executor

Soon thereafter, the build will begin:

Build Running

Feel free to click the console icon to track the Console Output. In my case, the build has already completed, so the build indicator ball has turned green:

Console Output


Console Output


Now that we have a successful build, we can configure deployment. Click the Deploy tab and then click New Configuration:


Complete the Deployment Configuration. As I'll be using this configuration for development, I'll set it to deploy automatically after a successful build:

New Deployment Configuration

Click Save to see your new Deployment Configuration:

New Deployment

This deployment will run any time there's a new build. To run this build manually, click the gear icon and select Start:

Start Deploy

And wait a few seconds for the deployment to succeed:

Deployment Succeeded


Click the Java Service link to navigate to your Java Service. There, under Jobs, you'll also find that the Deploy Application job is Complete:


On the same page, under Applications, click the Test Application icon:

Test Application

Then click the Application URL in the window that pops up:

Application URLs

Which will open your application in a new tab:



As this application stands right now, it would require cloud credentials in order to run it. Let's quickly remedy that.

Updating the Application

Back in the Git Console, add and empty<login-config/> tag to the web.xml. You can read about the details of Updating web.xml in the Cloud Documentation.


While were are here, let's also make a visible change to the index.jsp:


Then commit:

git commit

Push the changes to the Developer Cloud Service:

git push

Return to the Developer Cloud Service Console and optionally view the changed files:

Files Changed

Switch to the Build tab and click the Schedule Build icon (just to the right of the Console icon). In the true spirit of continuous integration, it is also possible to configure Hudson to poll for changes to the repository, but that's now how this sample build has been configured.

Schedule Build

When the build completes, remember deployment is automatic. Just return to your browser and refresh the page:


There is much more to experience with the Developer Cloud Service - Tasks, Code Reviews, Wikis. The plan for this tutorial was to give you enough to started. Are you ready?


Hello Oracle Cloud Blog

Posted by bleonard May 29, 2014

On January 2nd I received a New Year's gift, my "Welcome to Oracle Cloud" email. I had requested a 30-day free trial back on October 17, when the Oracle Cloud was first announced, and had basically forgotten all about it. If you haven't already, request a trial account for yourself:

The Oracle Cloud integrates very nicely with Eclipse, NetBeans and JDeveloper, where you can develop and deploy to the cloud just as if you would to a local instance of WebLogic. The goal of this entry is to show you how to configure JDeveloper to deploy to the cloud. In the resources section below I've included pointers to instructions for both Eclipse and NetBeans.

Configuring JDeveloper

There are specific versions of JDeveloper, Eclipse and NetBeans that work with the Oracle Cloud. All of the Oracle Cloud related downloads are assembled for you on the Oracle Cloud Downloads page. For JDeveloper you need version However, not just any version of will do. There was a special release of version just to support the Oracle Cloud. To verify that you have it, check the About box reads BUILD JDEVADF_11.

If not, just download and install JDeveloper again.

Once you have the correct version of JDeveloper installed, you can establish a pointer to the WebLogic server instance hosted in the Oracle Cloud. Switch to the Application Server Navigator. Right click the Application Servers node and select New Application Server:

Give the connection a name and set the Connection Type to Oracle Cloud:

Supply your Oracle Cloud account credentials:

Go to the My Account Administration URL, select the java service, and note the Data Center, Service Name and Identity Domain:

Use these values to populate the next page of the Create Application Server Wizard:

Finally, test your connection. If the connection test fails, double-check your inputs. I got tripped up for a long time because I had a typo in my Identity Domain:

You are now configured to deploy applications to the cloud just as you would a local application server!

Deploying Hello Cloud

Create the Application

As a test, let's create a simple Hello World application. Create a new Generic Application, HelloCloudApp:

And associated HelloCloudProj. There's no need to select any specific Project Technologies for this simple application:

Create a new JSF Page:

I'm naming it index.jspx:

Design your page. I'm simply adding an Output Text:

At this point we could deploy the application, but it would require your cloud credentials in order to view it. We need to make one minor addition to the web.xml which will make it available to the public. Simply add the empty <login-config/>tag to the file as shown below. You can read about the details ofUpdating web.xml in the Cloud Documentation.

Create the Deployment Profile

Double-click the project to open the Properties dialog and select Deployment to create a new Deployment Profile:

Select Archive Type as WAR File. All applications to the Oracle Cloud must be deployed as a WAR or EAR. See Supported Application Containers and Services for details:

Optionally, give the application a more user friendly Context Root:


Right-click the HelloCloudProj and select Deploy > HelloCloudApp. Select Deploy to Application Server:

Select the OracleCloud server we set up earlier:

Monitor the Deployment progress in the Deployment - Log:

Since JDeveloper knows we are deploying to the Oracle Cloud, it automatically runs the application through the whitelist utilities, which ensures you're not trying to use certain APIs. Read the details at About Java Cloud Service Whitelist. Click the Oracle Deploy Job Log link in the output window to see the details of the API Whitelist run.

Access Your Application

The application is live and public:


Your access URL should be the same, except for the identity domain. Just swap mine with yours. If you want, leave a link to your running Hello Cloud app in the comments.

It's never been so easy to make a Java EE application public!


I'm expanding on an earlier post where I explained how to deployJAX-RS Web Services to the Oracle Cloud. In that entry the web service simply returned a hard-coded "Hello World". In reality, you most likely want your web service to expose something more meaningful. In this post I'm going to expand the HelloJerseyApp to display the results from a table, which I'll expose using a JPA entity.

Step 1. Open HelloJersey in JDeveloper

Downloadthe HelloJerseyApp, which was created in the previous blog post, and open it in JDeveper.

Step 2. Create a JPA Entity

As I already have the Oracle HR sample database set up in the cloud, I will create an entity to represent the COUNTRIES table. Note, I also have a local copy of the HR sample database that I will initially use the generate the entity. I will switch the configuration to use the cloud datasource just before I deploy.

Open the New Gallery and select Entities from Tables:


Select EJB 3.0 - JPA Entities:


Select Next to accept the default Persistence Unit:


Select Online Database Connection as the Connection Type:


Create a new (or copy an existing) connection to the HR schema:


Select the COUNTRIES table:


Optionally set the Package Name:


And optionally change the entity name. I like to keep them singular:


And click Finish to generate the Entity.

Step 3: Generate a Java Service Facade

The Java Service Facade has a Main method, which will allow you to easily test your methods before deploying to the cloud.

Right-click the persistence.xml (that was generated when we created the entity) and select New Java Service Facade. I'm updating the Service Class Name tofacade.CountryFacade.

For reasons beyond my understanding, this wizard does not recognize the persistence unit that was just created as part of the Create Entities from Tables wizard. No worries, we can have 2 persistence units.


Select the defaults provided to create a new persistence unit:


You can leave the Java Service Facade Method defaults:


And click Finish to generate the facade class.

Step 4: Add the Service Method

Here's a simple service method that will return an array of country names: 
 public String[] getCountryList() {
   List<Country> allCountries = getCountryFindAll();
   String[] countryList = new String[allCountries.size()];
   for (int i = 0; i < allCountries.size(); i++) {
     countryList[i] = allCountries.get(i).getCountryName();
   return countryList;

With the System.out.println, you can then call this method from the Main method to quickly test the entity:

 public static void main(String [] args) {
   final CountryFacade countryFacade = new CountryFacade();
   //  TODO:  Call methods on countryFacade here...

Right-click the source and select Run. Look for the results in the Output window:


Step 5: Rest Enable the Class and Method

Add the @Path annotation to the class:

  import javax.ws.rs.Path;
  public class CountryFacade {

At the @Get, @Path and@Produces annotations to the method and delete theSystem.out.println:

  public String[] getCountryList() {
    List<Country> allCountries = getCountryFindAll();
    String[] countryList = new String[allCountries.size()];
    for (int i = 0; i < allCountries.size(); i++) {
      countryList[i] = allCountries.get(i).getCountryName();

Step 6: Update Datasource for Oracle Cloud

Now that the service method is behaving as we like, we need to update the persistence unit's datasource to the Oracle Cloud.

Remember when we ran the New Java Service Facade wizard, a new persistence unit was created, HelloJerseyProj-1. We are going to switch the CountryFacade class to use the original persistence unit, HelloJerseyProj.

 public class CountryFacade {
 private EntityManagerFactory emf = Persistence.createEntityManagerFactory("HelloJerseyProj");

We will then update the HelloJerseyProj persistence unit to call the cloud datasource, which isdatabase.

 <persistence-unit name="HelloJerseyProj">
      <property name="eclipselink.target-server" value="WebLogic_10"/>
      <property name="javax.persistence.jtaDataSource"

Step 7: Deploy and Use

Deploy as before. Once deployed, you'll be able to access the list of countries at the following URL (swapping out my Identity Domain for yours):


Web Forms is one of the exciting new features of the recently released BPM To really embrace the power of Web Forms, one must understand Forms Rules, which can give your forms dynamic behavior, such as showing a field or calculating a sum total. In this example, I'm going to show you how to use Form Rules to dynamically populate a dropdown (or list).

Step 1: Create the Web Form

Using Business Process Composer, create a new BPM Process calledDynamicDropdown. Then create a new Web Form calledDropdownForm. Add 2 dropdowns on the form:Country and City. Your form should look as follows:

Step 2: Add the Country Rule

Click the rules icon to toggle to the Form Rules:

Create a new rule and click the edit Rule icon, then create the rule PopulateCountry as follows:

If you're playing along at home, you are free to use the same public URL as it returns a list of 5 countries as JSON output (if you want your country added to the list, just let me know): https://javatrial0129-usoracletrial80797.java.us2.oraclecloudapps.com/LOVHelper/jersey/listvalues/countries. Just note that you will also need to add the Oracle Cloud's certificate to your WebLogic KeyStore See Calling an Oracle Cloud Service from Java for details.

Note, the JavaScript editor validates when you tab out of the Rule field. So if there's an error for example:

If you want to test run your form at this point, click the blue running man icon :

Step 3: Add the City Rule

It's very common to have the results of one field determine the contents of another. In this case we only want to see cities that apply to the selected country. Create a second Form Rule as follows:

And that's all there is to it:

By default, all connections to the Oracle Cloud are encrypted:

The Problem

Browsers automatically import the necessary certificates, however, trying to access these services from a Java client, you will not be so successful. Take this Java Client:

import com.sun.jersey.api.client.Client;
import com.sun.jersey.api.client.WebResource;
import com.sun.jersey.api.client.config.ClientConfig;
import com.sun.jersey.api.client.config.DefaultClientConfig;
import java.net.URI;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.UriBuilder;

public class OracleCloudClientMain {
   public OracleCloudClientMain() {
   public static void main(String[] args) {
   private static void getJSON() {
      ClientConfig config = new DefaultClientConfig();
      Client client = Client.create(config);
      WebResource service = client.resource(getBaseURI());
   private static URI getBaseURI() {
      return UriBuilder.fromUri(


Attempting to run this, you'll get:

"C:\Program Files\Java\jdk1.7.0_17\bin\javaw.exe" -server -classpath C:\tmp\OracleCloudClientApp\.adf;C:\tmp\OracleCloudClientApp\OracleCloudClientApp\classes;C:\Users\bbleonar_us\Software\jersey-1.17\jersey-bundle-1.17.jar;C:\Users\bbleonar_us\Software\jersey-1.17\asm-3.3.1.jar -Djavax.net.ssl.trustStore=C:\u01\wls1036\wlserver_10.3\server\lib\DemoTrust.jks -Dhttp.proxyHost=www-proxy.us.oracle.com -Dhttp.proxyPort=80 -Dhttp.nonProxyHosts=localhost|localhost.localdomain||::1||leonard-pc|leonard-pc.us.oracle.com -Dhttps.proxyHost=www-proxy.us.oracle.com -Dhttps.proxyPort=80 -Dhttps.nonProxyHosts=localhost|localhost.localdomain||::1||leonard-pc|leonard-pc.us.oracle.com OracleCloudClientMain
Exception in thread "main" com.sun.jersey.api.client.ClientHandlerException:javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at com.sun.jersey.client.urlconnection.URLConnectionClientHandler.handle(URLConnectionClientHandler.java:151)

The Solution

One way to solve this problem is to import the certificate chain into the Java Key Store used by the application. Looking at the command line above, you'll notice that key store is:


So, begin by saving the certificates. For Firefox, this can be done by clicking the More Information button on the pop-up shown above:

And then click View Certificate, which will open the Certificate Viewer. Switch to the Detailstab, select the VeriSign Class 3 Secure Server CA - GS, clickExport and save theVeriSignClass3SecureServerCA-G3.crt to your hard drive.

Now, open a command prompt and navigate to the location of the keystore, in my caseC:\u01\wls1036\wlserver_10.3\server\lib\. You're going to use the java keytool command to import the certificate:

C:\u01\wls1036\wlserver_10.3\server\lib>keytool -importcert -keystore DemoTrust.jks -storepass DemoTrustKeyStorePassPhra se -file c:\tmp\VeriSignClass3SecureServerCA-G3.crt -alias "OracleCloudAppsVeriSignG3" Owner: CN=VeriSign Class 3 Secure Server CA - G3, OU=Terms of use at https://www.verisign.com/rpa (c)10, OU=VeriSign Tru st Network, O="VeriSign, Inc.", C=US Issuer: CN=VeriSign Class 3 Public Primary Certification Authority - G5, OU="(c) 2006 VeriSign, Inc. - For authorized us e only", OU=VeriSign Trust Network, O="VeriSign, Inc.", C=US Serial number: 6ecc7aa5a7032009b8cebcf4e952d491 Valid from: Sun Feb 07 19:00:00 EST 2010 until: Fri Feb 07 18:59:59 EST 2020 Certificate fingerprints: MD5: 3C:48:42:0D:FF:58:1A:38:86:BC:FD:41:D4:8A:41:DE SHA1: 5D:EB:8F:33:9E:26:4C:19:F6:68:6F:5F:8F:32:B5:4A:4C:46:B4:76 SHA256: 64:90:35:46:A5:80:58:D1:E6:F1:BE:AD:11:34:ED:E6:6A:68:31:D2:31:F0:DF:8D:4E:28:53:5D:7A:30:04:96 Signature algorithm name: SHA1withRSA Version: 3 Extensions: #1: ObjectId: Criticality=false 0000: 30 5F A1 5D A0 5B 30 59 30 57 30 55 16 09 69 6D 0_.].[0Y0W0U..im 0010: 61 67 65 2F 67 69 66 30 21 30 1F 30 07 06 05 2B age/gif0!0.0...+ 0020: 0E 03 02 1A 04 14 8F E5 D3 1A 86 AC 8D 8E 6B C3 ..............k. 0030: CF 80 6A D4 48 18 2C 7B 19 2E 30 25 16 23 68 74 ..j.H.,...0%.#ht 0040: 74 70 3A 2F 2F 6C 6F 67 6F 2E 76 65 72 69 73 69 tp://logo.verisi 0050: 67 6E 2E 63 6F 6D 2F 76 73 6C 6F 67 6F 2E 67 69 gn.com/vslogo.gi 0060: 66 f #2: ObjectId: Criticality=false AuthorityInfoAccess [ [ accessMethod: ocsp accessLocation: URIName: http://ocsp.verisign.com ] ] #3: ObjectId: Criticality=false AuthorityKeyIdentifier [ KeyIdentifier [ 0000: 7F D3 65 A7 C2 DD EC BB F0 30 09 F3 43 39 FA 02 ..e......0..C9.. 0010: AF 33 31 33 .313 ] ] #4: ObjectId: Criticality=true BasicConstraints:[ CA:true PathLen:0 ] #5: ObjectId: Criticality=false CRLDistributionPoints [ [DistributionPoint: [URIName: http://crl.verisign.com/pca3-g5.crl] ]] #6: ObjectId: Criticality=false CertificatePolicies [ [CertificatePolicyId: [2.16.840.1.113733.] [PolicyQualifierInfo: [ qualifierID: qualifier: 0000: 16 1C 68 74 74 70 73 3A 2F 2F 77 77 77 2E 76 65 ..https://www.ve 0010: 72 69 73 69 67 6E 2E 63 6F 6D 2F 63 70 73 risign.com/cps ], PolicyQualifierInfo: [ qualifierID: qualifier: 0000: 30 1E 1A 1C 68 74 74 70 73 3A 2F 2F 77 77 77 2E 0...https://www. 0010: 76 65 72 69 73 69 67 6E 2E 63 6F 6D 2F 72 70 61 verisign.com/rpa ]] ] ] #7: ObjectId: Criticality=true KeyUsage [ Key_CertSign Crl_Sign ] #8: ObjectId: Criticality=false SubjectAlternativeName [ CN=VeriSignMPKI-2-6 ] #9: ObjectId: Criticality=false SubjectKeyIdentifier [ KeyIdentifier [ 0000: 0D 44 5C 16 53 44 C1 82 7E 1D 20 AB 25 F4 01 63 .D\.SD.... .%..c 0010: D8 BE 79 A5 ..y. ] ] Trust this certificate? [no]: yes Certificate was added to keystore

After which, your call to the Java service in the Oracle Cloud will successfully run:

"C:\Program Files\Java\jdk1.7.0_17\bin\javaw.exe" -server -classpath C:\tmp\OracleCloudClientApp\.adf;C:\tmp\OracleCloudClientApp\OracleCloudClientApp\classes;C:\Users\bbleonar_us\Software\jersey-1.17\jersey-bundle-1.17.jar;C:\Users\bbleonar_us\Software\jersey-1.17\asm-3.3.1.jar -Djavax.net.ssl.trustStore=C:\u01\wls1036\wlserver_10.3\server\lib\DemoTrust.jks -Dhttp.proxyHost=www-proxy.us.oracle.com -Dhttp.proxyPort=80 -Dhttp.nonProxyHosts=localhost|localhost.localdomain||::1||leonard-pc|leonard-pc.us.oracle.com -Dhttps.proxyHost=www-proxy.us.oracle.com -Dhttps.proxyPort=80 -Dhttps.nonProxyHosts=localhost|localhost.localdomain||::1||leonard-pc|leonard-pc.us.oracle.com OracleCloudClientMain
Process exited with exit code 0.

Calling from an Application Server

If you're trying to use the service from an application server, simply locate the key store in use by the server and add the certificate to it. In the case of WebLogic, you can find the location of the keystore in the AdminServer.log. For example:

javax.net.ssl.trustStore = C:\u01\fmw11117\WLSERV~1.3\server\lib\DemoTrust.jks


See Cofiguring Idenity and Trust for all the details.

In this blog entry I outline the steps necessary to deploy JAX-RS (JSR 311) RESTful web services to the Oracle Cloud. We'll be using Jersey, which is the reference implementation for JAX-RS, and JDeveloper, which is my primary Java IDE.

Step 1. Create a Jersey Library in JDeveloper

Download the latest version of jersey-bundle.jar, which at the time of this writing is version 1.17.1.

Start JDeveloper (the Oracle Cloud requires or

Select Tools > Manage Libraries and select New from the Manage Libraries dialog.

Set the Library Name to Jersey 1.17.1.

Add and Entry forjersey-bundle-1.17.1.jar

The completed dialog should look as follows:

Create Library

Click OK and then OK again to close the Manage Libraries dialog

Step 2: Create the Application

Create a new Generic Application namedHelloJerseyApp:

With a project named HelloJerseyProj:

Step 3: Add the Jersey Library to the Project

Double-click the project name to open the Project Properties dialog. Select Libraries and Classpath and clickAdd Library. Select the Jersey 1.17.1 library that we just created.

While you are there, ensure the Java SE Version is set to1.6, as this is the version the Java Cloud is using.

Step 4: Create a Java Class

Create a new Java Class named HelloJersey. The class will have two methods, one that returns text and another that returns JSON.

import com.sun.jersey.core.header.MediaTypes;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

// The Java class will be hosted at the URI path "/hellojersey"
public class HelloJersey {
   // The Java method will process HTTP GET requests
   // The Java method will be hosted at the URI path "/hellojersey/text"
   // The Java method will produce content identified by the MIME Media
   // type "text/plan"
   public String getHelloWorldText() {
      return "Hello World";
   public String[] getHelloWorldJSON() {
      String[] helloWorld = {"Hello", "World"};
      return helloWorld;

Step 5: Configure Jersey Servlet in web.xml

In the editor you'll notice a Quick Fix to configure web.xml for Jersey JAX-RS web services:

Go ahead and implement the Quick Fix, which will create the web.xml.

Step 6: Create a WebLogic Deployment Descriptor

We will not be deploying the Jersey libraries with our application as they already exist in the Java Cloud. We just need to inform WebLogic that we want to use them.

Create a new WebLogic Deployment Descriptor, selectingweblogic.xml as the descriptor you wish to create:

Once created, select the Libraries and add JAX-RS as follows:

Step 7 (Optional): Make the Service Public

At this point we could deploy the application, but it would require your cloud credentials in order to view it. I'm going to make one minor addition to the web.xml which will make it available to the public. Simply add the empty<login-config/> tag to the file as shown below. You can read about the details of Updating web.xml in the Cloud Documentation.

Step 8: Create a Deployment Profile

Double-click the project name to open the Project Properties, select Deployment and click Newto create a new Deployment Profile.

Set the Archive Type to WAR File and the name to HelloJersey:

On the Edit WAR Deployment Profile Properties page,Specify Java EE Web Context Root asHelloJersey:

Select Library Dependencies and deselect Jersey 1.17.1 under Libraries Selected for Deployment (remember we're going to use the libraries already available on the Java Cloud):

Step 9: Deploy the Project to the Oracle Cloud

For instructions on configuring JDeveloper to deploy to the Oracle Cloud, see Hello Oracle Cloud.

Right-click the project and select Deploy >HelloJersey.

Select Deploy to Application Server:

Select OracleCloud as the Application Server:

If there's an issue with deployment, look at the Oracle Cloud Job Log, which can be accessed from theDeployment - Log window:

Step 10: Use

The two services are now available for use:



In the URLs above, "HelloJersey" is the web context root (set in the WAR deployment profile), "jersey" is the URL pattern (set in web.xml), "hellojersey" is the URI path for the Java class (set in HelloJersey.java) and "text" or "JSON" is the URI path for the Java method (also set in HelloJersey.java).

As a test, I re-created the HRSystem application as described in the tutorial Developing Rich Web Applications With Oracle ADF. It's more than your basic Hello World application. For starters, the HR system application accesses a database. It also takes advantage of some sophisticated ADF features, such as graphs, page flows, auto-suggest, menu options to export to Excel and display in printable page formatting, etc. You can experience it all here: https://javatrial0129-usoracletrial80797.java.us2.oraclecloudapps.com/HRSystem/faces/DepEmpPage.

Deploying the HRSystem application to the Oracle Cloud took 4 easy steps.

Step 1. Connect your IDE to the Oracle Cloud

NetBeans, Eclipse and JDeveloper are all capable of connecting and deploying to the Oracle Cloud. Actually, this step is optional, as the EAR file could be uploaded to the cloud, but the integration with the IDE is nice. See Hello Oracle Cloud for instructions on setting up integration with JDeveloper as well as pointers to instructions for NetBeans and Eclipse.

Step 2. Move Your Database Schema to the Cloud

The HRSystem tutorial application uses the Oracle HR schema. SeeOracle HR Schema Objects in the Cloud for an example of how to do this step.

Step 3. Set your Application Database Connection to the Oracle Cloud Database

Your application connection type must be set to JDBC DataSource as opposed to JDBC URL. For production applications, this is most likely already the case. But the JDBC DataSource name must match the service name provided for you by your Oracle Cloud database service, which you can find on the My Account Dashboard

To update the connection information, Edit the Application Module:


Step 4: Configure Your Access

OK, I took the easy road here and just made my application publicly available. This is achieved by simply adding the empty<login-config/> tag to the bottom of web.xml (see Hello Oracle Cloud for instructions). However, I realize that's not realistic for most enterprise deployments. TheOracle Cloud documentation has a nice section on Managing Application Security:

Managing Application Security

This section describes how to secure Java EE and ADF applications targeted for a Java Cloud Service instance.


See Also:

There's also a nice tutorial available: Securing a Web Application on a Java Cloud Service.

Many of the Oracle Java development tutorials that access a database do so against the Oracle HR sample schema. See, for example, Developing Rich Web Applications With Oracle ADF. There are several approaches you can take to getting the sample schema installed in the Oracle Cloud, such as Using SQL Developer or JDeveloper as demonstrated in Shay's blog. In my case, we're going to run the SQL scripts directly.

One thing to note when working with the Oracle Cloud is that you are given a single database schema, which appears to be just some randomly generated GUID. For example, my assigned schema is QBNVJDSFBKHK:

So, technically, we will not be creating the HR schema, but rather the HR schema objects (tables, views, indices, ...) in our Oracle Cloud provided schema.

Step 1: Upload SQL Scripts to Your Database Service

The scripts to create the HR demo schema are included with your installation of the Oracle Database. I have provided copies of them here as well. Right click the scripts and save them to your hard drive:

  • hr_main.sql - Creates the HR schema and calls the other scripts. Since we already have a pre-assigned schema in the Oracle Cloud, we will not be using this script. I'm just providing it here for reference.
  • hr_cre.sql - Creates the tables, sequences and constraints.
  • hr_popul.sql - Populates the tables with demo data.
  • hr_idx.sql - Creates the indices.
  • hr_code.sql - Creates the procedural objects.
  • hr_comnt.sql - Adds comments to the tables and columns.
  • hr_drop.sql - Drops above created objects from the schema.

Sign in to access your Oracle Cloud Services and launch the database service. Then select SQL Workshop > SQL Scripts. Use the Upload button to Upload your scripts. At this time you need to upload them one at a time. When completed it should look as follows:

Step 2: Run the SQL Scripts

Click the arrow to run the the hr_cre.sql script. You'll get a notice about the statements that will be ignored, but these are mostly for output formatting which are not a concern in our case:

Click Run Now at the bottom of the page to run the script. After a couple seconds the job will complete:

View the Results and most importantly, note the bottom of the page which summarizes the number of successful statements and statements with errors:

Run the remaining scripts in the following order:

  • hr_popul.sql
  • hr_idx.sql
  • hr_code.sql
  • hr_comnt.sql

And that's it. Now you have the Oracle HR schema objects available to you in the cloud.

Yesterday Gregg Sporar, Roman Strobl and I launched The Observatory, a blog dedicated to those learning to use OpenSolaris. The last couple of my blog entries have been about OpenSolaris and I've been waiting for someone to ask: "Dude, what are you doing talking about OpenSolaris on a Java site?" Plus, this blog also feeds into Planet NetBeans and I don't necessarily want to piss off that community either.

In many respects, my role does not change, as I'm still going to talk about NetBeans and other technologies I've come to love like Rails. The difference is that I will be showing off the advantages of doing those things from OpenSolaris.

Looking at the MySQL web site, the instructions for Installing MySQL Community Server seem more complicated then they need to be. Maybe that's because there are no instructions for OpenSolaris (yet - I hope). Here are the easy steps that got me up and running.

Install MySQL

  • Open the Package Manager: System > Administration > Package Manager (give it a couple of seconds to load the package information):

  • Enter mysql5 in the Search text box .The list will filter as you type.

  • Select the check box for SUNWmysql5 and click the Install/Update button in the toolbar;

  • Wait while package dependencies are checked and then click Next on the Install / Update Confirmation dialog:

  • Wait while the packages are downloaded and installed:

  • After which, the Package Manager will show MySQL as installed:

Start the MySQL Service

  • Open System > Administration > Services and scroll down to MySQL RDBMS in the list:

  • Click the check box to enable the MySQL RDBMS:

Verify the Installation

Note, the MySQL documentation's Installation Layouts page does not cover OpenSolaris, but you'll find the binaries in /usr/mysql/bin and the databases in /var/mysql/data.

  • Open a terminal and start the MySQL client:

    bleonard@opensolaris:~$ /usr/mysql/bin/mysql -u root
    Welcome to the MySQL monitor. Commands end with ; or \g.
    Your MySQL connection id is 4
    Server version: 5.0.45 Source distribution

    Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

    mysql> show databases;
    | Database |
    | information_schema |
    | mysql |
    | test |
    3 rows in set (0.00 sec)

  • If you have NetBeans 6.1 installed it will also show you your MySQL databases in the services tab:


Filter Blog

By date: