tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Remy Maucherat <r...@apache.org>
Subject Re: tomcat-5.0.5 cannot access jar resources in WEB-INF/lib but o nly unzipped in WEB-INF/classes
Date Tue, 05 Aug 2003 17:35:58 GMT
Harmsen, Jan wrote:

> Remy Maucherat wrote:
> 
>>Any update on this ? This is obviously a big problem if the issue is 
>>valid, so I'd really appreciate your help.
>>
> 
> 
> Hi Remy,
> 
> I set up a test case and it looks like it's a Tomcat-5 problem.
> The webapp works on Tomcat-4.1, on Tomcat-5.0 the resources within
> xsd.resources.jar cannot be reached.
> 
> 
> tested environment: Win2k Prof, SuSE Linux 8.2
> 
> Log Win2k:
> ####################################
> 05.08.2003 18:10:32 org.apache.catalina.core.StandardHostDeployer install
> INFO: Installing web application at context path /xsd-testcase from URL
> file://C:/Programs/eclipse/workspace/xsdTestCase/build
> Wrapped exception
> java.io.FileNotFoundException:
> C:\ApacheGroup\jakarta-tomcat-5.0.5\work\Catalina\localhost
> \xsd-testcase\loader\org\eclipse\xsd\cache\www.w3.org\2001\MagicXMLSchema.xs
> d (The system cannot find the path specified)
> 	at java.io.FileInputStream.open(Native Method)
> 	at java.io.FileInputStream.<init>(Unknown Source)
> #####################################
> 
> 
> Log SuSE Linux 8.2
> ####################################
> Aug 5, 2003 5:52:47 PM org.apache.catalina.core.StandardHostDeployer install
> INFO: Installing web application at context path /xsdtestcase
> from URL file:/home/jan/eclipse/XSDTestcase/build
> Wrapped exception
> java.io.FileNotFoundException:
> /opt/jakarta-tomcat-5.0/work/Catalina/localhost
> /xsdtestcase/loader/org/eclipse/xsd/cache/www.w3.org/2001/MagicXMLSchema.xsd
> (No such file or directory)
> 	at java.io.FileInputStream.open(Native Method)
> 	at java.io.FileInputStream.<init>(FileInputStream.java:103)
> ####################################
> 
> The webapp is here:
> http://tamino.demozone.softwareag.com/xsdTestCaseWebApp.zip
> 
> The JavaDoc for the relevant classes is here:
> 
> Eclipse EMF:
> http://dev.eclipse.org/viewcvs/indextools.cgi/%7Echeckout%7E/emf-home/docs/j
> avadoc/index.html
> Eclipse XSD:
> http://dev.eclipse.org/viewcvs/indextech.cgi/~checkout~/xsd-home/docs/javado
> c/index.html
> 
> This is how the URI to the xsd resource in xsd.resources.jar is created
> (from XSDSchemaImpl.java):
> 
>           String baseURL = XSDPlugin.INSTANCE.getBaseURL().toString();
>  
> getGlobalResourceSet().getLoadOptions().put("XSD_MAGIC_XML_SCHEMA",
> XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001);
>           Resource magicSchemaForSchema2001Resource = 
>             getGlobalResourceSet().getResource
>               (URI.createURI(baseURL +
> "cache/www.w3.org/2001/MagicXMLSchema.xsd"), true);

Thanks and I'll investigate. This seems invalid to me, though (they 
can't use a base URL, and expect the CL to have a "straight" 
organization of the classes). I've switched to a different mechanism in 
5.0 to avoid careless accesses to resources which are inside JARs, which 
cause resource leaks (and seem to be exactly what Eclips seems to like 
doing). You have to load CL resources through CL.getResource or 
CL.getResourceAsStream.

As a workaround, I belive you could try extracting your classes to 
/WEB-INF/classes.

Remy



Mime
View raw message