1 2 3 Previous Next


67 posts

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 Git installed. 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 28, 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 of Updating 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 deploy JAX-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

Download the 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 to facade.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 the System.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 is database.

 <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 called DynamicDropdown. Then create a new Web Form called DropdownForm. 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:

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. See  Oracle 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. The Oracle 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.

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: