You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Paul Russell <pa...@luminas.co.uk> on 2000/08/07 21:35:28 UTC
[PATCH] Re: [C2] problem with getResource on Tomcat and JRun.
Hi all,
Murphys law. Found the problem almost immediately after
sending this. I *think* the semantics of getResource and
getSystemResource may have changed in JDK1.3. Calling
getResource on the class rather than the classloader,
and making sure the resource has a forward slash as its
first character appears to fix the problem. Someone wanna
check this works on a non-1.3 vm?
Patch follows:
Index: src/org/apache/cocoon/util/IOUtils.java
===================================================================
RCS file: /home/cvspublic/xml-cocoon/src/org/apache/cocoon/util/Attic/IOUtils.java,v
retrieving revision 1.1.2.3
diff -r1.1.2.3 IOUtils.java
52,53c52,53
< return IOUtils.class.getClassLoader().getSystemResource(
< location.substring("resource://".length())
---
> return IOUtils.class.getResource(
> "/" + location.substring("resource://".length())
--
Paul Russell <pa...@luminas.co.uk>
Technical Director, http://www.luminas.co.uk
Luminas Ltd.