应用程序在启动时未正确初始化,找不到Factory:javax.faces.application.ApplicationFactory。试图找到备份

时间:2014-11-23 10:55:46

标签: java maven jboss myfaces mojarra

我是JSF的新手,所以这可能是一个愚蠢的问题。 我正在研究JSF 2.2,Java 7,JBoss 7.1,我的项目工作正常,直到我决定从Mojarra切换到myfaces才能够上传和下载文件功能。我决定用战斧。现在我一直在跟踪错误 -

05:33:27,730 SEVERE [javax.faces] (ServerService Thread Pool -- 77) Application was not properly initialized at startup, could not find Factory: javax.faces.application.ApplicationFactory. Attempting to find backup.
05:33:27,730 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/DigitalYearbook]] (ServerService Thread Pool -- 77) JBWEB000287: Exception sending context initialized event to listener instance of class org.apache.myfaces.webapp.StartupServletContextListener: java.lang.IllegalStateException: Could not find backup for factory javax.faces.application.ApplicationFactory. 
    at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:1010) [jboss-jsf-api_2.1_spec-2.1.28.Final-redhat-1.jar:2.1.28.Final-redhat-1]
    at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:342) [jboss-jsf-api_2.1_spec-2.1.28.Final-redhat-1.jar:2.1.28.Final-redhat-1]
    at org.apache.myfaces.context.servlet.FacesContextImplBase.getApplication(FacesContextImplBase.java:169) [myfaces-impl-2.2.6.jar:2.2.6]
    at org.apache.myfaces.context.servlet.FacesContextImplBase.getELContext(FacesContextImplBase.java:220) [myfaces-impl-2.2.6.jar:2.2.6]
    at javax.faces.component.UIViewRoot.setLocale(UIViewRoot.java:1455) [jboss-jsf-api_2.1_spec-2.1.28.Final-redhat-1.jar:2.1.28.Final-redhat-1]
    at org.apache.myfaces.webapp.AbstractFacesInitializer._createFacesContext(AbstractFacesInitializer.java:523) [myfaces-impl-2.2.6.jar:2.2.6]
    at org.apache.myfaces.webapp.AbstractFacesInitializer.initStartupFacesContext(AbstractFacesInitializer.java:495) [myfaces-impl-2.2.6.jar:2.2.6]
    at org.apache.myfaces.webapp.StartupServletContextListener.contextInitialized(StartupServletContextListener.java:113) [myfaces-impl-2.2.6.jar:2.2.6]
    at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3339) [jbossweb-7.4.8.Final-redhat-4.jar:7.4.8.Final-redhat-4]
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:3777) [jbossweb-7.4.8.Final-redhat-4.jar:7.4.8.Final-redhat-4]
    at org.jboss.as.web.deployment.WebDeploymentService.doStart(WebDeploymentService.java:161) [jboss-as-web-7.4.0.Final-redhat-19.jar:7.4.0.Final-redhat-19]
    at org.jboss.as.web.deployment.WebDeploymentService.access$000(WebDeploymentService.java:59) [jboss-as-web-7.4.0.Final-redhat-19.jar:7.4.0.Final-redhat-19]
    at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:94) [jboss-as-web-7.4.0.Final-redhat-19.jar:7.4.0.Final-redhat-19]
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [rt.jar:1.7.0_71]
    at java.util.concurrent.FutureTask.run(Unknown Source) [rt.jar:1.7.0_71]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [rt.jar:1.7.0_71]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.7.0_71]
    at java.lang.Thread.run(Unknown Source) [rt.jar:1.7.0_71]
    at org.jboss.threads.JBossThread.run(JBossThread.java:122)

05:33:27,777 INFO  [javax.enterprise.resource.webcontainer.jsf.config] (ServerService Thread Pool -- 77) Initializing Mojarra 2.1.28-jbossorg-2  for context '/DigitalYearbook'
05:33:28,495 SEVERE [javax.enterprise.resource.webcontainer.jsf.config] (ServerService Thread Pool -- 77) Critical error during deployment: : com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! org.apache.myfaces.context.servlet.StartupFacesContextImpl cannot be cast to com.sun.faces.config.InitFacesContext
    at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:376) [jsf-impl-2.1.28.redhat-3.jar:2.1.28.redhat-3]
    at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:216) [jsf-impl-2.1.28.redhat-3.jar:2.1.28.redhat-3]
    at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3339) [jbossweb-7.4.8.Final-redhat-4.jar:7.4.8.Final-redhat-4]
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:3777) [jbossweb-7.4.8.Final-redhat-4.jar:7.4.8.Final-redhat-4]
    at org.jboss.as.web.deployment.WebDeploymentService.doStart(WebDeploymentService.java:161) [jboss-as-web-7.4.0.Final-redhat-19.jar:7.4.0.Final-redhat-19]
    at org.jboss.as.web.deployment.WebDeploymentService.access$000(WebDeploymentService.java:59) [jboss-as-web-7.4.0.Final-redhat-19.jar:7.4.0.Final-redhat-19]
    at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:94) [jboss-as-web-7.4.0.Final-redhat-19.jar:7.4.0.Final-redhat-19]
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [rt.jar:1.7.0_71]
    at java.util.concurrent.FutureTask.run(Unknown Source) [rt.jar:1.7.0_71]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [rt.jar:1.7.0_71]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.7.0_71]
    at java.lang.Thread.run(Unknown Source) [rt.jar:1.7.0_71]
    at org.jboss.threads.JBossThread.run(JBossThread.java:122)
Caused by: java.lang.ClassCastException: org.apache.myfaces.context.servlet.StartupFacesContextImpl cannot be cast to com.sun.faces.config.InitFacesContext
    at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:333) [jsf-impl-2.1.28.redhat-3.jar:2.1.28.redhat-3]
    ... 12 more

05:33:28,495 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/DigitalYearbook]] (ServerService Thread Pool -- 77) JBWEB000287: Exception sending context initialized event to listener instance of class com.sun.faces.config.ConfigureListener: java.lang.RuntimeException: com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! org.apache.myfaces.context.servlet.StartupFacesContextImpl cannot be cast to com.sun.faces.config.InitFacesContext
    at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:276) [jsf-impl-2.1.28.redhat-3.jar:2.1.28.redhat-3]
    at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3339) [jbossweb-7.4.8.Final-redhat-4.jar:7.4.8.Final-redhat-4]
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:3777) [jbossweb-7.4.8.Final-redhat-4.jar:7.4.8.Final-redhat-4]
    at org.jboss.as.web.deployment.WebDeploymentService.doStart(WebDeploymentService.java:161) [jboss-as-web-7.4.0.Final-redhat-19.jar:7.4.0.Final-redhat-19]
    at org.jboss.as.web.deployment.WebDeploymentService.access$000(WebDeploymentService.java:59) [jboss-as-web-7.4.0.Final-redhat-19.jar:7.4.0.Final-redhat-19]
    at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:94) [jboss-as-web-7.4.0.Final-redhat-19.jar:7.4.0.Final-redhat-19]
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [rt.jar:1.7.0_71]
    at java.util.concurrent.FutureTask.run(Unknown Source) [rt.jar:1.7.0_71]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [rt.jar:1.7.0_71]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.7.0_71]
    at java.lang.Thread.run(Unknown Source) [rt.jar:1.7.0_71]
    at org.jboss.threads.JBossThread.run(JBossThread.java:122)
Caused by: com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! org.apache.myfaces.context.servlet.StartupFacesContextImpl cannot be cast to com.sun.faces.config.InitFacesContext
    at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:376) [jsf-impl-2.1.28.redhat-3.jar:2.1.28.redhat-3]
    at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:216) [jsf-impl-2.1.28.redhat-3.jar:2.1.28.redhat-3]
    ... 11 more
Caused by: java.lang.ClassCastException: org.apache.myfaces.context.servlet.StartupFacesContextImpl cannot be cast to com.sun.faces.config.InitFacesContext
    at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:333) [jsf-impl-2.1.28.redhat-3.jar:2.1.28.redhat-3]
    ... 12 more

