There is only one line of code that prevents it from compiling with JDK1.3.
org.apache.catalina.loader.WebappClassLoader depends on File.toURI() which does not exist on jdk1.3.
I got around this by the performing the following:
OLD CODE:
return realFile.toURI().toURL();
NEW CODE
return new URL("file:" + realFile.toURL().getPath());
My patch also has some spurious stuff because my text editor automatically strips all trailing whitespace from lines and converts tabs to spaces. The important stuff is the last 9 lines of the patch file.
-Tim
Index: WebappClassLoader.java =================================================================== RCS file: /home/cvspublic/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/loader/WebappClassLoader.java,v retrieving revision 1.13 diff -u -r1.13 WebappClassLoader.java --- WebappClassLoader.java 13 Nov 2002 00:36:25 -0000 1.13 +++ WebappClassLoader.java 3 Feb 2003 00:50:16 -0000 @@ -109,22 +109,22 @@ /** * Specialized web application class loader. * <p> - * This class loader is a full reimplementation of the + * This class loader is a full reimplementation of the * <code>URLClassLoader</code> from the JDK. It is desinged to be fully * compatible with a normal <code>URLClassLoader</code>, although its internal * behavior may be completely different. * <p> - * <strong>IMPLEMENTATION NOTE</strong> - This class loader faithfully follows - * the delegation model recommended in the specification. The system class - * loader will be queried first, then the local repositories, and only then - * delegation to the parent class loader will occur. This allows the web + * <strong>IMPLEMENTATION NOTE</strong> - This class loader faithfully follows + * the delegation model recommended in the specification. The system class + * loader will be queried first, then the local repositories, and only then + * delegation to the parent class loader will occur. This allows the web * application to override any shared class except the classes from J2SE. * Special handling is provided from the JAXP XML parser interfaces, the JNDI - * interfaces, and the classes from the servlet API, which are never loaded + * interfaces, and the classes from the servlet API, which are never loaded * from the webapp repository. * <p> - * <strong>IMPLEMENTATION NOTE</strong> - Due to limitations in Jasper - * compilation technology, any repository which contains classes from + * <strong>IMPLEMENTATION NOTE</strong> - Due to limitations in Jasper + * compilation technology, any repository which contains classes from * the servlet API will be ignored by the class loader. * <p> * <strong>IMPLEMENTATION NOTE</strong> - The class loader generates source @@ -227,9 +227,9 @@ public WebappClassLoader(ClassLoader parent) { super(new URL[0], parent); - + this.parent = getParent(); - + system = getSystemClassLoader(); securityManager = System.getSecurityManager(); @@ -670,7 +670,7 @@ /** * Return a String array of the current repositories for this class * loader. If there are no repositories, a zero-length array is - * returned.For security reason, returns a clone of the Array (since + * returned.For security reason, returns a clone of the Array (since * String are immutable). */ public String[] findRepositories() { @@ -705,7 +705,7 @@ ((ResourceAttributes) resources.getAttributes(paths[i])) .getLastModified(); if (lastModified != lastModifiedDates[i]) { - if( log.isDebugEnabled() ) + if( log.isDebugEnabled() ) log.debug(" Resource '" + paths[i] + "' was modified; Date is now: " + new java.util.Date(lastModified) + " Was: " @@ -734,7 +734,7 @@ continue; if (!name.equals(jarNames[i])) { // Missing JAR - log.info(" Additional JARs have been added : '" + log.info(" Additional JARs have been added : '" + name + "'"); return (true); } @@ -742,7 +742,7 @@ } if (enum.hasMoreElements()) { while (enum.hasMoreElements()) { - NameClassPair ncPair = + NameClassPair ncPair = (NameClassPair) enum.nextElement(); String name = ncPair.getName(); // Additional non-JAR files are allowed @@ -1388,7 +1388,7 @@ /** - * Get the lifecycle listeners associated with this lifecycle. If this + * Get the lifecycle listeners associated with this lifecycle. If this * Lifecycle has no listeners registered, a zero-length array is returned. */ public LifecycleListener[] findLifecycleListeners() { @@ -1538,7 +1538,7 @@ synchronized (this) { if (entry.loadedClass == null) { clazz = defineClass(name, entry.binaryContent, 0, - entry.binaryContent.length, + entry.binaryContent.length, codeSource); entry.loadedClass = clazz; } else { @@ -1566,10 +1566,10 @@ entry.codeBase = getURL(new File(file, path)); } catch (MalformedURLException e) { return null; - } + } return entry; } - + /** * Find specified resource in local repositories. @@ -1639,7 +1639,7 @@ int j; - long[] result2 = + long[] result2 = new long[lastModifiedDates.length + 1]; for (j = 0; j < lastModifiedDates.length; j++) { result2[j] = lastModifiedDates[j]; @@ -1724,7 +1724,7 @@ entry.binaryContent = binaryContent; - // The certificates are only available after the JarEntry + // The certificates are only available after the JarEntry // associated input stream has been fully read if (jarEntry != null) { entry.certificates = jarEntry.getCertificates(); @@ -1816,8 +1816,8 @@ protected void refreshPolicy() { try { - // The policy file may have been modified to adjust - // permissions, so we're reloading it when loading or + // The policy file may have been modified to adjust + // permissions, so we're reloading it when loading or // reloading a Context Policy policy = Policy.getPolicy(); policy.refresh(); @@ -1831,7 +1831,7 @@ /** * Filter classes. - * + * * @param name class name * @return true if the class should be filtered */ @@ -1859,12 +1859,12 @@ /** - * Validate a classname. As per SRV.9.7.2, we must restict loading of - * classes from J2SE (java.*) and classes of the servlet API + * Validate a classname. As per SRV.9.7.2, we must restict loading of + * classes from J2SE (java.*) and classes of the servlet API * (javax.servlet.*). That should enhance robustness and prevent a number * of user error (where an older version of servlet.jar would be present * in /WEB-INF/lib). - * + * * @param name class name * @return true if the name is valid */ @@ -1912,7 +1912,7 @@ log.debug(" Checking for " + name); JarEntry jarEntry = jarFile.getJarEntry(name); if (jarEntry != null) { - log.info("validateJarFile(" + jarfile + + log.info("validateJarFile(" + jarfile + ") - jar not loaded. See Servlet Spec 2.3, " + "section 9.7.2. Offending class: " + name); jarFile.close(); @@ -1954,7 +1954,7 @@ } catch (IOException e) { // Ignore } - return realFile.toURI().toURL(); + return new URL("file:" + realFile.toURL().getPath()); }
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]