3 Replies Latest reply on Jan 28, 2014 6:33 PM by bleathem

    RichFaces and embedded Jetty

    strannik

      Hi

       

      I tried to use embedded Jetty Server 9 with RichFaces application. Application started but I get the constant exceptions while loading resources:

       

      Caused by: java.lang.NullPointerException: Resource input stream is null

          at org.richfaces.resource.CachedResourceImpl.readContent(CachedResourceImpl.java:139)

          at org.richfaces.resource.CachedResourceImpl.initialize(CachedResourceImpl.java:176)

          at org.richfaces.resource.ResourceHandlerImpl.handleResourceRequest(ResourceHandlerImpl.java:173)

          at org.springframework.faces.webflow.JsfResourceRequestHandler.handleRequest(JsfResourceRequestHandler.java:45)

          at org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter.handle(HttpRequestHandlerAdapter.java:49)

          at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:925)

          at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856)

          at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:920)

       

      When application is requesting. for example, skinning.css, it gives  404 error under embedded server. Here is full url which

      is the same if use standaline Tomcat server. But under Tomcat it works fine.

      http://localhost:8080/test/org.richfaces.resources/javax.faces.resource/org.richfaces.staticResource/4.3.4.Final/PackedC…

       

      Thank you for assistance.

        • 1. Re: RichFaces and embedded Jetty
          bleathem

          Have you tried asking the same question on the Jetty forums?  If a Jetty expert can point out something we need to change in our code we are more than willing to do so.

          1 of 1 people found this helpful
          • 2. Re: RichFaces and embedded Jetty
            strannik

            Hi, Brian

             

            Thank you for the response.

            I tried to debug the issue and the problem was inside CSSOMParser.parseStyleSheet function.

            Although it parses valid and existing CSS resource the line below gives null.

             

            Object o = handler.getRoot();

             

            The difference between embedded Jetty(or maybe Jetty) and Tomcat is the following:

             

            1) Jetty returns resource as FileInputStream.

            2) Tomcat returns resource as ByteArrayInputStream.

             

            I tried to upgrade to CSSParser 0.9.13(because currently used version 0.9.5 is way old) and it resolved one issue but

            still CSSParser crashes internally.

            • 3. Re: RichFaces and embedded Jetty
              bleathem

              Sounds like a bug.  Can you file a jira with a simple (preferably maven-based) project we can use to reproduce?