Environment :
JAVA EE 7
CDI
WildFly 8.2.0
MyFaces 2.2.8
Issue :
I am trying to run WildFly 8.2.0 with myFaces 2.2.8 as default JSF implementation. Installion is completed . The details for this are on another SO question :
Installing Apache MyFaces 2 on WildFly 8.2.0
When my application war is deployed on WildFly 8.2.0 , the following exception is thrown and deployment doesn't complete.
Caused by: java.lang.ClassNotFoundException: org.apache.tomcat.InstanceManager from [Module "com.sun.jsf-impl:myfaces-2.2.8" from local module loader @736e9adb
(finder: local module finder @6d21714c (roots: C:\Users\xyz\wildfly-8.2.0.Final\modules,C:\Users\xyz\wildfly-8.2.0.Final\modules\system\layers\base))] at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:213) [jboss-modules.jar:1.3.3.Final] at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:459) [jboss-modules.jar:1.3.3.Final] at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:408) [jboss-modules.jar:1.3.3.Final] at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:389) [jboss-modules.jar:1.3.3.Final] at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:134) [jboss-modules.jar:1.3.3.Final] at org.apache.myfaces.spi.impl.Tomcat7AnnotationInjectionProvider.initManager(Tomcat7AnnotationInjectionProvider.java:182) at org.apache.myfaces.spi.impl.Tomcat7AnnotationInjectionProvider.postConstruct(Tomcat7AnnotationInjectionProvider.java:85) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.8.0_60] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [rt.jar:1.8.0_60] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.8.0_60] at java.lang.reflect.Method.invoke(Method.java:497) [rt.jar:1.8.0_60] at javax.faces.FactoryFinder.injectAndPostConstruct(FactoryFinder.java:415) at javax.faces.FactoryFinder.newFactoryInstance(FactoryFinder.java:519) at javax.faces.FactoryFinder._getFactory(FactoryFinder.java:361) at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:225) at com.sun.faces.config.processor.FactoryConfigProcessor.verifyFactoriesExist(FactoryConfigProcessor.java:186) at com.sun.faces.config.processor.FactoryConfigProcessor.process(FactoryConfigProcessor.java:131) at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:203) ... 10 more
I have searched for the issue on web and found out same problem here http://www.hivmr.com/db/3jsapc8j3xz3js1dsasjxjpkx37379cm , but no solution has been found.
The issue can be described as :
1) MyFaces uses Tomcat7AnnotationInjectionProvider for annotation processing which requires org.apache.tomcat.InstanceManager which is not available.
2) One solution is to use CDIAnnotationDelegateInjectionProvider , but how to configure it in MyFaces is not known ?
3) How to hook MyFaces in WildFly so that JBOSS Weld can process annotations instead of MyFaces supplied class ?