tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jim Rudnicki <jdr5l...@pacbell.net>
Subject [PATCH] null repositories in adaptive class loader
Date Thu, 03 Aug 2000 08:19:13 GMT
When accessing a servlet with a spelling error I noticed 505 internal
servlet errors / null pointers instead of
the expected 404 error.  I tracked it to a null repository in the
AdaptiveClassLoader.  At
Enumeration repEnum = repository.elements();
a NullPointerException gets thrown.

This small patch fixes such that the call to loadClass, skips enumerating
the null array, falls through to the end, and finding nothing, then throws
the ClassNotFoundException that produces the desired 404.

Jim

===================================================================
RCS file:
/home/cvspublic/jakarta-tomcat/src/share/org/apache/tomcat/loader/AdaptiveCl
assLoader.java,v
retrieving revision 1.11
diff -r1.11 AdaptiveClassLoader.java
491c491,492
<         // Try to load it from each repository
---
>   /* If there is one, try to load it from each repository */
>  if( null != repository ) {
542,543c543,545
<         }
<
---
>         } // wend repEnum.hasMoreElements()
>  }
>




Mime
View raw message