« Using JDeveloper on Linux, Part II | Main | One Reason for "RMIConnection Disconnected" »

Migrating to OC4J: Leveraging the APP-INF directory

Some application servers have added a mechanism to an EAR file similar to the WEB-INF directory in a WAR file. This mechanism uses a directory call APP-INF. It's contents are quite similar to WEB-INF, it contains sub-directories called lib and classes (at least).

Some J2EE application developer got so used to it that they think it's the standard. They also want to use it in OC4J.

The fastest solution

OC4J comes with the support of a product-specific deployment descriptor called orion-application.xml which is located in the META-INF directory of the EAR file. This file consists of a number of OC4J-specific settings. One of them is the <library> tag. This tag has one attribute path which points to the directory or JAR file you need. To use it simply include a line like

<library path="../../applications/ear/APP-INF/classes" />

in your orion-application.xml. For each JAR file another line is necessary.

Caveat

This approach has some disadvantages:
  1. You need to know what the name of the J2EE application is (ear in this case) and you must be very sure that this name is used during deployment!
  2. You need to add one line per library you use.

Is this the only solution?

Certainly not. Starting with J2EE 1.4 a directory called lib is supported in every J2EE 1.4 compliant server. Since version 10.1.3 OC4J also supports the concept of shared libraries with proper versioning.

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

About This Entry

This page contains a single entry from the blog posted on December 12, 2006 11:48 AM.

The previous post in this blog was Using JDeveloper on Linux, Part II.

The next post in this blog is One Reason for "RMIConnection Disconnected".

Many more can be found on the main index page or by looking through the archives.

Top Tags

Powered by
Movable Type and Oracle