应用程序在启动时未正确初始化(JSF 1.2、WS 7)

发布于 2024-12-28 10:29:26 字数 1447 浏览 0 评论 0原文

我使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

独自唱情﹋歌 2025-01-04 10:29:26

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 the web.xml.

See also:

深海夜未眠 2025-01-04 10:29:26

另一件需要检查的事情是:我们将 myfaces 配置为 WebSphere 上的共享库。在对本地配置进行故障排除时,我必须将共享库设置为“为此共享库使用独立的类加载器”,

这被认为是运行第三方 JSF 实现程序的要求的一部分:

请注意:如果您想要使用产品中未附带的第三方 JSF 实现,则:

  1. 将配置集保留为 SUN RI。
  2. 将第三方侦听器添加到所需的 web.xml 文件中。
  3. 将第三方实现 Java 归档 (JAR) 文件添加到
    应用程序作为一个独立的共享库。

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:

  1. Keep the configuration set to the SUN RI.
  2. Add the third party listener to the web.xml file that is required.
  3. Add the third party implementation Java archive (JAR) files to the
    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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文