Return-Path: Delivered-To: apmail-jakarta-tomcat-dev-archive@apache.org Received: (qmail 47555 invoked from network); 27 Aug 2002 15:47:43 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 27 Aug 2002 15:47:43 -0000 Received: (qmail 11029 invoked by uid 97); 27 Aug 2002 15:48:07 -0000 Delivered-To: qmlist-jakarta-archive-tomcat-dev@jakarta.apache.org Received: (qmail 10971 invoked by uid 97); 27 Aug 2002 15:48:07 -0000 Mailing-List: contact tomcat-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Developers List" Reply-To: "Tomcat Developers List" Delivered-To: mailing list tomcat-dev@jakarta.apache.org Received: (qmail 10940 invoked by uid 98); 27 Aug 2002 15:48:06 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) Message-ID: From: David Oxley To: 'Tomcat Developers List' Subject: Bug in WebappClassLoader Date: Tue, 27 Aug 2002 15:45:51 +0100 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2650.21) Content-Type: multipart/mixed; boundary="----_=_NextPart_000_01C24DD8.70A45DD0" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N ------_=_NextPart_000_01C24DD8.70A45DD0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C24DD8.70A45DD0" ------_=_NextPart_001_01C24DD8.70A45DD0 Content-Type: text/plain All, There is a couple of bugs in WebappClassLoader. 1. On line 953 there is a call to findClassInternal which could throw a ClassNotFoundException that gets caught on line 979. This means that lines 963 through 973 will never get executed. i.e. Repositories added with the method AddRepository will not get searched. 2. Also URL's returned from getURL are not encoded. I have submitted a patch for these two problems, but I have not got tomcat 4 to compile yet so haven't tested the patch. Comments or flames welcome. :) Dave Dave@Staffplanner.co.uk ------_=_NextPart_001_01C24DD8.70A45DD0 Content-Type: text/html

All,

 

There is a couple of bugs in WebappClassLoader.

1. On line 953 there is a call to findClassInternal which could throw a ClassNotFoundException that gets caught on line 979. This means that lines 963 through 973 will never get executed. i.e. Repositories added with the method AddRepository will not get searched.

2. Also URL's returned from getURL are not encoded.

 

I have submitted a patch for these two problems, but I have not got tomcat 4 to compile yet so haven't tested the patch.

 

Comments or flames welcome. :)

 

Dave

Dave@Staffplanner.co.uk

------_=_NextPart_001_01C24DD8.70A45DD0-- ------_=_NextPart_000_01C24DD8.70A45DD0 Content-Type: application/octet-stream; name="WebappClassLoader.diff" Content-Disposition: attachment; filename="WebappClassLoader.diff" Index: WebappClassLoader.java =================================================================== RCS file: /home/cvspublic/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/WebappClassLoader.java,v retrieving revision 1.45 diff -r1.45 WebappClassLoader.java 76a77 > import java.net.URLEncoder; 953a955 > } catch (ClassNotFoundException cnfe) { 2043c2045 < return new URL("file:" + realFile.getPath()); --- > return new URL(URLEncoder.encode("file:" + realFile.getPath())); ------_=_NextPart_000_01C24DD8.70A45DD0 Content-Type: text/plain; charset=us-ascii -- To unsubscribe, e-mail: For additional commands, e-mail: ------_=_NextPart_000_01C24DD8.70A45DD0--