JOnAS Versions Migration Guide

Philippe Coq

JOnAS Team


1. Migrating from JOnAS 4.x to JOnAS 5.0
1.1. Before migration
1.1.1. API versions of the Java EE components
1.1.2. Prerequisites
1.2. Upgrading An Application Environment from 4.x to 5.x
1.2.1. Application environment definition
1.2.2. New deployment architecture
1.2.3. Configuration files
1.2.4. libraries
1.3. JOnAS command changes
A. Embedded modules versions
A.1. Versions of embedded modules in JOnAS
A.1.1. OW2 embedded modules in JOnAS 5
A.1.2. Externals embedded modules in JOnAS 5
A.1.3. New modules in JOnAS5

Migrating from JOnAS 4.x to JOnAS 5.0

JOnAS has been completely rewritten in order to benefit from the OSGi™ technology.

People who were familiar with the JOnAS world will not be disoriented, however, they should be aware of some important changes that must be taken into account.

1.1. Before migration

Before begining the migration process, the user must be aware of the versions of the Java EE API supported by JOnAS 5.0.

JOnAS 4.x was Java EE v1.4 compliant. JOnAS 5.0 is Java EE v1.5 compliant. This means that the supported versions of most APIs have changed.

Here is a small table describing the differences:

1.1.1. API versions of the Java EE components

API   JOnAS 4.x  JOnAS 5.x
JDK 1.4 1.5
JNDI 1.2 1.2
EJB 2.1 3.0
Servlet 2.4 2.5
JSP 2.0 2.1
JMS 1.1 1.1
Connector Architecture 1.5 1.5
JDBC 3.0 3.0
JavaMail 1.3.1 1.4
JavaBeans Activation Framework 1.0 1.1.1
JTA 1.0.1B 1.1
JTS 1.0 1.0
JAX-RPC 1.1 1.1
SAAJ 1.2 1.3
JAXR 1.0 1.0
JWSDL 1.0 1.0
JAXP 1.2 1.3
J2EE_Deployment 1.1 1.1
J2EE_Mgmt 1.0 1.0
JACC 1.0 1.1
JAAS 1.0 1.0
JAX-WS n/a 2.0
JSF n/a 1.2
JSTL n/a 1.2
JPA n/a 1.0

1.1.2. Prerequisites

A JDK 1.5 is required for building and running JOnAS 5.

1.2. Upgrading An Application Environment from 4.x to 5.x

1.2.1. Application environment definition

Usually, an application environment is composed of one JONAS_ROOT (JOnAS distribution) and several JONAS_BASE depending on the number of JOnAS instances needed for the application.

In JOnAS 4.x JONAS_BASE contains :

  • Java EE applications to be deployed in the new environment:

    An aplication is made of several deployable archives ear, ejbjar, war + some associated connectors packaged in rar archives.

  • Configuration files:

    All configuration files are located under $JONAS_BASE/conf

  • External libraries:

    Some libraries may be installed under $JONAS_BASE/lib/ :

    • apps for applicative libraries

    • ext, commons, tools libraries whose classes must be seen by JOnAS services

For correctly upgrading such an environment the user must be aware of the JOnAS changes in:

  • deployment process, due to a new deployment architecture

  • configuration files

  • third party libraries treatment

To upgrade an application environment you must first create a new application environment and then customize it according to the old environment.

1.2.1.1. Creating a new Application environment

To create a new application environnement you must create a new JOnAS_BASE.

1.2.1.1.1. JONAS_BASE creation
  1. Create a JONAS_BASE template from scratch :

    export JONAS_BASE=~/my_jonas_base
    cd $JONAS_ROOT
    ant -f build-jb.xml create_jonas_base

    This will copy all the required files and create all the directories needed.

  2. Another way to create a JONAS_BASE template from scratch :

    export JONAS_BASE=~/my_jonas_base
    newjb

    The JONAS_BASE created with the command newjb is well suited to run the JOnAS conformance test suite without any additional configuration.

    In order to customize a JONAS_BASE with specific values for some properties (like port number, services, protocol etc...), you must edit the $JONAS_ROOT/build-jb.properties file or $HOME/jb.config/conf/jonas-newjb.properties file before running newjb. You may also modify the generated files in $JONAS_BASE/conf. For more information see the description of the newjb command in Commands Reference Guide.

[Note] Note
Since newjb is based on personal information located in $HOME/jb.config/conf/jonas-newjb.properties, you will probably have to review this file and upgrade it to conform to $JONAS_ROOT/build-jb.properties. Indeed, some information has changed: i.e. the names of the jonas services

1.2.2. New deployment architecture

with JOnAS 5.x, the following directories for deployment have been removed :

  • apps,apps/autoload

  • clients

  • ejbjars,ejbjars/autoload

  • rars,rars/autoload

  • webapp,webapp/autoload

The above directories no longer exist in JONAS_BASE and have been replaced by a unique directory:

  • deploy

For deploying a Java EE archive in JOnAS 5.x, the only thing required is to put it in the $JONAS_BASE/conf/deploy directory. This directory is periodically polled in order to deploy new archives.

