You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2016/11/24 02:58:46 UTC

[Bug 60410] New: Stream closed when reading war entry

https://bz.apache.org/bugzilla/show_bug.cgi?id=60410

            Bug ID: 60410
           Summary: Stream closed when reading war entry
           Product: Tomcat 8
           Version: 8.0.33
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: critical
          Priority: P2
         Component: Catalina
          Assignee: dev@tomcat.apache.org
          Reporter: guoh0115@gmail.com
  Target Milestone: ----

When the application is deployed as "unpackWAR=false", sometimes I try to
download a js file which is over than 2MB, ERR_CONTENT_LENGTH_MISMATCH will be
thrown on the front end, I use Chrome.

I checked accesslog and found the file's content length is less than it is when
the exception thrown.

Here's the stacktrace I found in the log file:

java.io.IOException: Stream closed
         at
java.util.zip.InflaterInputStream.ensureOpen(InflaterInputStream.java:67)
         at
java.util.zip.InflaterInputStream.read(InflaterInputStream.java:142)
         at
org.apache.catalina.webresources.AbstractArchiveResource$JarInputStreamWrapper.read(AbstractArchiveResource.java:255)
         at java.io.BufferedInputStream.read1(BufferedInputStream.java:273)
         at java.io.BufferedInputStream.read(BufferedInputStream.java:334)
         at java.io.FilterInputStream.read(FilterInputStream.java:107)
         at
org.apache.catalina.servlets.DefaultServlet.copyRange(DefaultServlet.java:2125)
         at
org.apache.catalina.servlets.DefaultServlet.copy(DefaultServlet.java:1971)
         at
org.apache.catalina.servlets.DefaultServlet.serveResource(DefaultServlet.java:968)
        at
org.apache.catalina.servlets.DefaultServlet.doGet(DefaultServlet.java:398)

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 60410] Stream closed when reading war entry

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60410

--- Comment #1 from Violeta Georgieva <vi...@apache.org> ---
Hi,

Can you test with the latest Tomcat 8 version (8.0.39)?
Can you provide a simple example that reproduces the issue?
Do you see this problem with other browsers?


Thanks,
Violeta

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 60410] Stream closed when reading war entry

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60410

--- Comment #3 from guoh0115@gmail.com ---
I only changed unpackWARs to false in server.xml.

 <Host name="localhost"  appBase="webapps"
            unpackWARs="false" autoDeploy="true">

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 60410] Stream closed when reading war entry

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60410

--- Comment #6 from Mark Thomas <ma...@apache.org> ---
I've found the likely cause. If close is called multiple times on a
JarInputStreamWrapper then it is possible that this error could occur. I should
have a fix for this shortly.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 60410] Stream closed when reading war entry

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60410

--- Comment #8 from guoh0115@gmail.com ---
When will it be released?

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 60410] Stream closed when reading war entry

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60410

--- Comment #2 from guoh0115@gmail.com ---
I usually take about 5-10s to download the js file, and the more time it took,
the easier the error occured.

I cannot deploy on tomcat 8.0.39, here's the error log, do you have any idea?

org.apache.catalina.startup.ContextConfig.processServletContainerInitializers
Failed to detect ServletContainerInitializers for context with name [/imsp]
 java.io.FileNotFoundException: JAR entry
!/META-INF/services/javax.servlet.ServletContainerInitializer not found in
D:\apache-tomcat-8.0.39\temp\jar_cache4125440539893731259.tmp
        at
sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:140)
        at
sun.net.www.protocol.jar.JarURLConnection.getInputStream(JarURLConnection.java:150)
        at java.net.URL.openStream(URL.java:1037)
        at
org.apache.catalina.startup.WebappServiceLoader.parseConfigFile(WebappServiceLoader.java:162)
        at
org.apache.catalina.startup.WebappServiceLoader.load(WebappServiceLoader.java:136)
        at
org.apache.catalina.startup.ContextConfig.processServletContainerInitializers(ContextConfig.java:1631)
        at
org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1140)
        at
org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:783)
        at
org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:307)
        at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:95)
        at
org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
        at
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5213)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
        at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:753)
        at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:729)
        at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
        at
org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:940)
        at
org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1816)
        at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
        at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:744)

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 60410] Stream closed when reading war entry

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60410

Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #7 from Mark Thomas <ma...@apache.org> ---
Fixed in:
- trunk for 9.0.0.M14 onwards
- 8.5.x for 8.5.9 onwards
- 8.0.x for 8.0.40 onwards

7.0.x and earlier was not affected.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 60410] Stream closed when reading war entry

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60410

--- Comment #4 from guoh0115@gmail.com ---
I debuged, spring-web-4.2.5.RELEASE.jar is in our app. so tomcat cannot load
/META-INF/services/javax.servlet.ServletContainerInitializer from the jar file
when unpackWAR=false

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 60410] Stream closed when reading war entry

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60410

--- Comment #9 from Natalia <na...@gmail.com> ---
Is there any workaround if using Tomcat 8.0.39 and unpackWars=false?

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 60410] Stream closed when reading war entry

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60410

--- Comment #5 from Mark Thomas <ma...@apache.org> ---
I've fixed the issue that prevents SCIs from being processed with 8.0.39. The
fix will be in 8.0.40 onwards. You'll need to build 8.0.x from source (not as
difficuly as you might think) to test it.

I'm still looking for possible causes of the original problem.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org