I'm trying to imagine ways in which my code could be causing this and coming up blank. java.lang.NullPointerException at org.apache.naming.resources.ProxyDirContext.cacheLoad(ProxyDirContext.java(Compiled Code)) at org.apache.naming.resources.ProxyDirContext.cacheLookup(ProxyDirContext.java(Compiled Code)) at org.apache.naming.resources.ProxyDirContext.lookup(ProxyDirContext.java(Compiled Code)) at org.apache.catalina.loader.WebappClassLoader.findResourceInternal(WebappClassLoader.java(Compiled Code)) at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java(Compiled Code)) at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java(Compiled Code)) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java(Compiled Code)) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java(Compiled Code)) at com.pronto.presentation.action.order.SearchOrdersAction.getParameters(SearchOrdersAction.java:58) at com.pronto.presentation.action.order.SearchOrdersAction.execute(SearchOrdersAction.java:44) at com.pronto.presentation.EProntoController.doGet(EProntoController.java:62) line 58 of SearchOrdersAction.java is: SearchOrderParameters params = new SearchOrderParameters(); SearchOrderParameters extends from Object, and has the default constructor. It contains no imports of any classes that I would consider significant. The problem was constantly reproducable while the webapp was running, but in a most infuriating manner, the problem has resolved itself after performing a stop/start in the manager app. I don't like problems that resolve themselves without any apparent intervention. Looking at the code for ProxyDirContext.cacheLoad, the objects referenced are: entry - null is checked for in the cacheLookup method, immediately prior to this method call. dirContext - the public constructor would throw null if this was null, the protected constructor would let it through though. attributes - could dirContext.getAttributes(entry.name) be returning null? My understanding is that it would throw a NamingException rather than return null. If it does return null, line 1492 will throw a nullpointer. object - same situation here. If dirContext.lookup(name) can return null, 1507 throws nullpointer. If the toString() method on that object returns null, 1514 will throw. is - could entry.resource.streamContent() return null? if so, 1530 throws. None of those stand out as likely suspects to me.
Were you ever able to repeat this or was it a one off?
It was a one-off occurence
Without a repeatable test case this is going to be very difficult / impossible to track down. Since it was a one off, I am going to resolve this bug as a WONTFIX.
I've recently ran into this bug. Restarting tomcat causes the problem to go away for a while. I've included a stacktrace with line numbers: Currently my solution is to increase the amount of memory the VM has available with the -Xmx -Xms options. I'm tempted to look at the source now to see what is really going on. Caused by: java.lang.NullPointerException at org.apache.naming.resources.ProxyDirContext.cacheLoad (ProxyDirContext.java:1534) at org.apache.naming.resources.ProxyDirContext.cacheLookup (ProxyDirContext.java:1412) at org.apache.naming.resources.ProxyDirContext.lookup (ProxyDirContext.java:300) at org.apache.catalina.loader.WebappClassLoader.findResourceInternal (WebappClassLoader.java:1730) at org.apache.catalina.loader.WebappClassLoader.findClassInternal (WebappClassLoader.java:1619) at org.apache.catalina.loader.WebappClassLoader.findClass (WebappClassLoader.java:968) at org.apache.catalina.loader.WebappClassLoader.loadClass (WebappClassLoader.java:1409) at org.apache.catalina.loader.WebappClassLoader.loadClass (WebappClassLoader.java:1289) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302) (My code that doesn't explicitly refer ClassLoader or Class)
Got the source for the tomcat server we are running. 4.1.24. The line that is causing the problem is int n = is.read(b, pos, length - pos); Since it is a NullPointerException I would assume that the inputstream is null for whatever reason.