问题描述:

I am attempting to migrate from Glassfish 3.1.2.2 to Tomcat 7.0.32, since everyone says that Atmosphere (PrimeFaces Push) works perfectly with Tomcat, while it does not work with Glassfish.

I already added Mojarra 2.1.4 JAR to Tomcat /lib to get pass the error that is discussed in the following:

ClassNotFoundException: com.sun.faces.config.ConfigureListener for JSF project using eclipse + tomcat

Now, it seems as though I need to remove OmniFaces (1.3 SNAPSHOT) JAR from my classpath, because it is causing errors. It might be best to read from bottom-to-up, because FullAjaxExceptionHandler showed up as error first, so I commented that out of my app, and then OmniPartialView showed up next, but honestly, I prefer not to remove OmniFaces.

OmniFaces is causing error discussed in the following:

could not find Factory: javax.faces.application.ApplicationFactory

Below is server log. Please read from bottom-to-up.

 Nov 06, 2012 1:09:28 AM org.apache.catalina.core.ApplicationContext log

INFO: ContextListener: attributeRemoved('com.sun.faces.ApplicationAssociate', '[email protected]')

Nov 06, 2012 1:09:28 AM org.apache.catalina.core.ApplicationContext log

INFO: ContextListener: attributeRemoved('com.sun.faces.InitFacesContext', '[email protected]')

Nov 06, 2012 1:09:28 AM org.apache.catalina.core.ApplicationContext log

INFO: ContextListener: attributeRemoved('com.sun.faces.config.WebConfiguration', '[email protected]')

Nov 06, 2012 1:09:28 AM org.apache.catalina.core.ApplicationContext log

INFO: ContextListener: attributeAdded('com.sun.faces.InitFacesContext', '[email protected]')

Nov 06, 2012 1:09:28 AM org.apache.catalina.core.ApplicationContext log

INFO: ContextListener: attributeRemoved('com.sun.faces.InitFacesContext', '[email protected]')

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', '[email protected]')

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', '[email protected]')

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', '[email protected]')

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', '[email protected]')

Nov 06, 2012 1:09:37 AM org.apache.catalina.core.ApplicationContext log

INFO: ContextListener: attributeAdded('com.sun.faces.application.InjectionApplicationFactory', '[email protected]')

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', '[email protected]')

Nov 06, 2012 1:09:37 AM org.apache.catalina.core.ApplicationContext log

INFO: ContextListener: attributeAdded('org.apache.jasper.runtime.JspApplicationContextImpl', '[email protected]')

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', '[email protected]')

Nov 06, 2012 1:09:37 AM org.apache.catalina.core.ApplicationContext log

INFO: ContextListener: attributeAdded('org.apache.jasper.compiler.TldLocationsCache', '[email protected]')

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

Please advise. Thanks.

网友答案:

I might have resolved this already. I removed Mojarra 2.1.4 JAR from tomcat /lib folder and added to my project (web app) classpath (list of libraries in NetBeans), restarted Tomcat7.0.32, rebuild project/app, deployed app to Tomcat, and this error no longer shows up in server log.

Now I'm dealing with other issues (JPA, my database connection, etc... that was all configured and working in Glassfish).

相关阅读:
Top