7 Replies Latest reply on Mar 9, 2013 12:49 PM by Lukáš Fryč

    Richfaces 4 Not loading styles and js

    amirtharaj john Newbie

      Hi,

       

      I have done all that are given in the discussions:

       

      I am using JBoss 6 EAP server, Richfaces 4.x, JSF 2.x.

       

      Not able to get my screen render the styles.

       

      Getting  the following error while checking with developer toom in Chrome browser:

       

      GET https://shops.local.at.paysafecard.com/javax.faces.resource/richfaces.js.xhtml 404 (not found)

      GET https://shops.local.at.paysafecard.com/rfRes/panel.ecss.xhtml?db=eAG7mShzEgAFjAIg&ln=org.richfaces 404 (not found)

      .....

      .....

      etc

       

       

      Please suggest me a solution.

        • 2. Re: Richfaces 4 Not loading styles and js
          amirtharaj john Newbie

          Hi, Thanks for your reply.

           

          Should I need to have javax.faces.jar, I am not using glass fish and I am using JBoss 6 EAP. I still tried adding the jar into the deployment manually

           

          and it did not solve  the problem.

           

          The BOM entry is made in the parent POM. My POM has the following entries:

              

           

          <dependency>
                      <groupId>org.richfaces.core</groupId>
                      <artifactId>richfaces-core-impl</artifactId>
                      <scope>provided</scope>
                      <type>jar</type>
                      <version>4.2.3.Final</version>                      
                  </dependency>
                  <dependency>
                      <groupId>org.richfaces.ui</groupId>
                      <artifactId>richfaces-components-ui</artifactId>
                      <scope>provided</scope>
                      <type>jar</type>
                      <version>4.2.3.Final</version>                      
                  </dependency>
              

          Under plugin:

           

          <archive>
                                  <manifestEntries>
                                      <Dependencies>com.google.guava</Dependencies>
                                  </manifestEntries>
                              </archive>  
               

          I am trying with this simple facelet:

          <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
              "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
          <html xmlns="http://www.w3.org/1999/xhtml"
          xmlns:ui="http://java.sun.com/jsf/facelets"
          xmlns:h="http://java.sun.com/jsf/html"
          xmlns:rich="http://richfaces.org/rich"
          xmlns:f="http://java.sun.com/jsf/core" xml:lang="en" lang="en">
          <h:head>
          <title>LogIn</title>
          <style type="text/css">

          .CtaLvaM {text-align: left;
              vertical-align: middle;}
              .CtaRvaM {text-align: right;
              vertical-align: middle;}

              </style>
          <h:outputScript name="jsf.js" library="javax.faces"/>

          <h:outputScript name="jquery.js"/>
          </h:head>
          <h:body>
          <center>
            <h:outputLabel value="Authorization" styleClass="TitleNormal" />
          </center>
          <center>
            <form method="post" name="loginForm" action="j_security_check">
          <rich:panel header="Richfaces sample validation and auto-completion">
             <h:panelGrid id="panel" columns="2" border="0"
              columnClasses="CtaRvaM, CtaLvaM">
              <h:outputLabel for="j_username" value="User:" />
              <h:inputText id="j_username" name="j_username" autocomplete="off" />
              <h:outputLabel for="j_password" value="Password:" />
              <h:inputSecret id="j_password" autocomplete="off" />
             </h:panelGrid>
             <br />
             <h:commandButton type="submit" value="Login" />
          </rich:panel>
            </form>
          </center>
          </h:body>
          </html>

           

          It is displaying the components but are not rendering the styles.

          • 3. Re: Richfaces 4 Not loading styles and js
            Juraj Húska Master

            You do not need javax.faces.jar included, it is provided by EAP. The org.glassfish is just groupId of the javax.faces.jar, more specifically a groupId of reference implementation of JSF (Mojarra). You can use it on EAP as well. 

             

            Try to follow for example this pom.xml.

            https://github.com/jhuska/richfaces-sanbox/blob/master/pom.xml

             

            Just change the version of RichFaces. Do not forget on importing richfaces-bom. See the dependencies in jee6 profile.

            • 4. Re: Richfaces 4 Not loading styles and js
              Juraj Húska Master

              One more suggestion for your convenience, I am guessing that you have support for EAP, so I would like to recommend you to use https://access.redhat.com/home

              for your further questions.

              • 5. Re: Richfaces 4 Not loading styles and js
                amirtharaj john Newbie

                Hi,

                 

                I made some apache changes for allowing then URLs....now I am able to get the css loaded but  not the js....? Can you please suggest me  the reason...?

                 

                I am also checking with  the Site you pointed in the above reply for any discrepancies meanwhile......

                • 6. Re: Richfaces 4 Not loading styles and js
                  amirtharaj john Newbie

                  some progress: it gives Null pointer exception

                  HTTP Status 500 -

                  type Exception report

                  message

                  description The server encountered an internal error () that prevented it from fulfilling this request.

                  exception

                  java.lang.NullPointerException
                  org.richfaces.webapp.ResourceServlet$StaticResourceLibrary.allowServerRequest(ResourceServlet.java:215)
                  org.richfaces.webapp.ResourceServlet.handleRequestByEditorResourceServlet(ResourceServlet.java:120)
                  org.richfaces.webapp.ResourceServlet.httpService(ResourceServlet.java:109)
                  org.richfaces.webapp.ResourceServlet.service(ResourceServlet.java:105)
                  org.jboss.weld.servlet.ConversationPropagationFilter.doFilter(ConversationPropagationFilter.java:62)
                  com.psc.filter.XSSFilter.doFilter(XSSFilter.java:21)

                   

                   

                  14:05:57,939 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[shops-host].[/].[Resource Servlet]] (ajp-localhost/127.0.0.1:8009-10) Servlet.service() for servlet Resource Servlet threw exception: java.lang.NullPointerException
                  at org.richfaces.webapp.ResourceServlet$StaticResourceLibrary.allowServerRequest(ResourceServlet.java:215) [richfaces-core-impl-4.2.0.CR1.jar:4.2.0.CR1]
                  at org.richfaces.webapp.ResourceServlet.handleRequestByEditorResourceServlet(ResourceServlet.java:120) [richfaces-core-impl-4.2.0.CR1.jar:4.2.0.CR1]
                  at org.richfaces.webapp.ResourceServlet.httpService(ResourceServlet.java:109) [richfaces-core-impl-4.2.0.CR1.jar:4.2.0.CR1]
                  at org.richfaces.webapp.ResourceServlet.service(ResourceServlet.java:105) [richfaces-core-impl-4.2.0.CR1.jar:4.2.0.CR1]
                  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.16.Final-redhat-1.jar:]
                  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.16.Final-redhat-1.jar:]
                  at org.jboss.weld.servlet.ConversationPropagationFilter.doFilter(ConversationPropagationFilter.java:62) [weld-core-1.1.8.Final-redhat-1.jar:2013-02-09 00:07]
                  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.16.Final-redhat-1.jar:]
                  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.16.Final-redhat-1.jar:]
                  at com.psc.filter.XSSFilter.doFilter(XSSFilter.java:21) [ppp-web-4.0.0.0-PPP-SNAPSHOT.jar:]
                  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.16.Final-redhat-1.jar:]
                  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.16.Final-redhat-1.jar:]
                  at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.16.Final-redhat-1.jar:]
                  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.16.Final-redhat-1.jar:]
                  at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50) [jboss-as-jpa-7.1.2.Final-redhat-1.jar:7.1.2.Final-redhat-1]
                  at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153) [jboss-as-web-7.1.2.Final-redhat-1.jar:7.1.2.Final-redhat-1]
                  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) [jbossweb-7.0.16.Final-redhat-1.jar:]
                  at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.16.Final-redhat-1.jar:]
                  at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:567) [jbossweb-7.0.16.Final-redhat-1.jar:]
                  at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.16.Final-redhat-1.jar:]
                  at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368) [jbossweb-7.0.16.Final-redhat-1.jar:]
                  at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:505) [jbossweb-7.0.16.Final-redhat-1.jar:]
                  at org.apache.coyote.ajp.AjpProtocol$AjpConnectionHandler.process(AjpProtocol.java:452) [jbossweb-7.0.16.Final-redhat-1.jar:]
                  at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:931) [jbossweb-7.0.16.Final-redhat-1.jar:]
                  at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_13]

                  • 7. Re: Richfaces 4 Not loading styles and js
                    Lukáš Fryč Master

                    Hey Amirtharaj, why are you using RichFaces 4.2.0.CR1? Could you upgrade to 4.3.1.Final?