You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Ian Darwin <ia...@darwinsys.com> on 2002/06/06 04:35:21 UTC

patch: NullPointerException in jasper/src/share/org/apache/jasper/compiler/TldLocationsCache.java

After building from today's source, I was getting a nullpointerexception in
jasper/src/share/org/apache/jasper/compiler/TldLocationsCache.java
in method processJars.

While this may be "my fault" in terms of faulty build or wrong version of some API,
it seems like minimally defensive programming to check this variable for null.
My guess is it might be null if you have a Context that doesn't have a lib
subdirectory under WEB-INF (ie you have WEB-INF/classes but not /lib)?

Index: ./jasper/src/share/org/apache/jasper/compiler/TldLocationsCache.java
===================================================================
RCS file: /home/cvspublic/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/TldLocationsCache.java,v
retrieving revision 1.10
diff -u -r1.10 TldLocationsCache.java
--- ./jasper/src/share/org/apache/jasper/compiler/TldLocationsCache.java	2 Apr 2002 16:10:39 -0000	1.10
+++ ./jasper/src/share/org/apache/jasper/compiler/TldLocationsCache.java	6 Jun 2002 02:05:21 -0000
@@ -200,6 +200,10 @@
     {
 
         Set libSet = ctxt.getResourcePaths("/WEB-INF/lib");
+        if (libSet == null) {
+            System.err.println("processJars: ctxt == null");
+            return;
+        }
         Iterator it = libSet.iterator();
         while (it.hasNext()) {
             String resourcePath = (String) it.next();

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: patch: NullPointerException in jasper/src/share/org/apache/jasper/compiler/TldLocationsCache.java

Posted by Remy Maucherat <re...@apache.org>.
> After building from today's source, I was getting a nullpointerexception
in
> jasper/src/share/org/apache/jasper/compiler/TldLocationsCache.java
> in method processJars.
>
> While this may be "my fault" in terms of faulty build or wrong version of
some API,
> it seems like minimally defensive programming to check this variable for
null.
> My guess is it might be null if you have a Context that doesn't have a lib
> subdirectory under WEB-INF (ie you have WEB-INF/classes but not /lib)?

I already patched that in both branches earlier this afternoon.

Remy


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>