Chapter 3. Installing the J2EE Sample Application

3.1. Compiling and Building The Sample Application
3.2. Deploying Sample To JBoss
3.3. Deploying Sample To WebLogic 6.2 to 7.x
3.4. Deploying Sample To WebLogic 8.1
3.5. Deploying Sample To SunONE
3.6. Deploying Sample To WebSphere
3.7. Deploying Sample To Borland Enterprise Server 5.2

Installing the sample application involves first compiling and building a deployment archive (.ear) file. This file then needs to be deployed into your application server.

3.1. Compiling and Building The Sample Application

Navigate to the samples/j2ee directory of your Kodo installation. Compile the source files in place both in this base directory as well as the ejb directory:

javac *.java  ejb/*.java

Enhance the Car class.

jdoc -properties /path/to/kodo.properties package.jdo

Run SchemaTool using a kodo.properties with connection info (e.g. Driver, URL, etc.) corresponding to your JCA installation:

schematool -properties /path/to/kodo.properties 
  -action refresh package.jdo

Configure options in samples.properties to match your JCA installation, most notably the JNDI name to which you have bound Kodo (it defaults to kodo).

[Warning]Warning

This step (editing samples.properties) is very important as this value can be quite different for each appserver and each configuration.

Be sure that the setting you put for pmf.jndi matches not only your configured setting but also what your application server may prefix the configured name with.

On JBoss, for example, JBoss will prefix the JNDI name with java:/ and Borland Enterprise Server looks at the serial:// context. Refer to your JNDI tree and the documentation for your application server for further details.

Build an J2EE application archive by running Ant against the build.xml. This will create samplej2ee.ear. This ear can now be deployed to your appserver.

ant -f build.xml