« November 2006 | Main | January 2007 »

December 2006 Archives

December 12, 2006

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.

About December 2006

This page contains all entries posted to Olaf Heimburger's Blog in December 2006. They are listed from oldest to newest.

November 2006 is the previous archive.

January 2007 is the next archive.

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

Powered by
Movable Type and Oracle