6 Replies Latest reply on Dec 13, 2015 10:24 AM by binko.georgiev.binev

    jsf 1.2 and jboss 6.2 java.lang.InstantiationException: org.jboss.as.weld.webtier.jsf.WeldApplicationFactory

    binko.georgiev.binev

      Hi,

       

      I am trying to run jsf1.2 on JBoss6.2

      I come to the following exception

       

      20:57:12,026 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/bookstore6]] (ServerService Thread Pool -- 84) JBWEB000287: Exception sending context initialized event to listener instance of class com.sun.faces.config.ConfigureListener: com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! org.jboss.as.weld.webtier.jsf.WeldApplicationFactory

        at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:214) [jsf-impl-1.2_15.jar:1.2_15-20100816-SNAPSHOT]

        at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:200) [jsf-impl-1.2_15.jar:1.2_15-20100816-SNAPSHOT]

        at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3339) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]

        at org.apache.catalina.core.StandardContext.start(StandardContext.java:3780) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]

        at org.jboss.as.web.deployment.WebDeploymentService.doStart(WebDeploymentService.java:163) [jboss-as-web-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]

        at org.jboss.as.web.deployment.WebDeploymentService.access$000(WebDeploymentService.java:61) [jboss-as-web-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]

        at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:96) [jboss-as-web-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]

        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) [rt.jar:1.6.0_20]

        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) [rt.jar:1.6.0_20]

        at java.util.concurrent.FutureTask.run(FutureTask.java:138) [rt.jar:1.6.0_20]

        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_20]

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_20]

        at java.lang.Thread.run(Thread.java:619) [rt.jar:1.6.0_20]

        at org.jboss.threads.JBossThread.run(JBossThread.java:122) [jboss-threads-2.0.0.GA-redhat-1.jar:2.0.0.GA-redhat-1]

      Caused by: java.lang.InstantiationException: org.jboss.as.weld.webtier.jsf.WeldApplicationFactory

        at java.lang.Class.newInstance0(Class.java:340) [rt.jar:1.6.0_20]

        at java.lang.Class.newInstance(Class.java:308) [rt.jar:1.6.0_20]

        at javax.faces.FactoryFinder.getImplGivenPreviousImpl(FactoryFinder.java:537) [jsf-api-1.2_15.jar:1.2_15-20100816-SNAPSHOT]

        at javax.faces.FactoryFinder.getImplementationInstance(FactoryFinder.java:405) [jsf-api-1.2_15.jar:1.2_15-20100816-SNAPSHOT]

        at javax.faces.FactoryFinder.access$400(FactoryFinder.java:135) [jsf-api-1.2_15.jar:1.2_15-20100816-SNAPSHOT]

        at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:717) [jsf-api-1.2_15.jar:1.2_15-20100816-SNAPSHOT]

        at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:239) [jsf-api-1.2_15.jar:1.2_15-20100816-SNAPSHOT]

        at com.sun.faces.config.processor.FactoryConfigProcessor.verifyFactoriesExist(FactoryConfigProcessor.java:187) [jsf-impl-1.2_15.jar:1.2_15-20100816-SNAPSHOT]

        at com.sun.faces.config.processor.FactoryConfigProcessor.process(FactoryConfigProcessor.java:132) [jsf-impl-1.2_15.jar:1.2_15-20100816-SNAPSHOT]

        at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:204) [jsf-impl-1.2_15.jar:1.2_15-20100816-SNAPSHOT]

        ... 13 more

       

       

      20:57:12,043 ERROR [org.apache.catalina.core] (ServerService Thread Pool -- 84) JBWEB001103: Error detected during context /bookstore6 start, will stop it

      20:57:12,131 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 84) MSC000001: Failed to start service jboss.web.deployment.default-host./bookstore6: org.jboss.msc.service.StartException in service jboss.web.deployment.default-host./bookstore6: org.jboss.msc.service.StartException in anonymous service: JBAS018040: Starten von Kontext fehlgeschlagen

        at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:99)

        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) [rt.jar:1.6.0_20]

        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) [rt.jar:1.6.0_20]

        at java.util.concurrent.FutureTask.run(FutureTask.java:138) [rt.jar:1.6.0_20]

        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_20]

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_20]

        at java.lang.Thread.run(Thread.java:619) [rt.jar:1.6.0_20]

        at org.jboss.threads.JBossThread.run(JBossThread.java:122)

      Caused by: org.jboss.msc.service.StartException in anonymous service: JBAS018040: Starten von Kontext fehlgeschlagen

        at org.jboss.as.web.deployment.WebDeploymentService.doStart(WebDeploymentService.java:168)

        at org.jboss.as.web.deployment.WebDeploymentService.access$000(WebDeploymentService.java:61)

        at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:96)

        ... 7 more

       

       

      I have set the slot="1.2" in both modules as described here How to configure jboss-deployment-structure.xml in EAR files to force Weld to use JSF Version 1.2? - Red Hat Customer Po…

       

      "/modules/system/layers/base/org/jboss/as/weld/main/module.xml"

      "/modules/system/layers/base/org/jboss/weld/core/main/module.xml"

       

      But the problem was not solved.

      I am new to Jboss and I find it completely out of order to have to change the server files in order to deploy jsf1.2

       

      I have also tried using jboss-deployment-structure.xml

       

      But it has also not solved the problem.

       

      <jboss-deployment-structure>
        <deployment>
        <exclusions>
        <module name="javax.faces.api"/>
        <module name="com.sun.jsf-impl"/>
        </exclusions>
        <dependencies>
        <module name="javax.faces.api" slot="1.2"/>
        <module name="com.sun.jsf-impl" slot="1.2"/>
        </dependencies>
        </deployment>
      </jboss-deployment-structure>

       

      Has anyone any idea what do I have to do in order to solve this exception.

      Thanks to all

        • 2. Re: jsf 1.2 and jboss 6.2 java.lang.InstantiationException: org.jboss.as.weld.webtier.jsf.WeldApplicationFactory
          binko.georgiev.binev

          Danke für die Antwort.

           

          Ich hatte das Problem auch selbst behoben durch HInzufügen des folgenden Kontextparameters in web.xml

           

          <context-param>
          <param-name>org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL</param-name>
          <param-value>true</param-value>
          </context-param>

           

          Ich habe aber jetzt ein anderes Problem.

           

          Hier ist die Exception:

           

          09:22:37,582 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/bookstore6]] (ServerService Thread Pool -- 80) JBWEB000287: Exception sending context initialized event to listener instance of class com.sun.faces.config.ConfigureListener: com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! null

            at com.sun.faces.config.ConfigManager.initialize(Unknown Source) [jsf-impl-1.2.15.b01-redhat-12.jar:1.2.15.b01-redhat-12]

            at com.sun.faces.config.ConfigureListener.contextInitialized(Unknown Source) [jsf-impl-1.2.15.b01-redhat-12.jar:1.2.15.b01-redhat-12]

            at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3339) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]

            at org.apache.catalina.core.StandardContext.start(StandardContext.java:3780) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]

            at org.jboss.as.web.deployment.WebDeploymentService.doStart(WebDeploymentService.java:163) [jboss-as-web-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]

            at org.jboss.as.web.deployment.WebDeploymentService.access$000(WebDeploymentService.java:61) [jboss-as-web-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]

            at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:96) [jboss-as-web-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]

            at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) [rt.jar:1.6.0_20]

            at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) [rt.jar:1.6.0_20]

            at java.util.concurrent.FutureTask.run(FutureTask.java:138) [rt.jar:1.6.0_20]

            at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_20]

            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_20]

            at java.lang.Thread.run(Thread.java:619) [rt.jar:1.6.0_20]

            at org.jboss.threads.JBossThread.run(JBossThread.java:122) [jboss-threads-2.0.0.GA-redhat-1.jar:2.0.0.GA-redhat-1]

          Caused by: java.lang.NullPointerException

            at com.sun.faces.config.processor.NavigationConfigProcessor.addNavigationCasesForRule(Unknown Source) [jsf-impl-1.2.15.b01-redhat-12.jar:1.2.15.b01-redhat-12]

            at com.sun.faces.config.processor.NavigationConfigProcessor.addNavigationRules(Unknown Source) [jsf-impl-1.2.15.b01-redhat-12.jar:1.2.15.b01-redhat-12]

            at com.sun.faces.config.processor.NavigationConfigProcessor.process(Unknown Source) [jsf-impl-1.2.15.b01-redhat-12.jar:1.2.15.b01-redhat-12]

            at com.sun.faces.config.processor.AbstractConfigProcessor.invokeNext(Unknown Source) [jsf-impl-1.2.15.b01-redhat-12.jar:1.2.15.b01-redhat-12]

            at com.sun.faces.config.processor.RenderKitConfigProcessor.process(Unknown Source) [jsf-impl-1.2.15.b01-redhat-12.jar:1.2.15.b01-redhat-12]

            at com.sun.faces.config.processor.AbstractConfigProcessor.invokeNext(Unknown Source) [jsf-impl-1.2.15.b01-redhat-12.jar:1.2.15.b01-redhat-12]

            at com.sun.faces.config.processor.ManagedBeanConfigProcessor.process(Unknown Source) [jsf-impl-1.2.15.b01-redhat-12.jar:1.2.15.b01-redhat-12]

            at com.sun.faces.config.processor.AbstractConfigProcessor.invokeNext(Unknown Source) [jsf-impl-1.2.15.b01-redhat-12.jar:1.2.15.b01-redhat-12]

            at com.sun.faces.config.processor.ValidatorConfigProcessor.process(Unknown Source) [jsf-impl-1.2.15.b01-redhat-12.jar:1.2.15.b01-redhat-12]

            at com.sun.faces.config.processor.AbstractConfigProcessor.invokeNext(Unknown Source) [jsf-impl-1.2.15.b01-redhat-12.jar:1.2.15.b01-redhat-12]

            at com.sun.faces.config.processor.ConverterConfigProcessor.process(Unknown Source) [jsf-impl-1.2.15.b01-redhat-12.jar:1.2.15.b01-redhat-12]

            at com.sun.faces.config.processor.AbstractConfigProcessor.invokeNext(Unknown Source) [jsf-impl-1.2.15.b01-redhat-12.jar:1.2.15.b01-redhat-12]

            at com.sun.faces.config.processor.ComponentConfigProcessor.process(Unknown Source) [jsf-impl-1.2.15.b01-redhat-12.jar:1.2.15.b01-redhat-12]

            at com.sun.faces.config.processor.AbstractConfigProcessor.invokeNext(Unknown Source) [jsf-impl-1.2.15.b01-redhat-12.jar:1.2.15.b01-redhat-12]

            at com.sun.faces.config.processor.ApplicationConfigProcessor.process(Unknown Source) [jsf-impl-1.2.15.b01-redhat-12.jar:1.2.15.b01-redhat-12]

            at com.sun.faces.config.processor.AbstractConfigProcessor.invokeNext(Unknown Source) [jsf-impl-1.2.15.b01-redhat-12.jar:1.2.15.b01-redhat-12]

            at com.sun.faces.config.processor.LifecycleConfigProcessor.process(Unknown Source) [jsf-impl-1.2.15.b01-redhat-12.jar:1.2.15.b01-redhat-12]

            at com.sun.faces.config.processor.AbstractConfigProcessor.invokeNext(Unknown Source) [jsf-impl-1.2.15.b01-redhat-12.jar:1.2.15.b01-redhat-12]

            at com.sun.faces.config.processor.FactoryConfigProcessor.process(Unknown Source) [jsf-impl-1.2.15.b01-redhat-12.jar:1.2.15.b01-redhat-12]

            ... 14 more

           

          Ich benutze die folgdende JAR jsf-impl-1.2.15.b01-redhat-12.jar. Habe ich auch die zugehörende sources jar jsf-impl-1.2.15.b01-redhat-12-sources.jar heruntergeladen

          eigentlich sie werden beide bei der Runtime angezeigt.

          Sollten sie in der WEB-INF/lib Ordner gesetzt werden?

           

          Ich habe in eclipse ein Breakpoint gesetzt in NavigationConfigProcessor bei addNavigationRules. Bei Debug starten des Servers, wird es dort aber nicht angehalten.

           

          Ich habe alle jsp Seiten, die bei den Navigationsrelegn in faces-config stehen durchgecheckt, sie sind alle vorhanden. Also ich habe gar keine Idee was fehlt.

           

          Ich bedanke mich für die Antwort.

          • 3. Re: jsf 1.2 and jboss 6.2 java.lang.InstantiationException: org.jboss.as.weld.webtier.jsf.WeldApplicationFactory
            mayerw01

            The parameter WAR_BUNDLES_JSF_IMPL is, and always has been, an unsupported feature WAR_BUNDLES_JSF_IMPL does not work for EAR files.  Hello World code attached.

            But this parameter indicates that JBoss should use the JSF implementation instead which is packaged inside your WAR [WFLY-1785] WAR_BUNDLES_JSF_IMPL does not work for EAR files - JBoss Issue Tracker

            If you are using Maven for bundling your WAR you should add a dependency entry into your pom.

            • 4. Re: jsf 1.2 and jboss 6.2 java.lang.InstantiationException: org.jboss.as.weld.webtier.jsf.WeldApplicationFactory
              binko.georgiev.binev

              Thanks for the answer.

               

              I have passed these problems and successfully deployed.

               

              At the moment I am trying a JSF problem. the Jasper parser complains that it cannot parse a value from an EL expression because the method is a void type.


              org.apache.jasper.JasperException: /chooselocale.jsp(15,3) JBWEB004192: A literal value was specified for attribute actionListener that is defined as a deferred method with a return type of void. JSP.2.3.4 does not permit literal values in this case.

               

              I solved this through removing the actionListener parameter from the bookstore:map tag and adding an f:actionListener tag with the corresponding binding.

               

              <bookstore:map id="worldMap"
              current="NAmericas"
              immediate="true"
              action="bookstore">
              <f:actionListener binding="#{localeBean.chooseLocaleFromMap }"/>
              <%--actionListener="#{localeBean.chooseLocaleFromMap}"> --%>

               

              It works. Still I do not know wheteher this is the right way.

              All I do is just rying to run the bookstore example that is in the JavaEE5 examples. I had no problems with glassfish in NetBeans , but I am applying for a job and they use JBoss and eclipse. with JavaEE5, JSF and RichFaces.

               

              My last projects have been in Spring with vaadin, so I just want to refresh my knowledge of the above mentioned technologies.

               

              Thankyou very much for your kind answers. and sorry for answering before in German.

              • 5. Re: jsf 1.2 and jboss 6.2 java.lang.InstantiationException: org.jboss.as.weld.webtier.jsf.WeldApplicationFactory
                mayerw01

                I could reproduce this problem (even on wildfly-10.0.0.CR4). So I guess this is special on how the Jasper JSP engine handles this.

                • 6. Re: jsf 1.2 and jboss 6.2 java.lang.InstantiationException: org.jboss.as.weld.webtier.jsf.WeldApplicationFactory
                  binko.georgiev.binev

                  I got now the problem that components are not recognized as managed beans, but as Strings.

                   

                  THis is in the chooseLocale.jsp page

                   

                  <bookstore:area id="NAmerica"

                    value="#{NA }"

                    onmouseover="/template/world_namer.jpg"

                    onmouseout="/template/world.jpg"

                    targetImage="mapImage"/>

                   

                  and NA is registered as a managed bean in the faces-config.xml

                   

                  <managed-bean>

                      <description>

                        Causes the default VariableResolver implementation to instantiate the

                        managed bean, NA of the class, components.model.ImageArea in application

                        scope if the bean does not already exist in any scope and initialize the

                        shape, alt, and coords properties with the values specified by the

                        managed-property elements.

                      </description>

                      <managed-bean-name>NA</managed-bean-name>

                      <managed-bean-class>com.sun.bookstore6.model.ImageArea </managed-bean-class>

                      <managed-bean-scope>application </managed-bean-scope>

                      <managed-property>

                        <description>

                          Initializes the shape property of the managed bean, NA with the value,

                          poly.

                        </description>

                        <property-name>shape</property-name>

                        <value>poly</value>

                      </managed-property>

                      <managed-property>

                        <description>

                          Initializes the alt property of the managed bean, NA with the value,

                          NAmerica.

                        </description>

                        <property-name>alt</property-name>

                        <value>NAmerica</value>

                      </managed-property>

                      <managed-property>

                        <description>

                          Initializes the coords property of the managed bean, NA with the value

                          specified by the value element.

                        </description>

                        <property-name>coords</property-name>

                        <value>

                          53,109,1,110,2,167,19,168,52,149,67,164,67,165,68,167,70,168,72,170,74,172,75,174,77,175,79,177,81,179,80,179,77,179,81,179,81,178,80,178,82,211,28,238,15,233,15,242,31,252,36,247,36,246,32,239,89,209,92,216,93,216,100,216,103,218,113,217,116,224,124,221,128,230,163,234,185,189,178,177,162,188,143,173,79,173,73,163,79,157,64,142,54,139,53,109

                        </value>

                      </managed-property>

                    </managed-bean>