05:33:28,495 ERROR [org.apache.catalina.core] (ServerService Thread Pool -- 77) JBWEB001103: Error detected during context /DigitalYearbook start, will stop it
05:33:28,510 SEVERE [javax.faces] (ServerService Thread Pool -- 77) Application was not properly initialized at startup, could not find Factory: javax.faces.application.ApplicationFactory. Attempting to find backup.
05:33:28,510 SEVERE [javax.enterprise.resource.webcontainer.jsf.config] (ServerService Thread Pool -- 77) Unexpected exception when attempting to tear down the Mojarra runtime: java.lang.IllegalStateException: Could not find backup for factory javax.faces.application.ApplicationFactory. 
    at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:1010) [jboss-jsf-api_2.1_spec-2.1.28.Final-redhat-1.jar:2.1.28.Final-redhat-1]
    at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:342) [jboss-jsf-api_2.1_spec-2.1.28.Final-redhat-1.jar:2.1.28.Final-redhat-1]
    at com.sun.faces.config.InitFacesContext.getApplication(InitFacesContext.java:141) [jsf-impl-2.1.28.redhat-3.jar:2.1.28.redhat-3]
    at com.sun.faces.config.ConfigureListener.contextDestroyed(ConfigureListener.java:314) [jsf-impl-2.1.28.redhat-3.jar:2.1.28.redhat-3]
    at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:3427) [jbossweb-7.4.8.Final-redhat-4.jar:7.4.8.Final-redhat-4]
    at org.apache.catalina.core.StandardContext.stop(StandardContext.java:3920) [jbossweb-7.4.8.Final-redhat-4.jar:7.4.8.Final-redhat-4]
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:3839) [jbossweb-7.4.8.Final-redhat-4.jar:7.4.8.Final-redhat-4]
    at org.jboss.as.web.deployment.WebDeploymentService.doStart(WebDeploymentService.java:161) [jboss-as-web-7.4.0.Final-redhat-19.jar:7.4.0.Final-redhat-19]
    at org.jboss.as.web.deployment.WebDeploymentService.access$000(WebDeploymentService.java:59) [jboss-as-web-7.4.0.Final-redhat-19.jar:7.4.0.Final-redhat-19]
    at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:94) [jboss-as-web-7.4.0.Final-redhat-19.jar:7.4.0.Final-redhat-19]
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [rt.jar:1.7.0_71]
    at java.util.concurrent.FutureTask.run(Unknown Source) [rt.jar:1.7.0_71]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [rt.jar:1.7.0_71]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.7.0_71]
    at java.lang.Thread.run(Unknown Source) [rt.jar:1.7.0_71]
    at org.jboss.threads.JBossThread.run(JBossThread.java:122)

