tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "eurotrans-Verlag" <>
Subject RE: NPE at StandardWrapperValve.invoke() in Tomcat 7.0.16
Date Thu, 07 Jul 2011 22:41:12 GMT
> Maybe I can reproduce the
> NPE if I make a servlet that takes a long time to finish the request,
> to see what was the original exception that has been suppressed by the
> NPE.

OK, I was able to reproduce a NPE in TC 7.0.16 with a Servlet that calls "Thread.sleep(20000)",
then make a request to that servlet and immediately redeploy that webapp. However, this time
the NPE was not in StandardWrapperValve.invoke(), but in StandardContextValve.invoke():

08.07.2011 00:26:40 org.apache.catalina.connector.CoyoteAdapter service
SCHWERWIEGEND: An exception or error occurred in the container during the request processing
	at org.apache.catalina.core.StandardContextValve.invoke(
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(
	at org.apache.catalina.core.StandardHostValve.invoke(
	at org.apache.catalina.valves.ErrorReportValve.invoke(
	at org.apache.catalina.valves.AccessLogValve.invoke(
	at org.apache.catalina.core.StandardEngineValve.invoke(
	at org.apache.catalina.connector.CoyoteAdapter.service(
	at org.apache.coyote.http11.Http11Processor.process(
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$ Source)
	at Source)

The lines around 172 in StandardContextValve are these:

166 	// If the request was async at the start and an error occurred then
167 	// the async error handling will kick-in and that will fire the
168 	// request destroyed event *after* the error handling has taken
169 	// place
170 	if (!(request.isAsync() || (asyncAtStart && request.getAttribute(
171 	            RequestDispatcher.ERROR_EXCEPTION) != null))) {
172 	    context.fireRequestDestroyEvent(request);
173 	}

The problem here is that "context" is null (I debugged TC in Eclipse). However, this time
it seems that it is not another Exception that has been suppressed by a NPE.

I checked that the NPE in StandardContextValve.invoke() also occurs in Tomcat 7.0.18.

Unfortunately, I was not able to reproduce the NPE in StandardWrapperValve.invoke().


Konstantin Prei├čer

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message