tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Remy Maucherat <r...@apache.org>
Subject Re: [5] Unable to initialize TldLocationsCache: zip file closed
Date Wed, 08 Oct 2003 06:17:53 GMT
Tim Funk wrote:
> Quick summary:
> 
> In o.a.jasper.xmlparserParserUtils.java, line 129 is
> DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
> 
> Does anyone know how DocumentBuilderFactory.newInstance() can throw 
> "java.lang.IllegalStateException: zip file closed"?
> 
> ====================
> More detail
> ====================
> Tomcat 5.0.13
> Windows java 1.3.1_07 - All ok
> HPUX - java 1.3.1.01 - I get the follow error during either the jsp 
> compile or the webapp init (not sure which yet)
> 
> The error reported back to the web browser is ...
> org.apache.jasper.JasperException: Unable to initialize 
> TldLocationsCache: zip file closed
>     at 
> org.apache.jasper.compiler.TldLocationsCache.init(TldLocationsCache.java:211) 
> 
>     at 
> org.apache.jasper.compiler.TldLocationsCache.getLocation(TldLocationsCache.java:181)

> 
> 
> 
> Where the "fun" begins are the real stack traces. I added an extra 
> log.info() to TldLocationsCache to get the root stack trace because only 
> the message is being displayed and I get this as my stack trace ...
> 
> [INFO] TldLocationsCache - -during init 
> <java.lang.IllegalStateException: zip file 
> closed>java.lang.IllegalStateException: zip file closed
>     at java.util.zip.ZipFile.getEntry(Unknown Source)
>     at java.util.jar.JarFile.getEntry(Unknown Source)
>     at sun.net.www.protocol.jar.URLJarFile.getEntry(URLJarFile.java:76)
>     at 
> sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:96)
>     at 
> sun.net.www.protocol.jar.JarURLConnection.getInputStream(JarURLConnection.java:108) 
> 
>     at java.net.URL.openStream(Unknown Source)
>     at 
> org.apache.catalina.loader.StandardClassLoader.getResourceAsStream(StandardClassLoader.java:714)

> 
>     at 
> org.apache.catalina.loader.StandardClassLoader.getResourceAsStream(StandardClassLoader.java:696)

> 
>     at 
> org.apache.catalina.loader.WebappClassLoader.getResourceAsStream(WebappClassLoader.java:1184)

> 
>     at javax.xml.parsers.SecuritySupport12$4.run(Unknown Source)
>     at java.security.AccessController.doPrivileged(Native Method)
>     at javax.xml.parsers.SecuritySupport12.getResourceAsStream(Unknown 
> Source)
>     at javax.xml.parsers.FactoryFinder.findJarServiceProvider(Unknown 
> Source)
>     at javax.xml.parsers.FactoryFinder.find(Unknown Source)
>     at javax.xml.parsers.DocumentBuilderFactory.newInstance(Unknown Source)
>     at 
> org.apache.jasper.xmlparser.ParserUtils.parseXMLDocument(ParserUtils.java:129) 
> 
>     at 
> org.apache.jasper.compiler.TldLocationsCache.processWebDotXml(TldLocationsCache.java:232)

> 
>     at 
> org.apache.jasper.compiler.TldLocationsCache.init(TldLocationsCache.java:
> ======
> 
> 
> Does anyone know how DocumentBuilderFactory.newInstance() can throw the 
> exception? (on a static initializer)
> 
> Or is the solution just as simple as updating the JDK to a later 1.3? 
> (Unfortunatly a non-trivial effort)

This happens when attempting to open a JAR from common/lib (or 
common/endorsed). This code hasn't changed for a long while.
However, this CL (since it loads stuff which doesn't need to be updated) 
opens the URL without setting caches to false (BTW, whay isn't there a 
$%%$#%#%$#%$ global setting for this ???).

I never got this error before. Maybe we should set the caches to false 
in StdCL.getResourceAsStream ? Does that fix it in your case ?

Remy


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message