5 Replies Latest reply on Apr 2, 2013 9:38 AM by Radim Hanus

    My RichFaces components don't render in any browser

    Jonathan Pinto Sperafico Newbie

      Hi everyone,

      Today I would like to ask you some help one more time.

       

      The problem is: RichFaces components doesn't render properly in any browser.

       

      I create a JSF Project with JBoss Web Tools in Eclipse and add the required libraries

      insine my lib folder. My standalone.xml is basicly default. I had no error on my console

      output and my files are the following:

       

       

      My output:
      
      16:09:49,986 INFO  [org.jboss.modules] JBoss Modules version 1.1.1.GA
      16:09:50,229 INFO  [org.jboss.msc] JBoss MSC version 1.0.2.GA
      16:09:50,274 INFO  [org.jboss.as] JBAS015899: JBoss AS 7.1.1.Final "Brontes" starting
      16:09:51,125 INFO  [org.xnio] XNIO Version 3.0.3.GA
      16:09:51,125 INFO  [org.jboss.as.server] JBAS015888: Creating http management service using socket-binding (management-http)
      16:09:51,125 INFO  [org.xnio.nio] XNIO NIO Implementation Version 3.0.3.GA
      16:09:51,140 INFO  [org.jboss.remoting] JBoss Remoting version 3.2.3.GA
      16:09:51,170 INFO  [org.jboss.as.logging] JBAS011502: Removing bootstrap log handlers
      16:09:51,216 INFO  [org.jboss.as.configadmin] (ServerService Thread Pool -- 26) JBAS016200: Activating ConfigAdmin Subsystem
      16:09:51,246 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 31) JBAS010280: Activating Infinispan subsystem.
      16:09:51,246 INFO  [org.jboss.as.webservices] (ServerService Thread Pool -- 48) JBAS015537: Activating WebServices Extension
      16:09:51,246 INFO  [org.jboss.as.security] (ServerService Thread Pool -- 44) JBAS013101: Activating Security Subsystem
      16:09:51,261 INFO  [org.jboss.as.osgi] (ServerService Thread Pool -- 39) JBAS011940: Activating OSGi Subsystem
      16:09:51,276 INFO  [org.jboss.as.security] (MSC service thread 1-3) JBAS013100: Current PicketBox version=4.0.7.Final
      16:09:51,292 INFO  [org.jboss.as.naming] (ServerService Thread Pool -- 38) JBAS011800: Activating Naming Subsystem
      16:09:51,322 INFO  [org.jboss.as.connector] (MSC service thread 1-1) JBAS010408: Starting JCA Subsystem (JBoss IronJacamar 1.0.9.Final)
      16:09:51,367 INFO  [org.jboss.as.naming] (MSC service thread 1-1) JBAS011802: Starting Naming Service
      16:09:51,383 INFO  [org.jboss.as.mail.extension] (MSC service thread 1-3) JBAS015400: Bound mail session [java:jboss/mail/Default]
      16:09:51,580 INFO  [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-3) Starting Coyote HTTP/1.1 on http--0.0.0.0-8080
      16:09:51,732 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 27) JBAS010403: Deploying JDBC-compliant driver class com.microsoft.sqlserver.jdbc.SQLServerDriver (version 4.0)
      16:09:51,868 INFO  [org.jboss.ws.common.management.AbstractServerConfig] (MSC service thread 1-2) JBoss Web Services - Stack CXF Server 4.0.2.GA
      16:09:51,990 INFO  [org.jboss.as.server.deployment.scanner] (MSC service thread 1-1) JBAS015012: Started FileSystemDeploymentService for directory E:\APP\Apache\jboss-as-7.1.1.Final\standalone\deployments
      16:09:51,990 INFO  [org.jboss.as.remoting] (MSC service thread 1-2) JBAS017100: Listening on localhost/127.0.0.1:9999
      16:09:52,005 INFO  [org.jboss.as.remoting] (MSC service thread 1-1) JBAS017100: Listening on /0.0.0.0:4447
      16:09:52,051 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-3) JBAS010400: Bound data source [java:/SQLServer2008/XXXXXXXX]
      16:09:52,051 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-3) JBAS010400: Bound data source [java:/SQLServer2008/XXXXXXX]
      16:09:52,051 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-3) JBAS010400: Bound data source [java:/SQLServer2008/XXXXXXXXXX]
      16:09:52,051 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-2) JBAS010400: Bound data source [java:/SQLServer2008/XXXXXXXXXXX]
      16:09:52,051 INFO  [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) JBAS015003: Found XXXXXXXXXXXXXXX.ear in deployment directory. To trigger deployment create a file called XXXXXXXXXXX.ear.dodeploy
      16:09:52,187 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015876: Starting deployment of "XXXXXXXXXXXXXX.ear"
      16:09:52,293 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2) JBAS015876: Starting deployment of "XXXXXXXXXXXXXXX.war"
      16:09:52,293 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-4) JBAS015876: Starting deployment of "XXXXXXXXXXXXXXXX.jar"
      16:09:52,688 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-4) JBAS015893: Encountered invalid class name 'com.sun.faces.vendor.Tomcat6InjectionProvider:org.apache.catalina.util.DefaultAnnotationProcessor' for service type 'com.sun.faces.spi.injectionprovider'
      16:09:52,703 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-4) JBAS015893: Encountered invalid class name 'com.sun.faces.vendor.Jetty6InjectionProvider:org.mortbay.jetty.plus.annotation.InjectionCollection' for service type 'com.sun.faces.spi.injectionprovider'
      16:09:52,703 INFO  [org.jboss.as.jpa] (MSC service thread 1-3) JBAS011401: Read persistence.xml for XXXXXXXXXXXXXXX
      16:09:52,840 INFO  [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-3) JNDI bindings for session bean named XXXXXXXXXXXXXin deployment unit subdeployment "XXXXXXXXXXXXXXXXXX.jar" of deployment "XXXXXXXXXXXXXXXX.ear" are as follows:
      
      
                java:global/XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
                java:app/XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
                java:module/XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
                java:global/XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
                java:app/XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
                java:module/XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
                java:jboss/exported/XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
      
      
      16:09:53,265 INFO  [org.apache.catalina.core.StandardContext] (MSC service thread 1-1) The listener "com.sun.faces.config.ConfigureListener" is already configured for this context. The duplicate definition has been ignored.
      16:09:53,326 INFO  [javax.enterprise.resource.webcontainer.jsf.config] (MSC service thread 1-1) Inicializando Mojarra 2.1.7-jbossorg-1 (20120227-1401) para o contexto '/XXXXXXXXXX'
      16:09:53,341 INFO  [org.jboss.as.jpa] (MSC service thread 1-4) JBAS011402: Starting Persistence Unit Service 'XXXXXXXXX.ear/XXXXXXXXXX.jar#XXXXXXXXXXX'
      16:09:53,447 INFO  [org.hibernate.annotations.common.Version] (MSC service thread 1-4) HCANN000001: Hibernate Commons Annotations {4.0.1.Final}
      16:09:53,462 INFO  [org.hibernate.Version] (MSC service thread 1-4) HHH000412: Hibernate Core {4.0.1.Final}
      16:09:53,462 INFO  [org.hibernate.cfg.Environment] (MSC service thread 1-4) HHH000206: hibernate.properties not found
      16:09:53,477 INFO  [org.hibernate.cfg.Environment] (MSC service thread 1-4) HHH000021: Bytecode provider name : javassist
      16:09:53,493 INFO  [org.hibernate.ejb.Ejb3Configuration] (MSC service thread 1-4) HHH000204: Processing PersistenceUnitInfo [
                name: XXXXXXXXXXX
                ...]
      16:09:54,221 INFO  [org.hibernate.validator.util.Version] (MSC service thread 1-1) Hibernate Validator 4.2.0.Final
      16:09:54,464 INFO  [org.hibernate.service.jdbc.connections.internal.ConnectionProviderInitiator] (MSC service thread 1-4) HHH000130: Instantiating explicit connection provider: org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider
      16:09:54,813 INFO  [org.jboss.web] (MSC service thread 1-1) JBAS018210: Registering web context: /XXXXXXXXXX
      16:09:54,965 INFO  [org.hibernate.dialect.Dialect] (MSC service thread 1-4) HHH000400: Using dialect: org.hibernate.dialect.SQLServerDialect
      16:09:54,980 INFO  [org.hibernate.engine.transaction.internal.TransactionFactoryInitiator] (MSC service thread 1-4) HHH000268: Transaction strategy: org.hibernate.engine.transaction.internal.jta.CMTTransactionFactory
      16:09:54,980 INFO  [org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory] (MSC service thread 1-4) HHH000397: Using ASTQueryTranslatorFactory
      16:09:56,240 INFO  [org.jboss.as] (MSC service thread 1-3) JBAS015951: Admin console listening on http://127.0.0.1:9990
      16:09:56,240 INFO  [org.jboss.as] (MSC service thread 1-3) JBAS015874: JBoss AS 7.1.1.Final "Brontes" started in 6527ms - Started 489 of 574 services (81 services are passive or on-demand)
      16:09:56,620 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS018559: Deployed "XXXXXXXXXXX.ear"
      
      

       

       

      Directory: WAR Project -> WebContent
      File: text.xhtml
      
      <ui:composition xmlns="http://www.w3.org/1999/xhtml"
            xmlns:ui="http://java.sun.com/jsf/facelets"
            xmlns:h="http://java.sun.com/jsf/html"
            xmlns:f="http://java.sun.com/jsf/core"
            xmlns:a4j="http://richfaces.org/a4j"
            xmlns:rich="http://richfaces.org/rich">
          <style type="text/css">
              .col1 { vertical-align:top; }
              .col2 { vertical-align:top; width:450px; }
              .wizard { width:400px; }
              .wform td { vertical-align:top; }
              .wfcol1 { text-align: right; white-space:nowrap;}
              .wfcol2 { }
              .wfcol3 { }
              .s1row td { height:30px; }
              .rich-message { color:red;  }
      
              .navPanel {
                  position:absolute;
                  bottom:0;
                  height:23px;
                  margin:0;
                  padding:2px;
              }
          </style>
          <br/>
          <h:panelGrid width="100%" columns="2" columnClasses="col1,col2">
              <a4j:keepAlive beanName="profile" />
              <rich:panel styleClass="wizard">
                  <f:facet name="header">
                  <h:outputText value="Using a4j:include for Wizard-like behaviour" />
                  </f:facet>
                  <h:form>
                      <a4j:include viewId="/wstep1.xhtml" />
                  </h:form>
              </rich:panel>
      
          </h:panelGrid>
          <br/>
      </ui:composition>
      
      

       

      Directory: WAR Project -> WebContent
      File: wstep1.xhtml
      <ui:composition xmlns="http://www.w3.org/1999/xhtml"
            xmlns:ui="http://java.sun.com/jsf/facelets"
            xmlns:h="http://java.sun.com/jsf/html"
            xmlns:f="http://java.sun.com/jsf/core"
            xmlns:a4j="http://richfaces.org/a4j"
            xmlns:rich="http://richfaces.org/rich">
      
          <div style="position:relative;height:140px">
                    <h:panelGrid rowClasses="s1row" columns="3" columnClasses="wfcol1,wfcol2,wfcol3">
                        <h:outputText value="First Name:" />
                        <h:inputText id="fn" value="" label="First Name" required="true" />
                        <rich:message  for="fn" />
      
                        <h:outputText value="Last Name:" />
                        <h:inputText  id="ln" value=""  label="Last Name"  required="true" />
                        <rich:message  for="ln" />
      
                        <h:outputText value="Company:" />
                        <h:inputText id="comp" value=""  label="Company"  required="true" />
                        <rich:message for="comp"/>
                    </h:panelGrid>
                    <div class="navPanel" style="width:100%;">
                        <a4j:commandButton style="float:right" action="next" value="Next &gt;&gt;"/>
                    </div>
          </div>
      </ui:composition>
      
      

       

       

      Directory: WAR Project -> WebContent -> META-INF
      File: web.xml
      
      <?xml version="1.0"?>
      <web-app version="3.0" 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_3_0.xsd">
       <display-name>SinediWebJSF</display-name>
       <display-name>SinediWebDynamic</display-name>
      
      
      <context-param>
      <param-name>org.richfaces.skin</param-name>
      <param-value>ruby</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>/faces/*</url-pattern>
                </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>*.faces</url-pattern>
                </servlet-mapping>
                <servlet-mapping>
                          <servlet-name>Faces Servlet</servlet-name>
                          <url-pattern>*.xhtml</url-pattern>
                </servlet-mapping>
      </web-app>
      

       

       

       

      Directory: WAR Project -> WebContent -> META-INF
      File: faces-config.xml
      
      <?xml version="1.0" encoding="UTF-8"?>
      <faces-config
          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-facesconfig_2_0.xsd"
                version="2.0">
      </faces-config>
      

       

       

       

      Directory: EAR Project -> META-INF
      File: jboss_deployment_structure.xml
      
      <jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.1">
                <deployment>
                  <dependencies>
                    <module name="org.slf4j" />
                    <module name="org.slf4j.jcl-over-slf4j" />
                    <module name="org.apache.commons.collections" />
                    <module name="javax.ejb.api" />
                    <module name="org.richfaces" />
                  </dependencies>
                </deployment>
      </jboss-deployment-structure>
      
      

       

       

       

      Directory: $JBOSS_HOME -> modules -> org -> richfaces -> main
      File: module.xml
      <?xml version="1.0" encoding="UTF-8"?>
      <module xmlns="urn:jboss:module:1.1" name="org.richfaces">
          <resources>
              <resource-root path="richfaces-core-api-4.3.0.Final.jar"/>
                          <resource-root path="richfaces-core-impl-4.3.0.Final.jar"/>
              <resource-root path="richfaces-components-api-4.3.0.Final.jar"/>
                          <resource-root path="richfaces-components-ui-4.3.0.Final.jar"/>
          </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>
      
        • 1. Re: My RichFaces components don't render in any browser
          Radim Hanus Expert

          ensure our jboss specific descriptor has name jboss-deployment-structure.xml

           

          try to define the dependency to richfaces module by this way:

          <module name="org.richfaces">

                                  <imports>

                                                 <include path="**"/>

                                  </imports>

          </module>

          • 2. Re: My RichFaces components don't render in any browser
            Jonathan Pinto Sperafico Newbie

            Hi Mr. Hanus,

             

            I really do thank you for your reply, but unfortunately it didn't work out.

             

            Here goes my new xml as you suggested:

            Directory: EAR Project -> META-INF

            Filename: jboss-deployment-structure.xml

             

            <jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.1">

                      <deployment>

                        <dependencies>

                          <module name="org.slf4j" />

                          <module name="org.slf4j.jcl-over-slf4j" />

                          <module name="org.apache.commons.collections" />

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

                          <module name="org.richfaces">

                                          <imports>

                                                    <include path="**"/>

                                          </imports>

                                </module>

                        </dependencies>

                      </deployment>

            </jboss-deployment-structure>

            • 3. Re: My RichFaces components don't render in any browser
              Radim Hanus Expert

              simply richfaces libraries are not loaded, otherwise you should see following messages in log:

              13:14:54,911 INFO  [org.richfaces.log.Cache] (MSC service thread 1-2) Selected fallback cache factory

              13:14:54,951 INFO  [org.richfaces.log.Cache] (MSC service thread 1-2) Creating LRUMap cache instance using parameters: {...}

              13:14:54,957 INFO  [org.richfaces.log.Cache] (MSC service thread 1-2) Creating LRUMap cache instance of 512 items capacity

              13:14:54,958 INFO  [org.richfaces.log.Application] (MSC service thread 1-2) RichFaces Core Implementation by JBoss by Red Hat, version v.4.2.0.Final

              remove richfaces module dependecy from jboss-dependency-structure.xml and place richfaces and accompanying libs into XXX.war/WEB-INF/libs

              • 4. Re: My RichFaces components don't render in any browser
                Jonathan Pinto Sperafico Newbie

                I really do thank you Mr Hanus!

                 

                But to I've got to download of the newer version os Richfaces,

                because the standard jboss 7.1 final release offered libs doesn't worked out.

                 

                And do you have any idea why the jboss-deployment-structure.xml

                didn't worked?

                 

                Thank you again!

                • 5. Re: My RichFaces components don't render in any browser
                  Radim Hanus Expert

                  And do you have any idea why the jboss-deployment-structure.xml

                  didn't worked?

                  I guess wrong module configuration of richfaces in $JBOSS_HOME -> modules -> org -> richfaces -> main

                   

                  Thank you again!

                  you are welcome

                  1 of 1 people found this helpful