Uploaded image for project: 'JBoss Web'
  1. JBoss Web
  2. JBWEB-189

Problem in web fragment when loading static file of size > 250Kb

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: JBossWeb-3.0.0.Beta2, JBossWeb-3.0.0.Beta3, JBossWeb-3.0.0.Beta4, JBossWeb-3.0.0.Beta5, JBossWeb-3.0.0.Beta6, JBossWeb-3.0.0.Beta7
    • Fix Version/s: JBossWeb-7.0.0.Beta1
    • Component/s: Tomcat
    • Environment:

      Description

      When a war contains a jar with a web fragment, the server don't serve static files that have a size more than 250 Kb.
      If in the web fragment we define a servlet mapping with the type of the file to the default servlet, then the file is served only every other time.

      This is totally reproductible.

      Attached are two war files, containing only a web-fragment in a jar. The web fragment only contains static files.
      The first war contains a plain web fragment, when the second one contains a web fragment that defines servlet mapping to the default servlet:
      <servlet-mapping>
      <servlet-name>default</servlet-name>
      <url-pattern>*.html</url-pattern>
      </servlet-mapping>
      <servlet-mapping>
      <servlet-name>default</servlet-name>
      <url-pattern>*.txt</url-pattern>
      </servlet-mapping>
      <servlet-mapping>
      <servlet-name>default</servlet-name>
      <url-pattern>*.js</url-pattern>
      </servlet-mapping>

      Both web fragments contains the same files, but with different file extensions (html, txt, of js). Half of them are just under the 250 Kb limit (filesmall), half of them are just after (filebig).
      filesmall and filebig files contains the same thing ("lorem ipsum"), just a bit more in filebig.

      Just download either any JBoss AS 6.0 from milestone M2 (until M5) or JBoss Web 3.0 Beta 2, without changing anything in the config, and put the two war files in the default deploy folder.

      The file to test are :

      http://localhost:8080/testcaseone/filesmall.html
      http://localhost:8080/testcaseone/filebig.html
      http://localhost:8080/testcaseone/filesmall.txt
      http://localhost:8080/testcaseone/filebig.txt
      http://localhost:8080/testcaseone/filesmall.js
      http://localhost:8080/testcaseone/filebig.js

      http://localhost:8080/testcasetwo/filesmall.html
      http://localhost:8080/testcasetwo/filebig.html
      http://localhost:8080/testcasetwo/filesmall.txt
      http://localhost:8080/testcasetwo/filebig.txt
      http://localhost:8080/testcasetwo/filesmall.js
      http://localhost:8080/testcasetwo/filebig.js

      All "filesmall.*" files are served without any problem, even if you reload the page.
      All "testcaseone/filebig.*" files are NOT served, even if the page is reloaded.
      All 'testcasetwo/filebig.*" files are served only every other time: click reload several time and you will see.

      Here is a sample of the log when the file is correctly served:
      2010-11-04 14:30:16,345 INFO [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/testcaseone]] (http-127.0.0.1-8080-1) default: DefaultServlet.serveResource: Serving resource '/filesmall.html' headers and data
      2010-11-04 14:30:16,345 INFO [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/testcaseone]] (http-127.0.0.1-8080-1) default: DefaultServlet.serveFile: contentType='text/html'
      2010-11-04 14:30:16,345 INFO [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/testcaseone]] (http-127.0.0.1-8080-1) default: DefaultServlet.serveFile: contentLength=246887

      Here is a sample of the log when the file is NOT correctly served:
      2010-11-04 14:30:25,464 INFO [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/testcaseone]] (http-127.0.0.1-8080-1) default: DefaultServlet.serveResource: Serving resource '/filebig.html' headers and data
      (and nothing more, nothing from DefaultServlet.serveFile

      It should also be noted that the problem doesn't appears in tomcat 7.0.2 or later.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                rmaucher Remy Maucherat
                Reporter:
                funkychris_ Christophe Bouthier
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: