views:

60

answers:

1

Hi,

On a WAS 7, I deployed my EAR with a single WAR in it. The EAR classloading mode is set to PARENT_LAST, and the WAR classloading mode is also set to PARENT_LAST. The WAR's WEB-INF/lib has the Mojarra JSF 2 RI, and the Unified EL 2.1 jars.

Despite all this, when the application starts, it tries to load some MyFaces stuff, from the inbuilt MyFaces 1.2. The class loader viewer for the WAR class loader clearly shows "org.apache.myfaces.webapp.StartupServletContextListener" getting loaded at startup from the base_v7/plugins/org.apache.myfaces1_2.jar

Boy, it's crazy.. Lots of other stuff gets picked up from elsewhere as well and creates a big dirty mess of classes:

"com/ibm/ws/classloader/CompoundClassLoader@116a116a" previously initiated loading for a different type with name "javax/el/ExpressionFactory" defined by loader "org/eclipse/osgi/internal/baseadaptor/DefaultClassLoader@2a502a50"

Do you have any idea of what might be going wrong in here?

Thanks

Pradyumna

A: 

Got it..

First, the application will work fine without the classloader conflict on the ExpressionFactory if we set this context-param in the web.xml:

    <context-param>
        <param-name>com.sun.faces.expressionFactory</param-name>
        <param-value>com.sun.el.ExpressionFactoryImpl</param-value>
    </context-param>

(http://ocpsoft.com/java/jsf2-java/jsf2-how-to-add-the-magic-of-el-el2-to-jsf/)

And for the MyFaces StartupServletContextListener.. I don't know if it does any harm even if it gets loaded at startup.. at least I didn't notice any issue with it being there till now..

Pradyumna