Friday, 28 November 2008

Deployment of Java ADF applications to Oracle 10.1.3 Application Server

In my current project I created a Java ADF application. Actually I generated the whole bunch with JHeadstart Pretty cool stuff actually.
At the end I had to deploy the application to a proper application server. That is: not the embedded OC4J in JDeveloper, but in my case the Oracle application server that runs our SoaSuite.
And I couldn't find a proper document that tells me how to do that. With some searching around, and "with a little help of my friends", I found three documents:
The first one tells you how to setup your deployment descriptors. It will give you at the end an EAR file that you can use to deploy to an J2EE application server.

But by default JDeveloper ships all your connections in the connection navigator in the model-project's JAR file. And also by default it deploys with a connection-descriptor in the JAR file with the database-connection you used at development time. This is of course not usefull when you deploy the EAR file to a test, acceptance or Production environment. The second post, by Pascal Alma, solves these things.

The last link points to the adf-developers guide where is stated how to change the model-project to use a datasource instead of a fixed JDBC-url.

Below I created a step by step guide to prepare for the proper deployment. For creating the actual deployment profiles I refer to the first link above.

Disable deployment of Jdeveloper Connections.
To disable this feature:
  1. Go to the jDeveloper Preferences.

  2. Go to the Deployment node and disable the checkbox “Bundle Default data-sources.xml During Deployment”.

Change Application Module to use Datasources
  1. Right click on the Application Module and choose Configurations

  2. Click on the Edit button

  3. Set Connection Type.
    Set connection Type on “JDBC DataSource” and name the Datasource something like jdbc/FDS.

  4. Click on OK.

Now you can create a deployment just following the steps on:
Having done that, you can create an EAR file by right-clicking on the deployment profile in the deployment project. And choose EAR-File:

This will create an EAR file in the deploy folder of the project. This file can then be used to deploy to the Application Server. This is quite easily done in the Application Server Control application (http://<applicationserverhost:port>/em). I might write an separate article about that later.

After that you need to create a datasource in the application-server. How to do that is a pretty straightforward task usually done by an Application Server Administrator. But I probably write a separate article about that another time too.

I hope this helps preventing you for searching around as long as I did. If you were searching already for about a day, I'm sorry you did not find me earlier...

No comments :