2 Replies Latest reply on Aug 27, 2012 11:42 AM by Jose Alvarez de Lara

    Error occured, while using JSF 2.1+RichFaces 4.2.2+JBoss 7.1.1

    Sabarinath Selvaraj Newbie

      Web.xml

       

       

      <?xml version="1.0"?>

      <web-app version="2.5"

                      xmlns="http://java.sun.com/xml/ns/javaee"

                      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                      xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

      <display-name>Greeter</display-name>

       

      <context-param>

         <param-name>javax.faces.STATE_SAVING_METHOD</param-name>

         <param-value>server</param-value>

      </context-param>

       

      <context-param>

         <param-name>org.richfaces.SKIN</param-name>

         <param-value>blueSky</param-value>

      </context-param>

       

      <context-param>

            <param-name>org.richfaces.CONTROL_SKINNING</param-name>

            <param-value>enable</param-value>

      </context-param>

       

      <filter>

         <display-name>RichFaces Filter</display-name>

         <filter-name>richfaces</filter-name>

         <filter-class>org.ajax4jsf.Filter</filter-class>

      </filter>

       

      <filter-mapping>

         <filter-name>richfaces</filter-name>

         <servlet-name>Faces Servlet</servlet-name>

         <dispatcher>REQUEST</dispatcher>

         <dispatcher>FORWARD</dispatcher>

         <dispatcher>INCLUDE</dispatcher>

      </filter-mapping>

       

      <listener>

         <listener-class>com.sun.faces.config.ConfigureListener</listener-class>

      </listener>

       

      <!-- Faces Servlet -->

      <servlet>

         <servlet-name>Faces Servlet</servlet-name>

         <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>

         <load-on-startup>1</load-on-startup>

      </servlet>

       

      <!-- Faces Servlet Mapping -->

      <servlet-mapping>

         <servlet-name>Faces Servlet</servlet-name>

         <url-pattern>*.jsf</url-pattern>

      </servlet-mapping>
      <servlet-mapping>

         <servlet-name>Faces Servlet</servlet-name>

         <url-pattern>*.xhtml</url-pattern>

      </servlet-mapping>

       

      <login-config>

         <auth-method>BASIC</auth-method>

         </login-config>
        
         <welcome-file-list>
      <welcome-file>
                index.html
            </welcome-file>
          </welcome-file-list>

      </web-app>

       

       

       

      faces-config.xml

       

      <?xml version='1.0' encoding='UTF-8'?>

      <faces-config version="2.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xi="http://www.w3.org/2001/XInclude"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd">

       

       

         <managed-bean>

            <description>UsernName Bean</description>

            <managed-bean-name>user</managed-bean-name>

            <managed-bean-class>demo.user</managed-bean-class>

            <managed-bean-scope>request</managed-bean-scope>

            <managed-property>

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

               <property-class>java.lang.String</property-class>

               <value/>

            </managed-property>

         </managed-bean>

      </faces-config>

       

       

      index.html

       

      <html>
      <head>
      <meta content="text/html; charset=UTF-8" http-equiv="content-type" />
      <meta http-equiv="refresh" content="0; url=result.jsf" />
      </head>

      <body>
      </body>
      </html>

       

      Included jar's

       

      under WEB-INF/lib folder:

       

      ajax4jsf-1.0.6.jar

      commons-beanutils-1.7.0.jar

      commons-collections-3.2.jar

      commons-digester-1.8.jar

      jhighlight-1.0.jar

      jsf-api.jar

      jsf-facelets.jar

      jsf-impl.jar

      oscache-2.4.jar

       

      under D:\jboss\jboss-as-7.1.1.Final\modules\com\richfaces\main

       

      richfaces-components-api-4.2.2.Final.jar

      richfaces-components-ui-4.2.2.Final.jar

      richfaces-core-api-4.2.2.Final.jar

      richfaces-core-impl-4.2.2.Final.jar

       

      module.xml

       

      <module xmlns="urn:jboss:module:1.1" name="com.richfaces">

          <resources>

              <resource-root path="richfaces-components-api-4.2.2.Final.jar"/>

              <resource-root path="richfaces-components-ui-4.2.2.Final.jar"/>

              <resource-root path="richfaces-core-api-4.2.2.Final.jar"/>

              <resource-root path="richfaces-core-impl-4.2.2.Final.jar"/>

              <!-- Insert resources here -->

          </resources>

          <dependencies>

            <module name="org.w3c.css.sac"/>

            <module name="net.sourceforge.cssparser"/>

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

            <module name="javax.api"/>

            <module name="javax.faces.api"/>

            <module name="javax.xml.bind.api"/>

            <module name="javax.xml.jaxp-provider"/>

            <module name="com.google.guava"/>

          </dependencies>

      </module>

       

       

      Error:

       

      11:49:26,641 SEVERE [javax.enterprise.resource.webcontainer.jsf.config] (MSC service thread 1-8) Critical error during deployment: : com.sun.faces.config.ConfigurationException: CONFIGURATION FAI
      LED! Must have a Constructor that takes in a ComponentConfig
              at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:376) [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$Worker.runTask(ThreadPoolExecutor.java:885) [rt.jar:1.6.0_06]
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) [rt.jar:1.6.0_06]
              at java.lang.Thread.run(Thread.java:619) [rt.jar:1.6.0_06]
      Caused by: javax.faces.view.facelets.FaceletException: Must have a Constructor that takes in a ComponentConfig
              at com.sun.faces.facelets.tag.AbstractTagLibrary$UserComponentHandlerFactory.<init>(AbstractTagLibrary.java:295) [jsf-impl-2.1.7-jbossorg-2.jar:]
              at com.sun.faces.facelets.tag.AbstractTagLibrary.addComponent(AbstractTagLibrary.java:525) [jsf-impl-2.1.7-jbossorg-2.jar:]
              at com.sun.faces.facelets.tag.TagLibraryImpl.putComponent(TagLibraryImpl.java:115) [jsf-impl-2.1.7-jbossorg-2.jar:]
              at com.sun.faces.config.processor.FaceletTaglibConfigProcessor.processComponent(FaceletTaglibConfigProcessor.java:569) [jsf-impl-2.1.7-jbossorg-2.jar:]
              at com.sun.faces.config.processor.FaceletTaglibConfigProcessor.processTags(FaceletTaglibConfigProcessor.java:361) [jsf-impl-2.1.7-jbossorg-2.jar:]
              at com.sun.faces.config.processor.FaceletTaglibConfigProcessor.processTagLibrary(FaceletTaglibConfigProcessor.java:314) [jsf-impl-2.1.7-jbossorg-2.jar:]
              at com.sun.faces.config.processor.FaceletTaglibConfigProcessor.process(FaceletTaglibConfigProcessor.java:263) [jsf-impl-2.1.7-jbossorg-2.jar:]
              at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:363) [jsf-impl-2.1.7-jbossorg-2.jar:]
              ... 9 more
      Caused by: java.lang.NoSuchMethodException: org.ajax4jsf.tag.AjaxSupportHandler.<init>(javax.faces.view.facelets.ComponentConfig)
              at java.lang.Class.getConstructor0(Class.java:2706) [rt.jar:1.6.0_06]
              at java.lang.Class.getConstructor(Class.java:1657) [rt.jar:1.6.0_06]
              at com.sun.faces.facelets.tag.AbstractTagLibrary$UserComponentHandlerFactory.<init>(AbstractTagLibrary.java:293) [jsf-impl-2.1.7-jbossorg-2.jar:]
              ... 16 more

      11:49:26,750 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/RichFacesExample]] (MSC service thread 1-8) Exception sending context initialized event to listener instanc
      e of class com.sun.faces.config.ConfigureListener: java.lang.RuntimeException: com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! Must have a Constructor that takes in a Component
      Config
              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$Worker.runTask(ThreadPoolExecutor.java:885) [rt.jar:1.6.0_06]
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) [rt.jar:1.6.0_06]
              at java.lang.Thread.run(Thread.java:619) [rt.jar:1.6.0_06]
      Caused by: com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! Must have a Constructor that takes in a ComponentConfig
              at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:376) [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.view.facelets.FaceletException: Must have a Constructor that takes in a ComponentConfig
              at com.sun.faces.facelets.tag.AbstractTagLibrary$UserComponentHandlerFactory.<init>(AbstractTagLibrary.java:295) [jsf-impl-2.1.7-jbossorg-2.jar:]
              at com.sun.faces.facelets.tag.AbstractTagLibrary.addComponent(AbstractTagLibrary.java:525) [jsf-impl-2.1.7-jbossorg-2.jar:]
              at com.sun.faces.facelets.tag.TagLibraryImpl.putComponent(TagLibraryImpl.java:115) [jsf-impl-2.1.7-jbossorg-2.jar:]
              at com.sun.faces.config.processor.FaceletTaglibConfigProcessor.processComponent(FaceletTaglibConfigProcessor.java:569) [jsf-impl-2.1.7-jbossorg-2.jar:]
              at com.sun.faces.config.processor.FaceletTaglibConfigProcessor.processTags(FaceletTaglibConfigProcessor.java:361) [jsf-impl-2.1.7-jbossorg-2.jar:]
              at com.sun.faces.config.processor.FaceletTaglibConfigProcessor.processTagLibrary(FaceletTaglibConfigProcessor.java:314) [jsf-impl-2.1.7-jbossorg-2.jar:]
              at com.sun.faces.config.processor.FaceletTaglibConfigProcessor.process(FaceletTaglibConfigProcessor.java:263) [jsf-impl-2.1.7-jbossorg-2.jar:]
              at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:363) [jsf-impl-2.1.7-jbossorg-2.jar:]
              ... 9 more
      Caused by: java.lang.NoSuchMethodException: org.ajax4jsf.tag.AjaxSupportHandler.<init>(javax.faces.view.facelets.ComponentConfig)
              at java.lang.Class.getConstructor0(Class.java:2706) [rt.jar:1.6.0_06]
              at java.lang.Class.getConstructor(Class.java:1657) [rt.jar:1.6.0_06]
              at com.sun.faces.facelets.tag.AbstractTagLibrary$UserComponentHandlerFactory.<init>(AbstractTagLibrary.java:293) [jsf-impl-2.1.7-jbossorg-2.jar:]
              ... 16 more

      11:49:26,859 ERROR [org.apache.catalina.core.StandardContext] (MSC service thread 1-8) Error listenerStart
      11:49:26,859 ERROR [org.apache.catalina.core.StandardContext] (MSC service thread 1-8) Context [/RichFacesExample] startup failed due to previous errors
      11:49:26,875 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 f
      ind backup.
      11:49:26,875 SEVERE [javax.enterprise.resource.webcontainer.jsf.config] (MSC service thread 1-8) Unexpected exception when attempting to tear down the Mojarra runtime: java.lang.IllegalStateExcep
      tion: 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$Worker.runTask(ThreadPoolExecutor.java:885) [rt.jar:1.6.0_06]
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) [rt.jar:1.6.0_06]
              at java.lang.Thread.run(Thread.java:619) [rt.jar:1.6.0_06]

      11:49:26,937 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-8) MSC00001: Failed to start service jboss.web.deployment.default-host./RichFacesExample: org.jboss.msc.service.StartExceptio
      n in service jboss.web.deployment.default-host./RichFacesExample: 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$Worker.runTask(ThreadPoolExecutor.java:885) [rt.jar:1.6.0_06]
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) [rt.jar:1.6.0_06]
              at java.lang.Thread.run(Thread.java:619) [rt.jar:1.6.0_06]

      11:49:26,953 INFO  [org.jboss.as] (MSC service thread 1-5) JBAS015951: Admin console listening on http://127.0.0.1:9990
      11:49:26,968 ERROR [org.jboss.as] (MSC service thread 1-5) JBAS015875: JBoss AS 7.1.1.Final "Brontes" started (with errors) in 5772ms - Started 343 of 427 services (4 services failed or missing d
      ependencies, 78 services are passive or on-demand)
      11:49:27,171 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS015870: Deploy of deployment "RichFacesExample.war" was rolled back with failure message {"JBAS014671: Failed services
      " => {"jboss.web.deployment.default-host./RichFacesExample" => "org.jboss.msc.service.StartException in service jboss.web.deployment.default-host./RichFacesExample: JBAS018040: Failed to start co
      ntext"}}
      11:49:27,187 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-6) JBAS015877: Stopped deployment RichFacesExample.war in 25ms
      11:49:27,187 INFO  [org.jboss.as.controller] (DeploymentScanner-threads - 2) JBAS014774: Service status report
      JBAS014777:   Services which failed to start:      service jboss.web.deployment.default-host./RichFacesExample: org.jboss.msc.service.StartException in service jboss.web.deployment.default-host./
      RichFacesExample: JBAS018040: Failed to start context

      11:49:27,202 ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) {"JBAS014653: Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2
      " => {"JBAS014671: Failed services" => {"jboss.web.deployment.default-host./RichFacesExample" => "org.jboss.msc.service.StartException in service jboss.web.deployment.default-host./RichFacesExamp
      le: JBAS018040: Failed to start context"}}}}

        • 1. Re: Error occured, while using JSF 2.1+RichFaces 4.2.2+JBoss 7.1.1
          Lukáš Fryč Master

          Heya,

           

          you might want to follow the instructions from this JIRA (or rather the linked Forum reference):

          https://issues.jboss.org/browse/RF-12008

           

          Please vote on the issue if you want to have the JBoss AS module packaged with RF distribution by default.

          • 2. Re: Error occured, while using JSF 2.1+RichFaces 4.2.2+JBoss 7.1.1
            Jose Alvarez de Lara Novice

            Hello,

             

            Try the following,

             

            web.xml.-

             

            <?xml version="1.0" encoding="UTF-8" standalone="no"?>
            <web-app xmlns="http://java.sun.com/xml/ns/javaee"
                     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                     version="3.0"
                     xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
              <display-name>richfaces-hello</display-name>
              <session-config>
                <session-timeout>30</session-timeout>
              </session-config>
                <context-param>
                    <param-name>org.richfaces.fileUpload.maxRequestSize</param-name>
                    <param-value>100000</param-value>
                </context-param>
                <context-param>
                    <param-name>org.richfaces.fileUpload.createTempFiles</param-name>
                    <param-value>false</param-value>
                </context-param>
                <context-param>
                    <param-name>javax.faces.PROJECT_STAGE</param-name>
                    <param-value>Development</param-value>
                </context-param>
                <context-param>
                    <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
                    <param-value>server</param-value>
                </context-param>
                <context-param>
                  <param-name>javax.faces.SKIP_COMMENTS</param-name>
                  <param-value>true</param-value>
                </context-param>
                <servlet>
                    <servlet-name>Faces Servlet</servlet-name>
                    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
                    <load-on-startup>1</load-on-startup>
                </servlet>
                <servlet-mapping>
                    <servlet-name>Faces Servlet</servlet-name>
                    <url-pattern>*.jsf</url-pattern>
                </servlet-mapping>
                <servlet-mapping>
                    <servlet-name>Faces Servlet</servlet-name>
                    <url-pattern>/faces/*</url-pattern>
                </servlet-mapping>
                <welcome-file-list>
                  <welcome-file>index.html</welcome-file>
                </welcome-file-list>
            </web-app>
            

             

            User.java.-

             

            import javax.faces.bean.ManagedBean;
            import javax.faces.bean.RequestScoped;
            
            @RequestScoped
            @ManagedBean(name="user")
            public class User {
            
               private String name="";
            
               public String getName() {
                  return name;
               }
            
               public void setName(String name) {
                  this.name = name;
               }
            }
            

             

            As you can see you do not need to declare anything in the faces-config.xml. This class is enough.

             

            demo.xhtml.-

             

            <?xml version='1.0' encoding='UTF-8' ?>
            <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
            <ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:a4j="http://richfaces.org/a4j"
                xmlns:rich="http://richfaces.org/rich"
                template="/WEB-INF/layout/pageTemplate.xhtml">
            
                <ui:param name="pageTitle" value="Welcome to Forge Demo" />
            
                <ui:define name="header">
                    Welcome to Forge
                </ui:define>
            
                <ui:define name="main">
                    <p>
                      <rich:panel header="RichFaces Greeter" style="width: 315px; height: 150px">
                          <h:form>
                            <h:panelGrid columns="3">
                                <h:outputText value="Name:" />
                                <h:inputText value="#{user.name}" />
                                <a4j:commandButton value="Get greeting" render="out" execute="@form" />
                            </h:panelGrid>
                          </h:form>
                          <br />
                          <a4j:outputPanel id="out">
                            <h:outputText value="Hello #{user.name} !"
                                rendered="#{not empty user.name}" />
                          </a4j:outputPanel>
                      </rich:panel>
                    </p>
                    <p style="text-align: right; padding-top: 50px">
                        <a target="_blank" href="http://jboss.org"><h:graphicImage
                            value="/img/jboss-community.png" 
                            alt="JBoss and JBoss Community" width="254" height="31" border="0" />
                        </a> <br /> To replace this page edit 'src/main/webapp/index.xhtml', or
                        keep Forging!
                    </p>
                </ui:define>
            
            </ui:composition>
            

             

            Build it as it is your template.xhtml

             

            index.html.-

             

            <meta http-equiv="refresh" content="0;url=./faces/index.xhtml" />
            

             

            this is enough

             

            And of course set your your module.xml as it is explained in previous post,

            I mean https://issues.jboss.org/browse/RF-12008.

            I have created it for richfaces-4.2.2.Final and all my richfaces webapp work fine.

             

            Kind regards,

            jose