tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 52746] New: Classloader closed in middle of webapp deployment
Date Thu, 23 Feb 2012 12:16:25 GMT
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


Mime
View raw message