我正在尝试在Jboss 7.1.1.Final上使用JSF 2.2.2 我按照此链接中的解决方案1: http://www.mastertheboss.com/jsf/installing-jsf-22-on-jboss-as-7 这是基于替换当前的jboss jsf库 然后我改变了面部配置。 但是在尝试运行应用程序时,我遇到以下异常:
22:28:56,076 SEVERE [javax.enterprise.resource.webcontainer.jsf.config] (MSC service thread 1-1) Critical error during deployment: : com.sun.faces.config.ConfigurationException: The tag named passThroughAttribute from namespace http://xmlns.jcp.org/jsf/core has a null handler-class defined
at com.sun.faces.config.processor.FaceletTaglibConfigProcessor.processHandlerClass(FaceletTaglibConfigProcessor.java:422) [jsf-impl-2.2.2.jar:2.2.2]
at com.sun.faces.config.processor.FaceletTaglibConfigProcessor.processTags(FaceletTaglibConfigProcessor.java:378) [jsf-impl-2.2.2.jar:2.2.2]
at com.sun.faces.config.processor.FaceletTaglibConfigProcessor.processTagLibrary(FaceletTaglibConfigProcessor.java:321) [jsf-impl-2.2.2.jar:2.2.2]
at com.sun.faces.config.processor.FaceletTaglibConfigProcessor.process(FaceletTaglibConfigProcessor.java:270) [jsf-impl-2.2.2.jar:2.2.2]
at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:437) [jsf-impl-2.2.2.jar:2.2.2]
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:214) [jsf-impl-2.2.2.jar:2.2.2]
at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3392) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3850) [jbossweb-7.0.13.Final.jar:]
at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [rt.jar:1.7.0_25]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.7.0_25]
at java.lang.Thread.run(Unknown Source) [rt.jar:1.7.0_25]
22:28:56,080 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/motivosity]] (MSC service thread 1-1) Exception sending context initialized event to listener instance of class com.sun.faces.config.ConfigureListener: java.lang.RuntimeException: com.sun.faces.config.ConfigurationException: The tag named passThroughAttribute from namespace http://xmlns.jcp.org/jsf/core has a null handler-class defined
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:273) [jsf-impl-2.2.2.jar:2.2.2]
at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3392) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3850) [jbossweb-7.0.13.Final.jar:]
at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [rt.jar:1.7.0_25]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.7.0_25]
at java.lang.Thread.run(Unknown Source) [rt.jar:1.7.0_25]
Caused by: com.sun.faces.config.ConfigurationException: The tag named passThroughAttribute from namespace http://xmlns.jcp.org/jsf/core has a null handler-class defined
at com.sun.faces.config.processor.FaceletTaglibConfigProcessor.processHandlerClass(FaceletTaglibConfigProcessor.java:422) [jsf-impl-2.2.2.jar:2.2.2]
at com.sun.faces.config.processor.FaceletTaglibConfigProcessor.processTags(FaceletTaglibConfigProcessor.java:378) [jsf-impl-2.2.2.jar:2.2.2]
at com.sun.faces.config.processor.FaceletTaglibConfigProcessor.processTagLibrary(FaceletTaglibConfigProcessor.java:321) [jsf-impl-2.2.2.jar:2.2.2]
at com.sun.faces.config.processor.FaceletTaglibConfigProcessor.process(FaceletTaglibConfigProcessor.java:270) [jsf-impl-2.2.2.jar:2.2.2]
at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:437) [jsf-impl-2.2.2.jar:2.2.2]
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:214) [jsf-impl-2.2.2.jar:2.2.2]
... 8 more
22:28:56,087 ERROR [org.apache.catalina.core.StandardContext] (MSC service thread 1-1) Error listenerStart
22:28:56,088 ERROR [org.apache.catalina.core.StandardContext] (MSC service thread 1-1) Context [/motivosity] startup failed due to previous errors
22:28:56,089 SEVERE [javax.faces] (MSC service thread 1-1) Application was not properly initialized at startup, could not find Factory: javax.faces.application.ApplicationFactory. Attempting to find backup.
22:28:56,090 SEVERE [javax.enterprise.resource.webcontainer.jsf.config] (MSC service thread 1-1) 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:1135) [jsf-api-2.2.2.jar:2.2]
at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:379) [jsf-api-2.2.2.jar:2.2]
at com.sun.faces.config.InitFacesContext.getApplication(InitFacesContext.java:140) [jsf-impl-2.2.2.jar:2.2.2]
at com.sun.faces.config.ConfigureListener.contextDestroyed(ConfigureListener.java:310) [jsf-impl-2.2.2.jar:2.2.2]
at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:3489) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.StandardContext.stop(StandardContext.java:3999) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3917) [jbossweb-7.0.13.Final.jar:]
at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [rt.jar:1.7.0_25]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.7.0_25]
at java.lang.Thread.run(Unknown Source) [rt.jar:1.7.0_25]
22:28:56,095 INFO [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/motivosity]] (MSC service thread 1-1) Cleaning up Shiro Environment
22:28:56,099 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-1) MSC00001: Failed to start service jboss.web.deployment.default-host./motivosity: org.jboss.msc.service.StartException in service jboss.web.deployment.default-host./motivosity: JBAS018040: Failed to start context
at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:95)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [rt.jar:1.7.0_25]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.7.0_25]
at java.lang.Thread.run(Unknown Source) [rt.jar:1.7.0_25]
我在项目方面删除了jsf的配置但仍然得到相同的错误,请告知我该如何解决这个问题。
更新:我发现问题出在 eclipse deploy to jboss ,因为我试图用maven安装应用程序并将war复制到deployments文件夹并启动 standalone.bat 文件,应用程序已成功启动且没有错误。
答案 0 :(得分:14)
在Eclipse中,转到项目属性 - >项目方面 - > Java Server Faces,并将类型设置为 Target Runtime提供的库。
答案 1 :(得分:10)
我们在迁移申请时遇到了类似的问题,请确保您已在jsf
中添加了scope provided
个罐子,如下所示:
<jsf.version>2.2.2</jsf.version>
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-api</artifactId>
<version>${jsf.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-impl</artifactId>
<version>${jsf.version}</version>
<scope>provided</scope>
</dependency>
更改您的project facet
(Project->Properties->Project Facets)
并确保您的jsf
正在选择正确的jar
做一个干净的构建,希望这将解决上述问题
答案 2 :(得分:1)
我和你有同样的问题。我通过在我的pom.xml中删除这个依赖项来解决它。
public static string giveAdecentFormattedExpireDate(DateTime? expDate)
{
if (expDate != null)
{
DateTime tempDT = (DateTime) expDate;
tempDT.AddMonths(1);
return tempDT.ToString("yyyy-MM-dd");
}
else
{
return "0001-01-01";
}
}
只有在Tomcat上部署时才需要此依赖关系,而不是在Jboss上部署。
答案 3 :(得分:0)
我遇到了同样的问题。 您必须使用项目库并删除Mojarra 2.2.x实现JAR
答案 4 :(得分:0)
在NetBeans中,您必须取消选中&#34; Package&#34; “项目属性”窗口中针对JSF库的选项。
答案 5 :(得分:0)
我有同样的问题,我解决了改变这个Java Server Faces,右键点击你的proyect并转到Properties-&gt; Project Facets-&gt; Java Server Faces和更改
来自:&#34; Jsf 2.2(Mojarra 2.2.0)&#34;
至&#34; Jsf 2.0(Mojarra 2.0.3-FCS)&#34;