2 Replies Latest reply on Mar 6, 2008 10:50 AM by Kurt De Wit

    Integrated stylesheets not working properly.

    Kurt De Wit Newbie

      Hello,

      I have some strange behaviour using RichFaces.
      Currently I am using RichFaces 3.1.4 together with JBoss 4.2.2.
      I have developped an EAR containing EJB logic (EJB3) and 3 WAR files.
      Each WAR is bundled with the RichFaces distributables. I also want to use a custom CSS together with the integrated styles.

      Below a code snippet from one of the WARs:

      <f:view>
       <a4j:loadStyle src="/css/main.css"/>
       <h:form>
       <rich:panel header="Beheer controlelijsten"
       headerClass="window_title"
       styleClass="window_full">
      
       <%-- Main working area--%>
       <h:panelGrid columns="2"
       styleClass="full_size"
       columnClasses="quarter_width, three_quart_width">
       <rich:panel header="Navigatie"
       headerClass="window_header"
       styleClass="panel_navigation">
       <%-- Navigation tree --%>
       <rich:tree value="#{inventoryHandler.checklistData}"
       var="data"
       nodeFace="#{data.type}"
       switchType="client"
       ajaxSubmitSelection="true">
      
       <%-- Basic Node --%>
       <rich:treeNode type="BasicData">
       <h:outputText value="#{data.displayableData}" />
       <rich:contextMenu attached="true">
       <rich:menuItem value="Test1" />
       <rich:menuItem value="Test2" />
       </rich:contextMenu>
       </rich:treeNode>....


      Perhaps this is wrong? I don't know for sure since I'm very new to RichFaces. My custom CSS is loaded properly, but when I want to activate the context menu associated with tree nodes, their layout is completely messed up.
      When I start my application by invoking the URL, I receive the following error message in my server output.

      org.ajax4jsf.resource.ResourceNotFoundException: Static resource not found for path org.richfaces.renderkit.html.images.MenuNodeImage
      at org.ajax4jsf.resource.ResourceBuilderImpl.createStaticResource(ResourceBuilderImpl.java:450)
      at org.ajax4jsf.resource.ResourceBuilderImpl.createResource(ResourceBuilderImpl.java:255)
      at org.ajax4jsf.renderkit.RendererBase.getResource(RendererBase.java:152)
      at org.ajax4jsf.renderkit.compiler.ResourceElement.findResource(ResourceElement.java:93)
      at org.ajax4jsf.renderkit.compiler.ResourceElement.getString(ResourceElement.java:81)
      at org.ajax4jsf.renderkit.compiler.ClassElement.getString(ClassElement.java:94)
      at org.ajax4jsf.renderkit.compiler.ClassElement.encode(ClassElement.java:59)
      at org.ajax4jsf.renderkit.compiler.ElementBase.encode(ElementBase.java:105)
      at org.ajax4jsf.renderkit.compiler.ElementBase.encode(ElementBase.java:105)
      at org.ajax4jsf.renderkit.compiler.RootElement.encode(RootElement.java:64)
      at org.ajax4jsf.renderkit.compiler.ElementBase.encode(ElementBase.java:73)
      at org.ajax4jsf.resource.TemplateCSSRenderer.send(TemplateCSSRenderer.java:91)
      at org.ajax4jsf.resource.InternetResourceBase.send(InternetResourceBase.java:373)
      at org.ajax4jsf.resource.ResourceLifecycle.sendResource(ResourceLifecycle.java:223)
      at org.ajax4jsf.resource.ResourceLifecycle.send(ResourceLifecycle.java:148)
      at org.ajax4jsf.resource.InternetResourceService.load(InternetResourceService.java:336)
      at org.ajax4jsf.cache.LRUMapCache.load(LRUMapCache.java:116)
      at org.ajax4jsf.cache.LRUMapCache.get(LRUMapCache.java:87)
      at org.ajax4jsf.resource.InternetResourceService.serviceResource(InternetResourceService.java:198)
      at org.ajax4jsf.resource.InternetResourceService.serviceResource(InternetResourceService.java:144)
      at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:265)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
      at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
      at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
      at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
      at java.lang.Thread.run(Thread.java:595)


      I read a lot of issues concerning CTRL+F5 but this does not solve anything.
      A stand-alone WAR, containing the same web.xml as the WAR's contained in the EAR-file and containing the same libraries works properly in the same application server. The only difference that exists is the a4j:loadStyleand the fact that my larger application is distributed as an EAR.

      Did anyone experience the same behaviour using RichFaces?
      Did anyone found a solution, because I really like the component library and am looking forward to use it.

      Kind regards and thanks in advance for any response,
      Kurt


        • 1. Re: Integrated stylesheets not working properly.
          Kurt De Wit Newbie

          It seems to be a classloading issue. What I tried to do is copy the RichFaces JAR's distributed with the installation to the servers lib folder AND package them together with your WAR file.

          Up till now, this has solved the issues I have been experiencing lately.
          Hopefully this solves the problem, otherwise, I'll be back...


          Cheers,
          Kurt

          • 2. Re: Integrated stylesheets not working properly.
            Kurt De Wit Newbie

            Further on my previous post.

            I know it sounds rather strange and a bit dangerous to have the same libraries distributed at 2 different locations within your JBoss application server. There seems to be a need for the container itself to have access to the RichFaces libraries as well, and not only the web application.
            So be careful when upgrading to a newer version, and because of this, scoped deployment to isolate different versions from each other might cause some unexpected behaviour as well...

            Is there a better solution to put the RichFaces libraries at another location than the server lib folder and not in the WAR WEB-INF\lib folder?

            Any suggestions for a more appropriate solution are therefor welcome because I'm expecting difficulties with larger configurations running multiple applications inside the same application server in different versions of RichFaces...

            Cheers,
            Kurt