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 2012/02/23 13:16:25 UTC
DO NOT REPLY [Bug 52746] New: Classloader closed in middle of webapp
deployment
https://issues.apache.org/bugzilla/show_bug.cgi?id=52746
Bug #: 52746
Summary: Classloader closed in middle of webapp deployment
Product: Tomcat 7
Version: 7.0.16
Platform: PC
OS/Version: Linux
Status: NEW
Severity: regression
Priority: P2
Component: Catalina
AssignedTo: dev@tomcat.apache.org
ReportedBy: freds@jfrog.org
Classification: Unclassified
We have an application were all the jars reside in the shared (or common)
classloader of Tomcat, and then we are starting multiple webapp using the
common jars.
This setup works good with Java 1.6 and 1.7 on Tomcat 7.0.14.
When using Tomcat 7.0.16-19-22 and 26 (the 4 versions I tested), on both JVM,
we are getting the following for a random number of webapps (4 out of 11 always
deploys, 7 fails) on a single tomcat instance.
So, we tried to debug when, who, why the “java.util.zip.InflaterInputStream”
was closed before the web application finished loading the resources and
classes.
In debug mode with a breaking point on
“java.util.zip.InflaterInputStream#close” of course the bug does not happens :(
We tested with JDK 1.7.0_01 and 1.6.0_20, on Tomcat 7.0.16, 7.0.19, 7.0.22,
7.0.26. On all configurations we got the issue.
This error appears on all kind of resources from the jar (xml, properties,
classes, …), during a tomcat call to
"javax.servlet.ServletContextListener#contextInitialized".
For java 7 we got:
Caused by: org.springframework.beans.factory.BeanDefinitionStoreException:
IOException parsing XML document from class path resource
[META-INF/spring/addons.xml]; nested exception is java.io.IOException: Stream
closed
at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:408)
[spring-beans-3.0.6.RELEASE.jar:3.0.6.RELEASE]
at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
[spring-beans-3.0.6.RELEASE.jar:3.0.6.RELEASE]
at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
[spring-beans-3.0.6.RELEASE.jar:3.0.6.RELEASE]
at
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
[spring-beans-3.0.6.RELEASE.jar:3.0.6.RELEASE]
at
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
[spring-beans-3.0.6.RELEASE.jar:3.0.6.RELEASE]
at
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)
[spring-beans-3.0.6.RELEASE.jar:3.0.6.RELEASE]
at
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:212)
[spring-beans-3.0.6.RELEASE.jar:3.0.6.RELEASE]
at
org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:126)
[spring-context-3.0.6.RELEASE.jar:3.0.6.RELEASE]
at
org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:92)
[spring-context-3.0.6.RELEASE.jar:3.0.6.RELEASE]
at
org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)
[spring-context-3.0.6.RELEASE.jar:3.0.6.RELEASE]
at
org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:467)
[spring-context-3.0.6.RELEASE.jar:3.0.6.RELEASE]
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:397)
[spring-context-3.0.6.RELEASE.jar:3.0.6.RELEASE]
Caused by: java.io.IOException: Stream closed
at
java.util.zip.InflaterInputStream.ensureOpen(InflaterInputStream.java:67)
[na:1.7.0_01]
at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:121)
[na:1.7.0_01]
at java.io.FilterInputStream.read(FilterInputStream.java:83) [na:1.7.0_01]
at
com.sun.org.apache.xerces.internal.impl.XMLEntityManager$RewindableInputStream.read(XMLEntityManager.java:2905)
[na:1.7.0_01]
at
com.sun.org.apache.xerces.internal.impl.XMLEntityManager$RewindableInputStream.read(XMLEntityManager.java:2937)
[na:1.7.0_01]
at
com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.read(UTF8Reader.java:302)
[na:1.7.0_01]
at
com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.load(XMLEntityScanner.java:1750)
[na:1.7.0_01]
at
com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.scanLiteral(XMLEntityScanner.java:1071)
[na:1.7.0_01]
at
com.sun.org.apache.xerces.internal.impl.XMLScanner.scanPseudoAttribute(XMLScanner.java:590)
[na:1.7.0_01]
at
com.sun.org.apache.xerces.internal.impl.XMLScanner.scanXMLDeclOrTextDecl(XMLScanner.java:407)
[na:1.7.0_01]
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanXMLDeclOrTextDecl(XMLDocumentFragmentScannerImpl.java:913)
[na:1.7.0_01]
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$XMLDeclDriver.next(XMLDocumentScannerImpl.java:775)
[na:1.7.0_01]
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:607)
[na:1.7.0_01]
at
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:116)
[na:1.7.0_01]
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:430)
[na:1.7.0_01]
at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:835)
[na:1.7.0_01]
at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
[na:1.7.0_01]
at
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:123)
[na:1.7.0_01]
at
com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:240)
[na:1.7.0_01]
at
com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:300)
[na:1.7.0_01]
at
org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:75)
[spring-beans-3.0.6.RELEASE.jar:3.0.6.RELEASE]
at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:388)
[spring-beans-3.0.6.RELEASE.jar:3.0.6.RELEASE]
... 20 common frames omitted
For Java 6 we got:
Caused by: java.util.zip.ZipException: ZipFile closed
at java.util.zip.ZipFile.ensureOpenOrZipException(ZipFile.java:413)
[na:1.6.0_20]
at java.util.zip.ZipFile.access$1100(ZipFile.java:29) [na:1.6.0_20]
at java.util.zip.ZipFile$ZipFileInputStream.read(ZipFile.java:445)
[na:1.6.0_20]
at java.util.zip.ZipFile$1.fill(ZipFile.java:230) [na:1.6.0_20]
at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:141)
[na:1.6.0_20]
at java.io.FilterInputStream.read(FilterInputStream.java:116)
[na:1.6.0_20]
at org.springframework.asm.ClassReader.a(Unknown Source)
[spring-asm-3.0.6.RELEASE.jar:3.0.6.RELEASE]
at org.springframework.asm.ClassReader.<init>(Unknown Source)
[spring-asm-3.0.6.RELEASE.jar:3.0.6.RELEASE]
at
org.springframework.core.type.classreading.SimpleMetadataReader.<init>(SimpleMetadataReader.java:48)
[spring-core-3.0.6.RELEASE.jar:3.0.6.RELEASE]
at
org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:80)
[spring-core-3.0.6.RELEASE.jar:3.0.6.RELEASE]
at
org.springframework.core.type.classreading.CachingMetadataReaderFactory.getMetadataReader(CachingMetadataReaderFactory.java:101)
[spring-core-3.0.6.RELEASE.jar:3.0.6.RELEASE]
at
org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:76)
[spring-core-3.0.6.RELEASE.jar:3.0.6.RELEASE]
at
org.springframework.core.type.filter.AbstractTypeHierarchyTraversingFilter.match(AbstractTypeHierarchyTraversingFilter.java:105)
[spring-core-3.0.6.RELEASE.jar:3.0.6.RELEASE]
at
org.springframework.core.type.filter.AbstractTypeHierarchyTraversingFilter.match(AbstractTypeHierarchyTraversingFilter.java:76)
[spring-core-3.0.6.RELEASE.jar:3.0.6.RELEASE]
at
org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.isCandidateComponent(ClassPathScanningCandidateComponentProvider.java:280)
[spring-context-3.0.6.RELEASE.jar:3.0.6.RELEASE]
at
org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.findCandidateComponents(ClassPathScanningCandidateComponentProvider.java:214)
[spring-context-3.0.6.RELEASE.jar:3.0.6.RELEASE]
... 29 common frames omitted
We saw that the GC finalizer is closing the zip on finalize. Playing with
“-XX:+UseConcMarkSweepGC -XX:+UseParNewGC” has no effect.
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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 52746] Classloader closed in middle of webapp deployment
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52746
Konstantin Kolinko <kn...@gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|INVALID |DUPLICATE
--- Comment #3 from Konstantin Kolinko <kn...@gmail.com> ---
Marking as DUPLICATE of bug 53225.
*** This bug has been marked as a duplicate of bug 53225 ***
--
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
DO NOT REPLY [Bug 52746] Classloader closed in middle of webapp
deployment
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52746
Mark Thomas <ma...@apache.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |INVALID
--- Comment #1 from Mark Thomas <ma...@apache.org> 2012-03-07 10:51:52 UTC ---
I don't see any Tomcat code in those stack traces therefore it is hard to see
how this could be a Tomcat issue.
Tomcat did change the it's own JAR scanning code between 7.0.14 and 7.0.16 but
since that runs before any application code, it is hard to see how that may
impact the application. I did double check it ensure all JARS and InputStreams
that are opened are closed and I didn't see any gaps.
Absent any evidence that points to a Tomcat issue then there isn't much that
can be done.
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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 52746] Classloader closed in middle of webapp deployment
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52746
Bug 52746 depends on bug 53225, which changed state.
Bug 53225 Summary: IllegalStateException "zip file closed" with resource from webfragment jar if JreMemoryLeakPreventionListener is removed
https://issues.apache.org/bugzilla/show_bug.cgi?id=53225
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |FIXED
--
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
DO NOT REPLY [Bug 52746] Classloader closed in middle of webapp
deployment
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52746
Fred Simon <fr...@jfrog.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |freds@jfrog.org
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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 52746] Classloader closed in middle of webapp deployment
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52746
--- Comment #2 from Igor Mihalik <ig...@gmail.com> ---
There's a workaround for this issue to use:
<Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener"
urlCacheProtection="true"/>
which is used by default in default server.xml configuration file, but if you
removed the listener completely you can encounter this problem. It is very
likely it was introduced by this improvement:
https://issues.apache.org/bugzilla/show_bug.cgi?id=51276
svn revision: r1130497
--
You are receiving this mail because:
You are the assignee for the bug.
[Bug 52746] Classloader closed in middle of webapp deployment
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52746
Rainer Jung <ra...@kippdata.de> changed:
What |Removed |Added
----------------------------------------------------------------------------
Depends on| |53225
--
You are receiving this mail because:
You are the assignee for the bug.
[Bug 52746] Classloader closed in middle of webapp deployment
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52746
Igor Mihalik <ig...@gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |igor.mihalik@gmail.com
--
You are receiving this mail because:
You are the assignee for the bug.