https://issues.apache.org/bugzilla/show_bug.cgi?id=52009
Konstantin Kolinko <knst.koli...@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |REOPENED Resolution|INVALID | --- Comment #9 from Konstantin Kolinko <knst.koli...@gmail.com> 2011-10-14 13:05:10 UTC --- (In reply to comment #8) > (In reply to comment #4) > > 4) I am running with the following line added to catalina.properties file: > > org.apache.catalina.connector.RECYCLE_FACADES=true > Yep. That makes this an application / Bayeux library error rather than a > Tomcat > bug. See in comment #4: > 6) The NPE is reproducible both in 7.0.22 and in trunk. > (..) > > 3. The cause for NPE at CoyoteAdapter.java:436 is that at that point the > request is already recycled and request.getMappingData().context is null. > > 4. The recycling happens in the finally block in CoyoteAdapter#event(..), > lines 252-254: > if (error || response.isClosed() || !request.isComet()) { > request.recycle(); > request.setFilterChain(null); > response.recycle(); > } > > I do not know much about request that is being recycled. It is not the first > request that was received. > > 5. If I put breakpoint on the request.recycle() call above, the call stack is: > > CoyoteAdapter.event(Request, Response, SocketStatus) line: 252 > CoyoteAdapter.service(Request, Response) line: 411 > Http11NioProcessor(AbstractHttp11Processor<S>).process(SocketWrapper<S>) line: > 970 > Http11NioProtocol$Http11ConnectionHandler(AbstractProtocol$AbstractConnectionHandler<S,P>).process(SocketWrapper<S>, > SocketStatus) line: 515 > NioEndpoint$SocketProcessor.run() line: 1550 > > After returning from event() call on CoyoteAdapter:411 (the call returns > false) > the lines 431..440 are executed: > } else if (!comet) { > request.finishRequest(); > response.finishResponse(); > if (postParseSuccess) { > // Log only if processing was invoked. > // If postParseRequest() failed, it has already logged it. > ((Context) request.getMappingData().context).logAccess( > request, response, > System.currentTimeMillis() - req.getStartTime(), > false); > } > > The comet variable is false and postParseSuccess is true. > The request is already recycled and request.getMappingData().context is null, > leading to an NPE. The above is a legitimate bug. Recycling in event() -> returning to service() -> NPE when trying to log it. -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org