You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Jon Stevens <jo...@latchkey.com> on 2000/09/03 00:18:38 UTC

[patch] npe in contextmanager

for some reason, i'm getting a NPE in contextmanger. below is a patch that
doesn't fix the problem, but at least catches the NPE better and also logs
the appropriate value for errorServlet if debugging is turned on.

now, would someone like to explain to me why i'm getting the npe in the
first place? :-)

-jon

cvs -z9 diff ContextManager.java (in directory
E:\PROJECTS\jakarta-tomcat\src\share\org\apache\tomcat\core)
Index: ContextManager.java
===================================================================
RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.jav
a,v
retrieving revision 1.127
diff -r1.127 ContextManager.java
979,980d978
<     if( debug>0 )
<         ctx.log( "Handler " + errorServlet + " " + errorPath);
985c983,986
<     req.setAttribute("javax.servlet.error.status_code",new Integer(
code));
---
>     if (errorServlet == null) {
>         ctx.log( "Handler errorServlet is null! errorPath:" + errorPath);
>         return;
>     }
986a988
>     req.setAttribute("javax.servlet.error.status_code",new Integer( code));
987a990,992
> 
>     if( debug>0 )
>         ctx.log( "Handler " + errorServlet + " " + errorPath);


-- 
http://scarab.tigris.org/    | http://noodle.tigris.org/
http://java.apache.org/      | http://java.apache.org/turbine/
http://www.working-dogs.com/ | http://jakarta.apache.org/velocity/
http://www.collab.net/       | http://www.sourcexchange.com/



Re: [patch] npe in contextmanager

Posted by Jon Stevens <jo...@latchkey.com>.
on 9/2/2000 3:18 PM, "Jon Stevens" <jo...@latchkey.com> wrote:

> for some reason, i'm getting a NPE in contextmanger. below is a patch that
> doesn't fix the problem, but at least catches the NPE better and also logs
> the appropriate value for errorServlet if debugging is turned on.
> 
> now, would someone like to explain to me why i'm getting the npe in the
> first place? :-)
> 
> -jon

here is the NPE's that i'm getting...

2000-09-02 02:53:05 - Context: Exception in R( /scarab + /servlet/scarab +
null) - java.lang.NullPointerException
    at 
org.apache.tomcat.core.ContextManager.handleStatus(ContextManager.java:989)
    at org.apache.tomcat.core.Handler.service(Handler.java:283)
    at 
org.apache.tomcat.facade.ServletWrapper.service(ServletWrapper.java:381)
    at 
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:73
7)
    at 
org.apache.tomcat.core.ContextManager.service(ContextManager.java:681)
    at 
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
onnectionHandler.java:194)
    at 
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:400)
    at 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
a:498)
    at java.lang.Thread.run(Thread.java:479)

2000-09-02 02:53:05 - HttpConnectionHandler: Error reading request, ignored
- java.lang.NullPointerException
    at 
org.apache.tomcat.core.ContextManager.handleError(ContextManager.java:1055)
    at 
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:74
0)
    at 
org.apache.tomcat.core.ContextManager.service(ContextManager.java:681)
    at 
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
onnectionHandler.java:194)
    at 
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:400)
    at 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
a:498)
    at java.lang.Thread.run(Thread.java:479)

-- 
http://scarab.tigris.org/    | http://noodle.tigris.org/
http://java.apache.org/      | http://java.apache.org/turbine/
http://www.working-dogs.com/ | http://jakarta.apache.org/velocity/
http://www.collab.net/       | http://www.sourcexchange.com/