6 Replies Latest reply on Jul 18, 2013 4:04 AM by Robert Panzer

    jboss 7.1.1final + weld servlet +  java.lang.InstantiationException: org.jboss.weld.environment.servlet.jsf.WeldApplicationFactory

    Rahul Razdan Newbie

      hi,

       

      i migrated my project from seam 2 to seam 3 . while deploying i faced this issue

       

       

      {code}

      16:27:34,523 INFO  [javax.enterprise.resource.webcontainer.jsf.config] (MSC service thread 1-5) Initializing Mojarra 2.1.7-jbossorg-1 (20120227-1401) for context '/xxx-web'

      16:27:37,952 SEVERE [javax.enterprise.resource.webcontainer.jsf.config] (MSC service thread 1-5) Critical error during deployment: : com.sun.faces.config.ConfigurationException: Factory 'javax.faces.application.ApplicationFactory' was not configured properly.

          at com.sun.faces.config.processor.FactoryConfigProcessor.verifyFactoriesExist(FactoryConfigProcessor.java:305) [jsf-impl-2.1.7-jbossorg-2.jar:]

          at com.sun.faces.config.processor.FactoryConfigProcessor.process(FactoryConfigProcessor.java:219) [jsf-impl-2.1.7-jbossorg-2.jar:]

          at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:361) [jsf-impl-2.1.7-jbossorg-2.jar:]

          at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:225) [jsf-impl-2.1.7-jbossorg-2.jar:]

          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]

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

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

      Caused by: javax.faces.FacesException: org.jboss.weld.environment.servlet.jsf.WeldApplicationFactory

          at javax.faces.FactoryFinder.getImplGivenPreviousImpl(FactoryFinder.java:643) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]

          at javax.faces.FactoryFinder.getImplementationInstance(FactoryFinder.java:509) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]

          at javax.faces.FactoryFinder.access$400(FactoryFinder.java:139) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]

          at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:993) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]

          at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:343) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]

          at com.sun.faces.config.processor.FactoryConfigProcessor.verifyFactoriesExist(FactoryConfigProcessor.java:303) [jsf-impl-2.1.7-jbossorg-2.jar:]

          ... 11 more

      Caused by: java.lang.InstantiationException: org.jboss.weld.environment.servlet.jsf.WeldApplicationFactory

          at java.lang.Class.newInstance0(Class.java:357) [rt.jar:1.7.0]

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

          at javax.faces.FactoryFinder.getImplGivenPreviousImpl(FactoryFinder.java:641) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]

          ... 16 more

       

      16:27:37,964 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/xxx-web]] (MSC service thread 1-5) Exception sending context initialized event to listener instance of class com.sun.faces.config.ConfigureListener: java.lang.RuntimeException: com.sun.faces.config.ConfigurationException: Factory 'javax.faces.application.ApplicationFactory' was not configured properly.

          at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:292) [jsf-impl-2.1.7-jbossorg-2.jar:]

          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]

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

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

      Caused by: com.sun.faces.config.ConfigurationException: Factory 'javax.faces.application.ApplicationFactory' was not configured properly.

          at com.sun.faces.config.processor.FactoryConfigProcessor.verifyFactoriesExist(FactoryConfigProcessor.java:305) [jsf-impl-2.1.7-jbossorg-2.jar:]

          at com.sun.faces.config.processor.FactoryConfigProcessor.process(FactoryConfigProcessor.java:219) [jsf-impl-2.1.7-jbossorg-2.jar:]

          at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:361) [jsf-impl-2.1.7-jbossorg-2.jar:]

          at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:225) [jsf-impl-2.1.7-jbossorg-2.jar:]

          ... 8 more

      Caused by: javax.faces.FacesException: org.jboss.weld.environment.servlet.jsf.WeldApplicationFactory

          at javax.faces.FactoryFinder.getImplGivenPreviousImpl(FactoryFinder.java:643) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]

          at javax.faces.FactoryFinder.getImplementationInstance(FactoryFinder.java:509) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]

          at javax.faces.FactoryFinder.access$400(FactoryFinder.java:139) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]

          at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:993) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]

          at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:343) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]

          at com.sun.faces.config.processor.FactoryConfigProcessor.verifyFactoriesExist(FactoryConfigProcessor.java:303) [jsf-impl-2.1.7-jbossorg-2.jar:]

          ... 11 more

      Caused by: java.lang.InstantiationException: org.jboss.weld.environment.servlet.jsf.WeldApplicationFactory

          at java.lang.Class.newInstance0(Class.java:357) [rt.jar:1.7.0]

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

          at javax.faces.FactoryFinder.getImplGivenPreviousImpl(FactoryFinder.java:641) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]

          ... 16 more

       

      16:27:37,976 ERROR [org.apache.catalina.core.StandardContext] (MSC service thread 1-5) Error listenerStart

      16:27:37,977 ERROR [org.apache.catalina.core.StandardContext] (MSC service thread 1-5) Context [/xxx-web] startup failed due to previous errors

      16:27:37,989 SEVERE [javax.faces] (MSC service thread 1-5) Application was not properly initialized at startup, could not find Factory: javax.faces.application.ApplicationFactory. Attempting to find backup.

      16:27:37,990 SEVERE [javax.enterprise.resource.webcontainer.jsf.config] (MSC service thread 1-5) 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:1008) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]

          at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:343) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]

          at com.sun.faces.config.InitFacesContext.getApplication(InitFacesContext.java:131) [jsf-impl-2.1.7-jbossorg-2.jar:]

          at com.sun.faces.config.ConfigureListener.contextDestroyed(ConfigureListener.java:328) [jsf-impl-2.1.7-jbossorg-2.jar:]

          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(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0]

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

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

       

      16:27:38,005 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-5) MSC00001: Failed to start service jboss.web.deployment.default-host./xxx-web: org.jboss.msc.service.StartException in service jboss.web.deployment.default-host./xxx-web: 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(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0]

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

          at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0]{code}

       

       

      i have weld-servlet dependency in my ejbmodule of ear .

       

      {code}<dependency>

                  <groupId>org.jboss.weld.servlet</groupId>

                  <artifactId>weld-servlet</artifactId>

                  <version>1.0.1-Final</version>

      </dependency>{code}

       

      one more strange behaviour is jboss 7.1.1 provides jboss-jsf-api_2.1_spec-2.0.2.Final.jar:2.0.2.Final not jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final so why I'm getting jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final in the exception . ?????

       

      can any one please point something out . Even on google not much is there .

       

      Thanks

        • 1. Re: jboss 7.1.1final + weld servlet +  java.lang.InstantiationException: org.jboss.weld.environment.servlet.jsf.WeldApplicationFactory
          Ales Justin Master

          i have weld-servlet dependency in my ejbmodule of ear .

          No need for this when deploying the app in JBossAS.

          • 2. Re: jboss 7.1.1final + weld servlet +  java.lang.InstantiationException: org.jboss.weld.environment.servlet.jsf.WeldApplicationFactory
            Rahul Razdan Newbie

            hi,

             

            THanks for reply but if i remove that dependency m getting compilation errors for below imports  :-

             

            import org.jboss.weld.el.Namespace;

            import org.jboss.weld.Container;

            import org.jboss.weld.context.ContextLifecycle;

            import org.jboss.weld.servlet.ServletLifecycle;

             

             

            then what i will do ???

             

            Thanks

            • 4. Re: jboss 7.1.1final + weld servlet +  java.lang.InstantiationException: org.jboss.weld.environment.servlet.jsf.WeldApplicationFactory
              Rahul Razdan Newbie

              hi,

               

              Then what should i use , beacause i need to fix this ,

              is there any other workaround for these classes . so that i can replace them???

               

              Thanks

              • 5. Re: jboss 7.1.1final + weld servlet +  java.lang.InstantiationException: org.jboss.weld.environment.servlet.jsf.WeldApplicationFactory
                Rahul Razdan Newbie

                hi removed that dependency and commented the code giving compilation erors .

                 

                but m still getting Exceptions

                 

                17:10:41,328 INFO  [javax.enterprise.resource.webcontainer.jsf.config] (MSC service thread 1-8) Initializing Mojarra 2.1.7-jbossorg-1 (20120227-1401) for context '/xxx-web'

                17:10:45,145 WARN  [org.jboss.modules] (MSC service thread 1-8) Failed to define class org.jboss.seam.faces.environment.SeamApplicationFactory in Module "deployment.xxx-ee.ear.seam-faces-3.1.0.Final.jar:main" from Service Module Loader: java.lang.LinkageError: Failed to link org/jboss/seam/faces/environment/SeamApplicationFactory (Module "deployment.xxx-ee.ear.seam-faces-3.1.0.Final.jar:main" from Service Module Loader)

                    at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:396)

                    at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:243)

                    at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:73)

                    at org.jboss.modules.Module.loadModuleClass(Module.java:517)

                    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:182)

                    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)

                    at java.lang.Class.forName0(Native Method) [rt.jar:1.7.0]

                    at java.lang.Class.forName(Class.java:264) [rt.jar:1.7.0]

                    at javax.faces.FactoryFinder.getImplGivenPreviousImpl(FactoryFinder.java:618) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]

                    at javax.faces.FactoryFinder.getImplementationInstance(FactoryFinder.java:509) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]

                    at javax.faces.FactoryFinder.access$400(FactoryFinder.java:139) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]

                    at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:993) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]

                    at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:343) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]

                    at com.sun.faces.config.processor.FactoryConfigProcessor.verifyFactoriesExist(FactoryConfigProcessor.java:303) [jsf-impl-2.1.7-jbossorg-2.jar:]

                    at com.sun.faces.config.processor.FactoryConfigProcessor.process(FactoryConfigProcessor.java:219) [jsf-impl-2.1.7-jbossorg-2.jar:]

                    at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:361) [jsf-impl-2.1.7-jbossorg-2.jar:]

                    at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:225) [jsf-impl-2.1.7-jbossorg-2.jar:]

                    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]

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

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

                Caused by: java.lang.NoClassDefFoundError: javax/faces/application/ApplicationFactory

                    at java.lang.ClassLoader.defineClass1(Native Method) [rt.jar:1.7.0]

                    at java.lang.ClassLoader.defineClass(ClassLoader.java:791) [rt.jar:1.7.0]

                    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) [rt.jar:1.7.0]

                    at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:327)

                    at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:391)

                    ... 27 more

                Caused by: java.lang.ClassNotFoundException: javax.faces.application.ApplicationFactory from [Module "deployment.xxx-ee.ear.seam-faces-3.1.0.Final.jar:main" from Service Module Loader]

                    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)

                    ... 32 more

                 

                17:10:45,163 SEVERE [javax.enterprise.resource.webcontainer.jsf.config] (MSC service thread 1-8) Critical error during deployment: : com.sun.faces.config.ConfigurationException: Factory 'javax.faces.application.ApplicationFactory' was not configured properly.

                    at com.sun.faces.config.processor.FactoryConfigProcessor.verifyFactoriesExist(FactoryConfigProcessor.java:305) [jsf-impl-2.1.7-jbossorg-2.jar:]

                    at com.sun.faces.config.processor.FactoryConfigProcessor.process(FactoryConfigProcessor.java:219) [jsf-impl-2.1.7-jbossorg-2.jar:]

                    at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:361) [jsf-impl-2.1.7-jbossorg-2.jar:]

                    at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:225) [jsf-impl-2.1.7-jbossorg-2.jar:]

                    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]

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

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

                Caused by: javax.faces.FacesException: org.jboss.seam.faces.environment.SeamApplicationFactory

                    at javax.faces.FactoryFinder.getImplGivenPreviousImpl(FactoryFinder.java:643) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]

                    at javax.faces.FactoryFinder.getImplementationInstance(FactoryFinder.java:509) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]

                    at javax.faces.FactoryFinder.access$400(FactoryFinder.java:139) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]

                    at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:993) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]

                    at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:343) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]

                    at com.sun.faces.config.processor.FactoryConfigProcessor.verifyFactoriesExist(FactoryConfigProcessor.java:303) [jsf-impl-2.1.7-jbossorg-2.jar:]

                    ... 11 more

                Caused by: java.lang.InstantiationException: org.jboss.seam.faces.environment.SeamApplicationFactory

                    at java.lang.Class.newInstance0(Class.java:357) [rt.jar:1.7.0]

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

                    at javax.faces.FactoryFinder.getImplGivenPreviousImpl(FactoryFinder.java:641) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]

                    ... 16 more

                 

                17:10:45,174 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/xxx-web]] (MSC service thread 1-8) Exception sending context initialized event to listener instance of class com.sun.faces.config.ConfigureListener: java.lang.RuntimeException: com.sun.faces.config.ConfigurationException: Factory 'javax.faces.application.ApplicationFactory' was not configured properly.

                    at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:292) [jsf-impl-2.1.7-jbossorg-2.jar:]

                    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]

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

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

                Caused by: com.sun.faces.config.ConfigurationException: Factory 'javax.faces.application.ApplicationFactory' was not configured properly.

                    at com.sun.faces.config.processor.FactoryConfigProcessor.verifyFactoriesExist(FactoryConfigProcessor.java:305) [jsf-impl-2.1.7-jbossorg-2.jar:]

                    at com.sun.faces.config.processor.FactoryConfigProcessor.process(FactoryConfigProcessor.java:219) [jsf-impl-2.1.7-jbossorg-2.jar:]

                    at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:361) [jsf-impl-2.1.7-jbossorg-2.jar:]

                    at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:225) [jsf-impl-2.1.7-jbossorg-2.jar:]

                    ... 8 more

                Caused by: javax.faces.FacesException: org.jboss.seam.faces.environment.SeamApplicationFactory

                    at javax.faces.FactoryFinder.getImplGivenPreviousImpl(FactoryFinder.java:643) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]

                    at javax.faces.FactoryFinder.getImplementationInstance(FactoryFinder.java:509) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]

                    at javax.faces.FactoryFinder.access$400(FactoryFinder.java:139) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]

                    at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:993) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]

                    at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:343) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]

                    at com.sun.faces.config.processor.FactoryConfigProcessor.verifyFactoriesExist(FactoryConfigProcessor.java:303) [jsf-impl-2.1.7-jbossorg-2.jar:]

                    ... 11 more

                Caused by: java.lang.InstantiationException: org.jboss.seam.faces.environment.SeamApplicationFactory

                    at java.lang.Class.newInstance0(Class.java:357) [rt.jar:1.7.0]

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

                    at javax.faces.FactoryFinder.getImplGivenPreviousImpl(FactoryFinder.java:641) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]

                    ... 16 more

                 

                17:10:45,185 ERROR [org.apache.catalina.core.StandardContext] (MSC service thread 1-8) Error listenerStart

                17:10:45,186 ERROR [org.apache.catalina.core.StandardContext] (MSC service thread 1-8) Context [/xxx-web] startup failed due to previous errors

                17:10:45,198 SEVERE [javax.faces] (MSC service thread 1-8) Application was not properly initialized at startup, could not find Factory: javax.faces.application.ApplicationFactory. Attempting to find backup.

                17:10:45,199 SEVERE [javax.enterprise.resource.webcontainer.jsf.config] (MSC service thread 1-8) 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:1008) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]

                    at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:343) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]

                    at com.sun.faces.config.InitFacesContext.getApplication(InitFacesContext.java:131) [jsf-impl-2.1.7-jbossorg-2.jar:]

                    at com.sun.faces.config.ConfigureListener.contextDestroyed(ConfigureListener.java:328) [jsf-impl-2.1.7-jbossorg-2.jar:]

                    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(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0]

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

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

                 

                17:10:45,213 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-8) MSC00001: Failed to start service jboss.web.deployment.default-host./xxx-web: org.jboss.msc.service.StartException in service jboss.web.deployment.default-host./xxx-web: 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(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0]

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

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

                • 6. Re: jboss 7.1.1final + weld servlet +  java.lang.InstantiationException: org.jboss.weld.environment.servlet.jsf.WeldApplicationFactory
                  Robert Panzer Newbie

                  Hi,

                   

                  I have the same problem when the war inside of an ear bundles an own JSF implementation and the deployment is handled as a CDI deployment.

                  Somehow the WeldApplicationFactory is registered as a second JSF ApplicationFactory.

                   

                  I debugged the code and during the initialization of the web application the JSF (1.1!) lib tries to call new WeldApplicationFactory(ApplicationFactory) but that fails due to a NoSuchMethodException, although the method is available, but probably the classes for the parameters don't match. As this fails JSF tries to simply call newInstance() but this fails as well and that's what you see in the log.

                   

                  It would be great if I could disable the Weld Deployer for this subdeployment. Does anyone have an idea if this is feasible?

                   

                  Kind regards,

                  Robert