开发者

WebSphere 7, JSF 2.0 and classloaders

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 th开发者_如何转开发e 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?


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..


I had got the same type error in Spring MVC. I just removed jsp-api-2.1.jar from WEB-INF/lib and it's working for me. You can get more information from

http://forum.springsource.org/showthread.php?73991-Getting-Linkage-error-while-trying-to-show-the-error-set-in-controller

I do not know JSF. I just share my problem that I had faced.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