Uploaded image for project: 'Jetspeed 2 (Retired)'
  1. Jetspeed 2 (Retired)
  2. JS2-406

CotentServer can not set attribute "org.apache.jetspeed.content.filtered" because of FileNotFoundException

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 2.0-M4
    • 2.0-FINAL
    • ContentServer
    • None
    • JDK 1.4.2_10, WinXP SP2

    Description

      There is a bug about contentfilter.
      1. Login j2 as a portal user(admin).
      2. Click the CSS Demo page.
      3. Click the CSS portlet maximize windown icon.(a java.lang.IllegalStateException had been logged in jetspeed.log)
      4. Click the default-page.psml.
      5. The following is the displayed in browser.

      javax.servlet.ServletException: Fatal error encountered while processing portal request: org.apache.jetspeed.pipeline.PipelineException: org.apache.jetspeed.pipeline.PipelineException: org.apache.jetspeed.pipeline.PipelineException
      : org.apache.jetspeed.pipeline.PipelineException: java.lang.IllegalStateException: You cannot invoke getRenderedContent() until the content has been set.
      org.apache.jetspeed.engine.JetspeedServlet.doGet(JetspeedServlet.java
      :235)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

      6. The current browser can not view j2 anymore.

      The cause of this is a FileNotFoundException throw in ContentFilter. The following is the detail:
      1. The css-demo.psml use blue-gradient as its portlet-decorator. The following lines are from blue-gradient's css file

      .blue-gradient .portlet-msg-status {
      background: url(content/tigris/images/icon_status_sml.gif);
      background-repeat: no-repeat;
      padding-left: 20px;
      min-height: 15px;
      }

      The above gif file could never be found according to the current content list paths.

      2. A FileNotFoundException will be thrown out when browser try to request for these gif files at the following code:

      SimpleContentLocator contentLocator = new SimpleContentLocator(this.contentDir, urlHints, useCache, httpRequest .getContextPath(), requestURI, getContentSearchPathes(httpRequest));

      so the following code could never be called:

      httpRequest.setAttribute("org.apache.jetspeed.content.filtered", "true");

      3. This will lead to when browser request a *.gif file, the jetspeed pipeline get called and then a java.lang.IllegalStateException got fired.

      A quick fix is moved the line "httpRequest.setAttribute("org.apache.jetspeed.content.filtered", "true");" before creating SimpleContentLocator.

      I also notice that JS2-398 might fix this issue gracefully too, then just ignore me.

      Attachments

        1. ContentFilter.diff
          1 kB
          Jian Liao

        Activity

          People

            Unassigned Unassigned
            norwaywoods Jian Liao
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: