1

我正在尝试从 Glassfish 3.1.2.2 迁移到 Tomcat 7.0.32,因为每个人都说 Atmosphere (PrimeFaces Push) 可以与 Tomcat 完美配合,而不能与 Glassfish 配合使用。

我已经将 Mojarra 2.1.4 JAR 添加到 Tomcat /lib 以传递下面讨论的错误:

java.lang.ClassNotFoundException : com.sun.faces.config.ConfigureListener

现在,似乎我需要从我的类路径中删除 OmniFaces (1.3 SNAPSHOT) JAR,因为它会导致错误。最好从下往上阅读,因为 FullAjaxExceptionHandler 首先显示为错误,所以我在我的应用程序中对此进行了评论,然后 OmniPartialView 出现了,但老实说,我不想删除 OmniFaces。

OmniFaces 导致以下讨论的错误:

找不到工厂:javax.faces.application.ApplicationFactory

以下是服务器日志。请自下而上阅读。

    Nov 06, 2012 1:09:28 AM org.apache.catalina.core.ApplicationContext log
    INFO: ContextListener: attributeRemoved('com.sun.faces.ApplicationAssociate', 'com.sun.faces.application.ApplicationAssociate@12f3aa66')
    Nov 06, 2012 1:09:28 AM org.apache.catalina.core.ApplicationContext log
    INFO: ContextListener: attributeRemoved('com.sun.faces.InitFacesContext', 'com.sun.faces.config.InitFacesContext@142d1015')
    Nov 06, 2012 1:09:28 AM org.apache.catalina.core.ApplicationContext log
    INFO: ContextListener: attributeRemoved('com.sun.faces.config.WebConfiguration', 'com.sun.faces.config.WebConfiguration@4bdd1969')
    Nov 06, 2012 1:09:28 AM org.apache.catalina.core.ApplicationContext log
    INFO: ContextListener: attributeAdded('com.sun.faces.InitFacesContext', 'com.sun.faces.config.InitFacesContext@1a7add0c')
    Nov 06, 2012 1:09:28 AM org.apache.catalina.core.ApplicationContext log
    INFO: ContextListener: attributeRemoved('com.sun.faces.InitFacesContext', 'com.sun.faces.config.InitFacesContext@1a7add0c')
    Nov 06, 2012 1:09:28 AM org.apache.catalina.core.ApplicationContext log
    INFO: SessionListener: contextDestroyed()
    Nov 06, 2012 1:09:28 AM org.apache.catalina.core.ApplicationContext log
    INFO: ContextListener: contextDestroyed()
    Nov 06, 2012 1:09:37 AM org.apache.catalina.core.ApplicationContext log
    INFO: ContextListener: contextInitialized()
    Nov 06, 2012 1:09:37 AM org.apache.catalina.core.ApplicationContext log
    INFO: SessionListener: contextInitialized()
    Nov 06, 2012 1:09:37 AM org.apache.catalina.core.ApplicationContext log
    INFO: ContextListener: attributeAdded('com.sun.faces.InitFacesContext', 'com.sun.faces.config.InitFacesContext@53a9dd25')
    Nov 06, 2012 1:09:37 AM org.apache.catalina.core.ApplicationContext log
    INFO: ContextListener: attributeAdded('com.sun.faces.patternCache', '{}')
    Nov 06, 2012 1:09:37 AM org.apache.catalina.core.ApplicationContext log
    INFO: ContextListener: attributeAdded('com.sun.faces.config.WebConfiguration', 'com.sun.faces.config.WebConfiguration@34f5d30c')
    Nov 06, 2012 1:09:37 AM org.apache.catalina.core.ApplicationContext log
    INFO: ContextListener: attributeRemoved('com.sun.faces.facesInitializerMappingsAdded', 'true')
    Nov 06, 2012 1:09:37 AM org.apache.catalina.core.ApplicationContext log
    INFO: ContextListener: attributeAdded('com.sun.faces.htmlTLVEnabled', 'false')
    Nov 06, 2012 1:09:37 AM org.apache.catalina.core.ApplicationContext log
    INFO: ContextListener: attributeAdded('com.sun.faces.webresources', '[]')
    Nov 06, 2012 1:09:37 AM org.apache.catalina.core.ApplicationContext log
    INFO: ContextListener: attributeAdded('com.sun.faces.config.ConfigManager_ANNOTATION_SCAN_TASK', 'java.util.concurrent.FutureTask@69ed807f')
    Nov 06, 2012 1:09:37 AM org.apache.catalina.core.ApplicationContext log
    INFO: ContextListener: attributeAdded('javax.faces.FactoryFinder.FactoryManagerCacheKey', '1352182177715')
    Nov 06, 2012 1:09:37 AM org.apache.catalina.core.ApplicationContext log
    INFO: ContextListener: attributeAdded('com.sun.faces.ApplicationAssociate', 'com.sun.faces.application.ApplicationAssociate@6fcbb778')
    Nov 06, 2012 1:09:37 AM org.apache.catalina.core.ApplicationContext log
    INFO: ContextListener: attributeAdded('com.sun.faces.application.InjectionApplicationFactory', 'com.sun.faces.application.ApplicationImpl@535d7af8')
    Nov 06, 2012 1:09:37 AM org.apache.catalina.core.ApplicationContext log
    INFO: ContextListener: attributeAdded('javax.faces.BEANS_VALIDATION_AVAILABLE', 'false')
    Nov 06, 2012 1:09:37 AM org.apache.catalina.core.ApplicationContext log
    INFO: ContextListener: attributeRemoved('com.sun.faces.config.ConfigManager_ANNOTATION_SCAN_TASK', 'java.util.concurrent.FutureTask@69ed807f')
    Nov 06, 2012 1:09:37 AM org.apache.catalina.core.ApplicationContext log
    INFO: ContextListener: attributeAdded('org.apache.jasper.runtime.JspApplicationContextImpl', 'org.apache.jasper.runtime.JspApplicationContextImpl@882b46f')
    Nov 06, 2012 1:09:37 AM org.apache.catalina.core.ApplicationContext log
    INFO: ContextListener: attributeAdded('com.sun.faces.errorPagePresent', 'false')
    Nov 06, 2012 1:09:37 AM org.apache.catalina.core.ApplicationContext log
    INFO: ContextListener: attributeReplaced('com.sun.faces.InitFacesContext', 'com.sun.faces.config.InitFacesContext@53a9dd25')
    Nov 06, 2012 1:09:37 AM org.apache.catalina.core.ApplicationContext log
    INFO: ContextListener: attributeAdded('org.apache.jasper.compiler.TldLocationsCache', 'org.apache.jasper.compiler.TldLocationsCache@1dd3e5cf')
    Nov 06, 2012 1:10:11 AM org.apache.catalina.core.StandardContext listenerStart
    SEVERE: Exception sending context initialized event to listener instance of class com.sun.faces.config.ConfigureListener
    java.lang.RuntimeException: com.sun.faces.config.ConfigurationException: Factory 'javax.faces.context.ExceptionHandlerFactory' was not configured properly.
    at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:292)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4791)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5285)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
    at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:655)
    at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:536)
    at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1453)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:301)
    at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
    at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:791)
    at org.apache.catalina.manager.ManagerServlet.check(ManagerServlet.java:1445)
    at org.apache.catalina.manager.ManagerServlet.deploy(ManagerServlet.java:860)
    at org.apache.catalina.manager.ManagerServlet.doGet(ManagerServlet.java:357)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:581)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1002)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585)
    at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1813)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:722)
    Caused by: com.sun.faces.config.ConfigurationException: Factory 'javax.faces.context.ExceptionHandlerFactory' was not configured properly.
    at com.sun.faces.config.processor.FactoryConfigProcessor.verifyFactoriesExist(FactoryConfigProcessor.java:305)
    at com.sun.faces.config.processor.FactoryConfigProcessor.process(FactoryConfigProcessor.java:219)
    at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:360)
    at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:225)
    ... 40 more
    Caused by: javax.faces.FacesException: org.omnifaces.exceptionhandler.FullAjaxExceptionHandlerFactory
    at javax.faces.FactoryFinder.getImplGivenPreviousImpl(FactoryFinder.java:616)
    at javax.faces.FactoryFinder.getImplementationInstance(FactoryFinder.java:482)
    at javax.faces.FactoryFinder.access$400(FactoryFinder.java:138)
    at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:959)
    at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:316)
    at com.sun.faces.config.processor.FactoryConfigProcessor.verifyFactoriesExist(FactoryConfigProcessor.java:303)
    ... 43 more
    Caused by: java.lang.InstantiationException: org.omnifaces.exceptionhandler.FullAjaxExceptionHandlerFactory
    at java.lang.Class.newInstance0(Class.java:357)
    at java.lang.Class.newInstance(Class.java:325)
    at javax.faces.FactoryFinder.getImplGivenPreviousImpl(FactoryFinder.java:614)
    ... 48 more

    Nov 06, 2012 1:20:12 AM org.apache.catalina.core.StandardContext listenerStart
    SEVERE: Exception sending context initialized event to listener instance of class com.sun.faces.config.ConfigureListener
    java.lang.RuntimeException: com.sun.faces.config.ConfigurationException: Factory 'javax.faces.context.PartialViewContextFactory' was not configured properly.
    at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:292)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4791)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5285)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
    at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:655)
    at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:536)
    at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1453)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:301)
    at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
    at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:791)
    at org.apache.catalina.manager.ManagerServlet.check(ManagerServlet.java:1445)
    at org.apache.catalina.manager.ManagerServlet.deploy(ManagerServlet.java:860)
    at org.apache.catalina.manager.ManagerServlet.doGet(ManagerServlet.java:357)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:581)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1002)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585)
    at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1813)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:722)
    Caused by: com.sun.faces.config.ConfigurationException: Factory 'javax.faces.context.PartialViewContextFactory' was not configured properly.
    at com.sun.faces.config.processor.FactoryConfigProcessor.verifyFactoriesExist(FactoryConfigProcessor.java:305)
    at com.sun.faces.config.processor.FactoryConfigProcessor.process(FactoryConfigProcessor.java:219)
    at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:360)
    at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:225)
    ... 40 more
    Caused by: javax.faces.FacesException: org.omnifaces.context.OmniPartialViewContextFactory
    at javax.faces.FactoryFinder.getImplGivenPreviousImpl(FactoryFinder.java:616)
    at javax.faces.FactoryFinder.getImplementationInstance(FactoryFinder.java:482)
    at javax.faces.FactoryFinder.access$400(FactoryFinder.java:138)
    at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:959)
    at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:316)
    at com.sun.faces.config.processor.FactoryConfigProcessor.verifyFactoriesExist(FactoryConfigProcessor.java:303)
    ... 43 more
    Caused by: java.lang.InstantiationException: org.omnifaces.context.OmniPartialViewContextFactory
    at java.lang.Class.newInstance0(Class.java:357)
    at java.lang.Class.newInstance(Class.java:325)
    at javax.faces.FactoryFinder.getImplGivenPreviousImpl(FactoryFinder.java:614)
    ... 48 more

请指教。谢谢。

4

1 回答 1

1

我可能已经解决了这个问题。我从 tomcat /lib 文件夹中删除了 Mojarra 2.1.4 JAR 并添加到我的项目(Web 应用程序)类路径(NetBeans 中的库列表),重新启动 Tomcat7.0.32,重建项目/应用程序,将应用程序部署到 Tomcat,并且此错误不再出现在服务器日志中。

现在我正在处理其他问题(JPA、我的数据库连接等……这些都是在 Glassfish 中配置和工作的)。

于 2012-11-06T06:54:26.760 回答