cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Russell <p...@luminas.co.uk>
Subject [C2] problem with getResource on Tomcat and JRun.
Date Mon, 07 Aug 2000 19:10:12 GMT
Hi All,

I've been working on getting C2 running over the last few days,
and I'm hitting a problem with both Tomcat and JRun.

I should point out at this stage that the version of cocoon
I've got is fairly heavily modified, because there are a number
of places where JRun is really arsey with resources (it maps
them to /apps/appname/resources/ and you have to map that to
the right place on the disk, and we weren't using
SC.getRealPath). Although my version is modified, the problem
is outside the code I've changed (and existed before I started
making mods), so I suspect it's in CVS too. I'm totally thrown
by this one; it almost looks like a bug in tomcat and JRun, but
for two servlet containers to have an identical problem seems
very unlikely.

org.apache.cocoon.util.IOUtils.getURL(String)Ljava.net.URL
appears to be failing to find resources (specifically resource:
//org/apache/cocoon/components/language/markup/xsp/java/xsp.xsl)
under both JRun and Tomcat.

  public static URL getURL(String location)
    throws MalformedURLException
  {
    if (location.indexOf("://") < 0) {
      // Absolute file location
      File file = new File(location);

      return new URL(
        "file://" +
	getFullFilename(file).replace(File.separatorChar, '/')
      );
    } else if (location.startsWith("resource://")) {
    	System.err.println(location.substring("resource://".length()));
      return IOUtils.class.getClassLoader().getResource(
        location.substring("resource://".length())
      );
    } else {
      return new URL(location);
    }
  }

JRun uses its own classloader (allaire.jrun.servlet.JRunServletLoader),
which was my first suspect, but Tomcat is useing the default Sun
classloader (sun.misc.Launcher$AppClassLoader). I'm totally
stumped. Anyone got any ideas?

-- 
Paul Russell                               <paul@luminas.co.uk>
Technical Director,                   http://www.luminas.co.uk
Luminas Ltd.

Mime
View raw message