1.2.3. Configuration files

JOnAS configuration files have changed. Here we will focus on the changes that may impact the upgrading process.

1.2.3.1. carol.properties file

jeremie protocol is not supported any longer.

cmi is not a protocol but a JOnAS service used for clustering. Some new properties have been added for configuring cmi clusters. For more information see the JOnAS Configuration Guide.

1.2.3.2. clusterd.properties file

In JOnAS 5 the cluster deamon can start the discovery service.

1.2.3.3. context.xml, server.xml, web.xml

The previous tomcat 5 context.xml, server.xml, web.xml configuration files are replaced by equivalent files named tomcat6-context.xml, tomcat6-server.xml, tomcat6-web.xml. See Apache Tomcat 6.0 Documentation for complete information

1.2.3.4. jaas.config

No new properties in this file. The only difference is the name of the package for the LoginModule classes.

1.2.3.5. jetty5-webdefault.xml & jetty5.xml

The former file is now jetty6-web.xml and the the latter is jetty6.xml.

For more information see Jetty Documentation

1.2.3.6. jgroups-cmi.xml & jgroups-ha.xml

Because of changing the JGroups version used with JOnAS 5.x, the format of the JGroups Protocol Stack configuration has changed. Customizations made in the old jgroups-cmi.xml and jgroups-ha.xml files must be updated to the new formats.

1.2.3.7. jonas.properties

The jonas.properties file has changed a lot. Some changes do not impact the upgrading process at all (package name changes), while others must be studied carefully.

In the following, we focus on the parts of the jonas.properties file that may be impacted during the upgrading process.

1.2.3.7.1. jonas.services property

The thread and jms services have been suppressed (see Section 1.2.3.7.3, “jms service configuration” below).

The ejb service has been renamed to ejb2 service.

wm, wc, ha, ejb3, versioning, depmonitor are new services in JOnAS 5.x

In JonAS 5.x, the jonas.services property is set to:

jonas.services    registry,jmx,jtm,db,security,mail,wm,resource,ejb2,ejb3,ws,web,ear,depmonitor,discovery

(in order to learn more about these services see the JOnAS configuration_guide)

1.2.3.7.2. ejb2 service configuration

The ejb2 service replaces the previous ejb service.

Configuration of worker threads has been transfered from the ejb service configuration to the Work Manager (wm) service configuration.

see the Work Manager configuration part in Section 1.2.3.7.4, “resource service configuration”

1.2.3.7.3. jms service configuration

When in the application environment, some applications used JMS through the jms service, but now the JORAM resource adapter must be used instead.

In order to use JMS via the JORAM resource adapter

  1. The resource service must be set in the jonas.services property

  2. joram_ra_for_jonas.rar must be deployed (it must be located under $JONAS_BASE/deploy)

  3. JORAM port must be configured in the $JONAS_BASE/conf/joramAdmin.xml file

  4. JMS destinations must be defined in the $JONAS_BASE/conf/joramAdmin.xml file

If for tuning purposes, the size and/or the max size of the worker thread pool used for the message driven beans has been set (jonas.service.ejb.minworkthreads, jonas.service.ejb.maxworkthreads properties) you must update the equivalent setting in the Work Manager configuration (see below).

1.2.3.7.4. resource service configuration

Configuration of worker threads has been transfered from resource service configuration to Work Manager (wm) service configuration.

Here is the part on Work Manager configuration:

###################### JOnAS WorkManager service configuration
#
#  Set the name of the implementation class of the wm service
jonas.service.wm.class    org.ow2.jonas.workmanager.internal.JOnASWorkManagerService

#  Set the size of the worker thread pool
jonas.service.wm.minworkthreads   3                               1

#  Set the maximun size of the worker thread pool
jonas.service.wm.maxworkthreads   80                              2

#  Set the max # of seconds that a thread will wait for work
#  This is used to shrink the worker thread pool back to minimum
jonas.service.wm.threadwaittimeout 60                             3

1

Defines the minimum size of the Thread pool

2

Defines the maximum size of the Thread pool

3

Defines the maximum time (in seconds) that a worker Thread should wait before execution

1.2.3.7.5. discovery service configuration

The property indicating that the current instance is (or not) a master server is no longer a discovery service property, but instead, a jonas.properties global property

jonas.master false

The discovery service supports two implementations, one using JGroups the other using multicast. The latter is the default one.

For more information about configuring discovery service see discovery service configuration.

1.2.3.8. trace.properties & traceclient.properties

Logger names have changed because of changes in internal JOnAS packages name.

1.2.4. libraries

There are several ways for using libraries in portable J2EE applications, which may be:

  • placing the library JAR file into the WEB-INF/lib directory of the WAR file,

  • using the Class-Path attribute in the manifest file to reference one or more library JAR files included in the EAR file.

  • using the Extension-List attribute in the manifest file to reference one or more library JAR files that are not bundled in the EAR file, but are installed in the lib/ext directory of the Java Runtime Environment (JRE)

If the application to migrate follows one of these policies it can be used with JOnAS 5.0 without changes.

