应用程序在启动时未正确初始化(JSF 1.2、WS 7)
我使用 jsf 1.2 开发了一个应用程序。它与 apache tomcat 6 一起工作得很好。我使用 websphere 7 在生产环境中获取了 war 文件并部署了该应用程序。我收到以下错误。
E com.ibm.ws.webcontainer.servlet.ServletWrapper init SRVE0100E: Uncaught init()
exception created by servlet Faces Servlet in application Products_war:
java.lang.IllegalStateException: Application was not properly initialized at startup,
could not find Factory: javax.faces.context.FacesContextFactory
我的类路径文件具有以下条目,
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER/
org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jre6"/>
<classpathentry kind="con"
path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget
/Apache Tomcat v6.0"/>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
<classpathentry kind="output" path="build/classes"/>
</classpath>
我在谷歌搜索后进行了以下尝试。
including following listener in web.xml
<listener>
<listener-class>com.sun.faces.config.ConfigureListener</listener-class>
</listener>
并从我的应用程序的 lib 文件夹中删除了 jsf-api 和 jsf-impl,但无济于事。
请帮忙。
提前致谢
i have developed an application using jsf 1.2. it worked fine with apache tomcat 6. i took the war file on production with websphere 7 and deployed the application. i recieved following error.
E com.ibm.ws.webcontainer.servlet.ServletWrapper init SRVE0100E: Uncaught init()
exception created by servlet Faces Servlet in application Products_war:
java.lang.IllegalStateException: Application was not properly initialized at startup,
could not find Factory: javax.faces.context.FacesContextFactory
my classpath file has following entries
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER/
org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jre6"/>
<classpathentry kind="con"
path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget
/Apache Tomcat v6.0"/>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
<classpathentry kind="output" path="build/classes"/>
</classpath>
i have made following tries after googling till now..
including following listener in web.xml
<listener>
<listener-class>com.sun.faces.config.ConfigureListener</listener-class>
</listener>
and removed jsf-api and jsf-impl from the lib folder of my application but to no avail.
plz help.
thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
WAS 7 已经捆绑了 JSF 1.2,它可以是“Sun RI”(Mojarra)或“MyFaces”(来自 Apache)实现,可以在 WAS 管理控制台中进行配置。您需要从
/WEB-INF/lib
中删除 JSF JAR 文件,并且需要从web.xml
中删除侦听器。另请参阅:
WAS 7 already ships with JSF 1.2 bundled which can be either the "Sun RI" (Mojarra) or "MyFaces" (from Apache) implementation which is configureable in the WAS admin console. You need to remove the JSF JAR files from
/WEB-INF/lib
and you need to remove the listener from theweb.xml
.See also:
另一件需要检查的事情是:我们将 myfaces 配置为 WebSphere 上的共享库。在对本地配置进行故障排除时,我必须将共享库设置为“为此共享库使用独立的类加载器”,
这被认为是运行第三方 JSF 实现程序的要求的一部分:
请注意:如果您想要使用产品中未附带的第三方 JSF 实现,则:
应用程序作为一个独立的共享库。
http://pic.dhe.ibm.com/infocenter/wasinfo/v7r0/index.jsp?topic=/com.ibm.websphere.express.doc/info/exp/ae/tweb_jsf.html 如果第一个答案对某人
不起作用,也许这会对他们有所帮助。
Another thing to check: We have myfaces configured as a shared library on WebSphere. In troubleshooting my local configuration I had to set the shared library to "Use an isolated class loader for this shared library"
This is identified as part of the requirements for running a third-party JSF implementer:
Be Aware: If the you want to use a third party JSF implementation that is not shipped with the product, then:
application as an isolated shared library.
http://pic.dhe.ibm.com/infocenter/wasinfo/v7r0/index.jsp?topic=/com.ibm.websphere.express.doc/info/exp/ae/tweb_jsf.html
Maybe this will help someone if the first answer doesn't work for them.