Support Wikipedia

Thursday, October 30, 2008

JSF + Spring + JMS (websphere MQ) on WAS 6.1 HOWTO

Alright, I have been struggling for the past one week to get Spring to work with JSF and JMS.

Here are the steps to get the job done.

  1. Create a directory with the following jars

  • commons-beanutils-1.7.0.jar

  • commons-digester-1.8.jar

  • commons-lang-2.4.jar

  • commons-codec-1.3.jar

  • commons-discovery-0.2.jar

  • commons-logging.jar

  • commons-collections-3.2.jar

  • commons-el-1.0.jar

  • el-impl-1.0.jar

  • el-api-1.0.jar

  • jsf-facelets-1.1.14.jar

  • jstl-1.1.2.jar

  • myfaces-impl-1.2.4.jar

  • myfaces-api-1.2.4.jar

  1. Create a utility jar commons-logging.jar (OPTIONAL)

      1. Unzip the common-logging.jar in a directory

      2. Create a file in that directory “” with the following content

          priority=1 org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.LogFactoryImpl

      3. Now, create a jar file with from this directory using the command

            jar cvf commons-logging.jar .

      4. Add this commons-logging.jar to the directory created in step 1.

  1. Create a shared library in WAS admin console.

4. Create a new class loader in WAS

5. Add shared library references

  1. Make sure the WEB-INF/lib of your application doesnt have anything that is already added to the shared library.

  2. Eventualy you might need to create the following files in the META-INF/services directory of your web-app:(if the dir services does not exist just create it.

  1. javax.faces.application.ApplicationFactory with content: com.sun.faces.application.ApplicationFactoryImpl

  2. javax.faces.context.FacesContextFactory with content: com.sun.faces.context.FacesContextFactoryImpl

  3. javax.faces.lifecycle.LifecycleFactory with conent: com.sun.faces.lifecycle.LifecycleFactoryImpl

  4. javax.faces.render.RenderKitFactory with content: com.sun.faces.renderkit.RenderKitFactoryImpl

Package and deploy the application with the default class loaders.

  • DONOT refer from the WAR to the shared library that is being referenced by the application server's class loader.
  • The application class loader order should be “parent class loader first”.
  • The WAR class loader policy should be “class loader for each WAR file in application”.

  • The WAR's classloader order SHOULD be “parent class loader first”.
Support Wikipedia Support Wikipedia Support Wikipedia Support Wikipedia Support Wikipedia Support Wikipedia