4 Replies Latest reply on Aug 7, 2017 1:07 PM by Gulam Samdani

    Wildfly and MyFaces 2.2 problem

    Christian Kölle Newbie

      Hi

       

      We want to use Myfaces 2.2 in Wildfly 8.0.0.Final. I followed the instructions on Steps to add any new JSF implementation or version to WildFly and everything seems to be fine. But if i deploy our web application i get the following stack trace:

       

      10:35:38,810 INFO  [org.apache.myfaces.spi.impl.DefaultInjectionProviderFactory] (MSC service thread 1-5) Using InjectionProvider org.apache.myfaces.spi.impl.Tomcat7AnnotationInjectionProvider

      10:35:38,811 SEVERE [org.apache.myfaces.webapp.AbstractFacesInitializer] (MSC service thread 1-5) An error occured while initializing MyFaces: java.lang.reflect.InvocationTargetException: javax.faces.FacesException: java.lang.reflect.InvocationTargetException

        at javax.faces.FactoryFinder.injectAndPostConstruct(FactoryFinder.java:420) [myfaces-api-2.2.2.jar:2.2.2]

        at javax.faces.FactoryFinder.newFactoryInstance(FactoryFinder.java:519) [myfaces-api-2.2.2.jar:2.2.2]

        at javax.faces.FactoryFinder._getFactory(FactoryFinder.java:361) [myfaces-api-2.2.2.jar:2.2.2]

        at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:225) [myfaces-api-2.2.2.jar:2.2.2]

        at org.apache.myfaces.application.ViewHandlerImpl.<init>(ViewHandlerImpl.java:90) [myfaces-impl-2.2.2.jar:2.2.2]

        at org.apache.myfaces.application.ApplicationImpl.<init>(ApplicationImpl.java:271) [myfaces-impl-2.2.2.jar:2.2.2]

        at org.apache.myfaces.application.ApplicationImpl.<init>(ApplicationImpl.java:254) [myfaces-impl-2.2.2.jar:2.2.2]

        at org.apache.myfaces.application.ApplicationFactoryImpl.createAndLogNewApplication(ApplicationFactoryImpl.java:55) [myfaces-impl-2.2.2.jar:2.2.2]

        at org.apache.myfaces.application.ApplicationFactoryImpl.<init>(ApplicationFactoryImpl.java:50) [myfaces-impl-2.2.2.jar:2.2.2]

        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [rt.jar:1.7.0_51]

        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) [rt.jar:1.7.0_51]

        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [rt.jar:1.7.0_51]

        at java.lang.reflect.Constructor.newInstance(Constructor.java:526) [rt.jar:1.7.0_51]

        at java.lang.Class.newInstance(Class.java:374) [rt.jar:1.7.0_51]

        at javax.faces.FactoryFinder.newFactoryInstance(FactoryFinder.java:518) [myfaces-api-2.2.2.jar:2.2.2]

        at javax.faces.FactoryFinder._getFactory(FactoryFinder.java:361) [myfaces-api-2.2.2.jar:2.2.2]

        at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:225) [myfaces-api-2.2.2.jar:2.2.2]

        at org.apache.myfaces.config.FacesConfigurator.configureApplication(FacesConfigurator.java:577) [myfaces-impl-2.2.2.jar:2.2.2]

        at org.apache.myfaces.config.FacesConfigurator.configure(FacesConfigurator.java:477) [myfaces-impl-2.2.2.jar:2.2.2]

        at org.apache.myfaces.webapp.AbstractFacesInitializer.buildConfiguration(AbstractFacesInitializer.java:416) [myfaces-impl-2.2.2.jar:2.2.2]

        at org.apache.myfaces.webapp.Jsp21FacesInitializer.initContainerIntegration(Jsp21FacesInitializer.java:73) [myfaces-impl-2.2.2.jar:2.2.2]

        at org.apache.myfaces.webapp.AbstractFacesInitializer.initFaces(AbstractFacesInitializer.java:172) [myfaces-impl-2.2.2.jar:2.2.2]

        at org.apache.myfaces.webapp.StartupServletContextListener.contextInitialized(StartupServletContextListener.java:119) [myfaces-impl-2.2.2.jar:2.2.2]

        at io.undertow.servlet.core.ApplicationListeners.contextInitialized(ApplicationListeners.java:173) [undertow-servlet-1.0.0.Final.jar:1.0.0.Final]

        at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:187) [undertow-servlet-1.0.0.Final.jar:1.0.0.Final]

        at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:86)

        at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.start(UndertowDeploymentService.java:71)

        at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948)

        at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)

        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_51]

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_51]

        at java.lang.Thread.run(Thread.java:744) [rt.jar:1.7.0_51]

      Caused by: java.lang.reflect.InvocationTargetException

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_51]

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_51]

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_51]

        at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_51]

        at javax.faces.FactoryFinder.injectAndPostConstruct(FactoryFinder.java:415) [myfaces-api-2.2.2.jar:2.2.2]

        ... 31 more

      Caused by: java.lang.NoClassDefFoundError: org/apache/tomcat/InstanceManager

        at org.apache.myfaces.spi.impl.Tomcat7AnnotationInjectionProvider.initManager(Tomcat7AnnotationInjectionProvider.java:182) [myfaces-impl-2.2.2.jar:2.2.2]

        at org.apache.myfaces.spi.impl.Tomcat7AnnotationInjectionProvider.postConstruct(Tomcat7AnnotationInjectionProvider.java:85) [myfaces-impl-2.2.2.jar:2.2.2]

        ... 36 more

       

      Of course the Tomcat InstanceManager is not available. I think that the use of the Tomcat7AnnotationInjectionProvider is not correct. The use of CDIAnnotationDelegateInjectionProvider would be correct. But i don't find any hint how to change this.

       

      Christian