Re: tomcat-5.0.5 cannot access jar resources in WEB-INF/lib but o nly unzipped in WEB-INF/classes

2003-08-14 Thread Remy Maucherat
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.
I did examine the Eclipse code, and it is invalid (you must not attempt 
to access other CL controlled resources based on another URL which was 
returned by the CL).

However, I did add a workaround in the CL which makes your test case 
work, but which has a performance penalty on first access to a JAR. I 
think avoiding resource leak is more important.

Remy

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: tomcat-5.0.5 cannot access jar resources in WEB-INF/lib but o nly unzipped in WEB-INF/classes

2003-08-14 Thread Remy Maucherat
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



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: tomcat-5.0.5 cannot access jar resources in WEB-INF/lib but o nly unzipped in WEB-INF/classes

2003-08-14 Thread Harmsen, Jan

Remy Maucherat wrote:

 I did examine the Eclipse code, and it is invalid (you must 
 not attempt 
 to access other CL controlled resources based on another URL 
 which was 
 returned by the CL).

Hi Remy,

What you say sounds reasonable to me as a user of the eclipse
code, looks like the developers of eclipse emf did not think
of the problems such an access method can cause. Unfortunately
EMF is a base for other APIs like XSD ...

 However, I did add a workaround in the CL which makes your test case 
 work, but which has a performance penalty on first access to a JAR. I 
 think avoiding resource leak is more important.
 

Thanks a lot !! I agree.

Best regards,

Jan


RE: tomcat-5.0.5 cannot access jar resources in WEB-INF/lib but o nly unzipped in WEB-INF/classes

2003-08-05 Thread Harmsen, Jan

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);


Best regards,

Jan


RE: tomcat-5.0.5 cannot access jar resources in WEB-INF/lib but o nly unzipped in WEB-INF/classes

2003-08-04 Thread Harmsen, Jan
Hi Remy,

sorry for not sending you a test case, there were some high priority
tasks coming in which had to be served first. As it looks now I will
be able to set up a test case within the next 2 days.

Best regards,

Jan

 -Original Message-
 From: Remy Maucherat [mailto:[EMAIL PROTECTED]
 Sent: Saturday, August 02, 2003 7:47 PM
 To: Tomcat Developers List
 Subject: Re: tomcat-5.0.5 cannot access jar resources in 
 WEB-INF/lib but
 o nly unzipped in WEB-INF/classes
 
 
 Harmsen, Jan wrote:
 Please provide a test case along with infomation on your 
 environment.
  
  okay, tomorrow I'll provide a test case + description,
 
 Any update on this ? This is obviously a big problem if the issue is 
 valid, so I'd really appreciate your help.
 
 Thanks,
 Remy
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


Re: tomcat-5.0.5 cannot access jar resources in WEB-INF/lib but o nly unzipped in WEB-INF/classes

2003-08-02 Thread Remy Maucherat
Harmsen, Jan wrote:
Please provide a test case along with infomation on your environment.
okay, tomorrow I'll provide a test case + description,
Any update on this ? This is obviously a big problem if the issue is 
valid, so I'd really appreciate your help.

Thanks,
Remy


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: tomcat-5.0.5 cannot access jar resources in WEB-INF/lib but o nly unzipped in WEB-INF/classes

2003-07-31 Thread Harmsen, Jan
Hi,

 
 Please provide a test case along with infomation on your environment.
 

okay, tomorrow I'll provide a test case + description,

Thanks,

Jan