05:33:28,510 SEVERE [javax.faces] (ServerService Thread Pool -- 77) Application was not properly initialized at startup, could not find Factory: javax.faces.application.ApplicationFactory. Attempting to find backup.
05:33:28,510 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/DigitalYearbook]] (ServerService Thread Pool -- 77) JBWEB000306: Exception sending context destroyed event to listener instance of class org.apache.myfaces.webapp.StartupServletContextListener: java.lang.IllegalStateException: Could not find backup for factory javax.faces.application.ApplicationFactory. 
    at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:1010) [jboss-jsf-api_2.1_spec-2.1.28.Final-redhat-1.jar:2.1.28.Final-redhat-1]
    at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:342) [jboss-jsf-api_2.1_spec-2.1.28.Final-redhat-1.jar:2.1.28.Final-redhat-1]
    at org.apache.myfaces.context.servlet.FacesContextImplBase.getApplication(FacesContextImplBase.java:169) [myfaces-impl-2.2.6.jar:2.2.6]
    at org.apache.myfaces.context.servlet.FacesContextImplBase.getELContext(FacesContextImplBase.java:220) [myfaces-impl-2.2.6.jar:2.2.6]
    at javax.faces.component.UIViewRoot.setLocale(UIViewRoot.java:1455) [jboss-jsf-api_2.1_spec-2.1.28.Final-redhat-1.jar:2.1.28.Final-redhat-1]
    at org.apache.myfaces.webapp.AbstractFacesInitializer._createFacesContext(AbstractFacesInitializer.java:523) [myfaces-impl-2.2.6.jar:2.2.6]
    at org.apache.myfaces.webapp.AbstractFacesInitializer.initShutdownFacesContext(AbstractFacesInitializer.java:505) [myfaces-impl-2.2.6.jar:2.2.6]
    at org.apache.myfaces.webapp.StartupServletContextListener.contextDestroyed(StartupServletContextListener.java:155) [myfaces-impl-2.2.6.jar:2.2.6]
    at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:3427) [jbossweb-7.4.8.Final-redhat-4.jar:7.4.8.Final-redhat-4]
    at org.apache.catalina.core.StandardContext.stop(StandardContext.java:3920) [jbossweb-7.4.8.Final-redhat-4.jar:7.4.8.Final-redhat-4]
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:3839) [jbossweb-7.4.8.Final-redhat-4.jar:7.4.8.Final-redhat-4]
    at org.jboss.as.web.deployment.WebDeploymentService.doStart(WebDeploymentService.java:161) [jboss-as-web-7.4.0.Final-redhat-19.jar:7.4.0.Final-redhat-19]
    at org.jboss.as.web.deployment.WebDeploymentService.access$000(WebDeploymentService.java:59) [jboss-as-web-7.4.0.Final-redhat-19.jar:7.4.0.Final-redhat-19]
    at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:94) [jboss-as-web-7.4.0.Final-redhat-19.jar:7.4.0.Final-redhat-19]
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [rt.jar:1.7.0_71]
    at java.util.concurrent.FutureTask.run(Unknown Source) [rt.jar:1.7.0_71]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [rt.jar:1.7.0_71]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.7.0_71]
    at java.lang.Thread.run(Unknown Source) [rt.jar:1.7.0_71]
    at org.jboss.threads.JBossThread.run(JBossThread.java:122)

05:33:28,510 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 77) MSC000001: Failed to start service jboss.web.deployment.default-host./DigitalYearbook: org.jboss.msc.service.StartException in service jboss.web.deployment.default-host./DigitalYearbook: org.jboss.msc.service.StartException in anonymous service: JBAS018040: Failed to start context
    at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:97)
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [rt.jar:1.7.0_71]
    at java.util.concurrent.FutureTask.run(Unknown Source) [rt.jar:1.7.0_71]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [rt.jar:1.7.0_71]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.7.0_71]
    at java.lang.Thread.run(Unknown Source) [rt.jar:1.7.0_71]
    at org.jboss.threads.JBossThread.run(JBossThread.java:122)
Caused by: org.jboss.msc.service.StartException in anonymous service: JBAS018040: Failed to start context
    at org.jboss.as.web.deployment.WebDeploymentService.doStart(WebDeploymentService.java:166)
    at org.jboss.as.web.deployment.WebDeploymentService.access$000(WebDeploymentService.java:59)
    at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:94)
    ... 6 more

05:33:28,541 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 26) JBAS018559: Deployed "DigitalYearbook.war" (runtime-name : "DigitalYearbook.war")
05:33:28,541 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 26) JBAS018559: Deployed "DigitalYearbook-EJB-Session-Entity.jar" (runtime-name : "DigitalYearbook-EJB-Session-Entity.jar")
05:33:28,557 INFO  [org.jboss.as.controller] (Controller Boot Thread) JBAS014774: Service status report
JBAS014777:   Services which failed to start:      service jboss.web.deployment.default-host./DigitalYearbook: org.jboss.msc.service.StartException in service jboss.web.deployment.default-host./DigitalYearbook: org.jboss.msc.service.StartException in anonymous service: JBAS018040: Failed to start context

05:33:28,651 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015961: Http management interface listening on ...
05:33:28,651 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015951: Admin console listening on ...
05:33:28,651 ERROR [org.jboss.as] (Controller Boot Thread) JBAS015875: JBoss EAP 6.3.0.GA (AS 7.4.0.Final-redhat-19) started (with errors) in 8725ms - Started 785 of 825 services (2 services failed or missing dependencies, 61 services are lazy, passive or on-demand)

任何想法为什么?

0 个答案:

没有答案