jsf 2.2 (final) not works on Jboss 7.1.1

2019-02-20 11:51发布

seems for me JSF 2.2 is not working at all on JBoss 7.1.1

with jboss's multi jsf I just dropped in replacement of the jsf api and jsf implementation modules with respective jars of jsf 2.2

when my application starts I see following error:

01:46:59,286 INFO  [javax.enterprise.resource.webcontainer.jsf.config] (MSC service thread 1-5) Initializing Mojarra 2.2.0 ( 20130502-2118 https://svn.java.net/svn/mojarra~svn/tags/2.2.0@11930) for context '/broker'
01:46:59,922 SEVERE [javax.enterprise.resource.webcontainer.jsf.config] (MSC service thread 1-5) Critical error during deployment: : java.lang.NoClassDefFoundError: com/sun/faces/spi/InjectionProvider
    at javax.faces.FactoryFinder$FactoryManager.copyInjectionProviderFromFacesContext(FactoryFinder.java:1051) [jboss-jsf-api_2.2_spec-2.2.0.jar:2.2.0]
    at javax.faces.FactoryFinder$FactoryManager.<init>(FactoryFinder.java:1035) [jboss-jsf-api_2.2_spec-2.2.0.jar:2.2.0]
    at javax.faces.FactoryFinder$FactoryManagerCache.getApplicationFactoryManager(FactoryFinder.java:856) [jboss-jsf-api_2.2_spec-2.2.0.jar:2.2.0]
    at javax.faces.FactoryFinder$FactoryManagerCache.getApplicationFactoryManager(FactoryFinder.java:793) [jboss-jsf-api_2.2_spec-2.2.0.jar:2.2.0]
    at javax.faces.FactoryFinder$FactoryManagerCache.access$100(FactoryFinder.java:768) [jboss-jsf-api_2.2_spec-2.2.0.jar:2.2.0]
    at javax.faces.FactoryFinder.setFactory(FactoryFinder.java:409) [jboss-jsf-api_2.2_spec-2.2.0.jar:2.2.0]
    at com.sun.faces.config.processor.FactoryConfigProcessor.setFactory(FactoryConfigProcessor.java:317) [jsf-impl-2.2.0.jar:2.2.0]
    at com.sun.faces.config.processor.FactoryConfigProcessor.processFactories(FactoryConfigProcessor.java:259) [jsf-impl-2.2.0.jar:2.2.0]
    at com.sun.faces.config.processor.FactoryConfigProcessor.process(FactoryConfigProcessor.java:216) [jsf-impl-2.2.0.jar:2.2.0]
    at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:435) [jsf-impl-2.2.0.jar:2.2.0]
    at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:214) [jsf-impl-2.2.0.jar:2.2.0]
    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(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_09]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_09]
    at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_09]
Caused by: java.lang.ClassNotFoundException: com.sun.faces.spi.InjectionProvider from [Module "javax.faces.api:main" from local module loader @70dc82be (roots: /Users/ilyadyoshin/develop/jboss-as-7.1.1.Final/modules)]
    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)
    at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
    at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)
    ... 19 more

Even more: when I look through contents of the jsf-api.jar I see this class.

3条回答
虎瘦雄心在
2楼-- · 2019-02-20 12:06

You are right, JSF 2.2 seems only to be supported starting from Wildfly / AS 8. I found a thread at JBoss community with installation instructions, followed by the information that it makes no sense to install with AS 7.1.1.

查看更多
Evening l夕情丶
3楼-- · 2019-02-20 12:24

The thread referenced in the other answer (https://community.jboss.org/thread/203257) has been updated. I've tried it on my AS 7.1.1 and it works

查看更多
我只想做你的唯一
4楼-- · 2019-02-20 12:26

may be I'm late but for other peoples who fall into the same problem, I found a solution here : https://community.jboss.org/thread/203257?start=0&tstart=0

Add to the module.xml of your JSF API module a depency to the JSF IMPL module by adding this line :

<module name="com.sun.jsf-impl"/>

Some changes may be required when multiple JSF versions exists on the AS. Tested with JBoss 7.1 and JSF 2.2.0m12

EDIT : I didn't saw "(final)" in your subject, with the final JSF 2.2 version I ran into another probleme with NoContextActiveException for FlowDefinition :(

查看更多
登录 后发表回答