WebSphere 7,JSF 2.0和类加载器

编程入门 行业动态 更新时间:2024-10-10 13:21:11
本文介绍了WebSphere 7,JSF 2.0和类加载器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

在WAS 7上,我部署了带有一个WAR的EAR. EAR类加载模式设置为PARENT_LAST,WAR类加载模式也设置为PARENT_LAST. WAR的/WEB-INF/lib具有Mojarra JSF 2 RI和Unified EL 2.1 jar.

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.

尽管如此,当应用程序启动时,它会尝试从内置的MyFaces 1.2加载一些MyFaces内容. WAR类加载器的类加载器查看器清楚地显示

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"在启动时从base_v7/plugins/org.apache.myfaces1_2.jar

"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"先前启动了由名称"javax/el/ExpressionFactory"的其他类型的加载,该类型由加载器"org/eclipse/osgi/internal/baseadaptor/DefaultClassLoader @ 2a502a50"定义

"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?

推荐答案

知道了.

首先,如果我们在web.xml中设置此上下文参数,则应用程序可以正常运行而不会在ExpressionFactory上发生类加载器冲突:

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>

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

对于MyFaces StartupServletContextListener来说.即使启动时加载它,我也不知道它是否有任何危害.至少直到现在我都没有注意到它存在任何问题.

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

更多推荐

WebSphere 7,JSF 2.0和类加载器

本文发布于:2023-11-25 20:18:23,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1631208.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:加载   WebSphere   JSF

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!