There is no guarantee that a library installed in JOnAS_BASE/lib/ext and referenced via the Extension-List attribute in the manifest file can be seen correctly.

It is worth knowing that tomcat 6, embedded in JOnAS 5.0, tries to resolve extension dependencies for web applications before deploying them, and that it uses the system property catalina.ext.dirs to try lo locate libraries.

The JDBC driver may be installed under $JONAS_BASE/lib/ext or packaged into an OSGi™ bundle.

1.3. JOnAS command changes

The jonas command has changed since the previous version. The semantic of jonas stop is different for it allows to stop all configuration-defined services except the two mandatory services (registry and jmx), but the JVM is not stopped.

The command equivalent to the former jonas stop is now jonas halt.

See the JOnAS4 Commands Reference Guide for a complete description of the commands.

Appendix A. Embedded modules versions

A.1. Versions of embedded modules in JOnAS

Here is a comparative between the versions of the different modules embedded in JOnAS4.9.2 vs JOnAS 5.0

A.1.1. OW2 embedded modules in JOnAS 5

Module name JOnAS 4.9.2 JOnAS 5.0
asm 1.5.3 1.5.3
carol 2.2.12 3.0-RC5-SNAPSHOT
cmi 1.3.15 2.0-RC6-SNAPSHOT
dependency 1.4 1.4
howl 0.1.11 1.0.1-1
irmi 1.0.1 1.1.1
ishmael 0.1.10 N/A
jeremie 4.2.2 N/A
jonathancore 4.1 N/A
joram. 4.3.32 5.0.7
jorm 2.9.3-patch 2.9.3-patch
jotm 2.0.11 2.0.10
kilim 1.1.3 N/A
medor 1.7.1 1.7.1
medor-exp 1.6.3 1.6.3
monolog 2.1.10 2.1.9
perseus-cache 1.5.4 1.5.4
perseus-concurrency 1.6 1.6
perseus-persistence 1.6.1 1.6.1
perseus-pool 1.4.3 N/A
rdb-adapter 3.2.2 3.2.2
speedo 1.5.0 N/A

A.1.2. Externals embedded modules in JOnAS 5

A.1.2.1. Webcontainer

Module name JOnAS 4.9.2 JOnAS 5.0
Tomcat 5.5.26 6.0.14
Jetty 5.1.10 6.1.5

A.1.2.2. Jakarta commons

Module name JOnAS 4.9.2 JOnAS 5.0
beanutils 1.7.0 1.7.0
collections 3.2 3.2
digester 1.7 1.7
fileupload [a] 1.1.1 1.1.1
io [b] 1.2 1.2
logging 1.0.4 1.1
modeler 2.0 2.0
discovery[c] 0.3 SNAPSHOT 0.2 [5.0.3-SNAPSHOT]
validator 1.3.0 N/A
oro 2.0.8 N/A
codec 1.3 N/A
Concurrent 1.3.4 1.3.4
Hsqldb 1.8.0.1 1.8.0.7
JacOrb 2.2.3-jonas-patch-20071018 2.2.3-jonas-patch-20071018
JGroups 2.2.9.4 2.6.2
Mx4J 3.0.1 N/A
P6Spy 1.3 1.3
Struts 1.2.9 1.2.9
Velocity 1.4 1.4
XDoclet 1.2.2 N/A
XJavaDoc 1.0.3 N/A

[a] only used by jonasAdmin

[b] only used by jonasAdmin/fileupload

[c] only used by Axis/EWS/WSS4J

A.1.2.3. WebServices

Module name JOnAS 4.9.2 JOnAS 5.0
Axis 1.4 1.4
EWS 1.1 1.1
XMLBeans 1.0.4 1.0.4
WSDL4J 1.5.1 1.6.1
jUDDI 0.9rc4 0.9RC4
Scout 1.0-SNAPSHOT 5.0.3-SNAPSHOT

A.1.2.4. WS-Security

Module name JOnAS 4.9.2 JOnAS 5.0
WSS4J 1.1.0 1.1.0-jonas-patch
OpenSAML 1.0.1 1.0.1
XML-Security 1.2.1 1.3.0

A.1.2.5. WS-Addressing

Module name JOnAS 4.9.2 JOnAS 5.0
addressing 1.0 1.0

A.1.2.6. Xml

Module name JOnAS 4.9.2 JOnAS 5.0
Xalan 2.6.0 2.7.0
Xerces 2.7.1 2.8.1
xml-apis   1.3.03
Xml-commons 1.3.02  

A.1.3. New modules in JOnAS5

Module name JOnAS 5.0
easybeans 1.0.0.RC4-SNAPSHOT
OW2 Bundles 1.0.4-SNAPSHOT
OW2 Util plugins 1.0.5-SNAPSHOT
osgi core 1.0.0
osgi compendium 1.0.0
felix framework 1.0.3
felix shell 1.0.0
felix gui 0.9.0-incubator-2007.12.14
felix bundle repository 1.0.2
felix configadmin 1.0.0
ipojo0 0.7.5-2008.01.28
jspc 2.0-alpha-1
jsf 1.2_08
avalon-framework 4.1.5
logkit 1.2