You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by We...@ubs.com on 2005/01/19 16:26:43 UTC

NullPointerException at line 1472 of CoyoteRequest.java (setAttribute)

Hello,

I am receiving an intermittent NullPointerException when I call the request.setAttribute(java.lang.String name, java.lang.Object o) method from my servlet.  The error is not consistently reproducible and only happens infrequently.  We are running tomcat 5.0.25 on a Linux server.  The error is occurring on a page that has about 100 users accessing it, auto-refreshing every 30-60 seconds.  The object I am setting as an attribute is of type List (ArrayList) and it is not null when I set it.

A printStackTrace shows that the error is occurring at line 1472 of CoyoteRequest.java on context.getapplicationEventListenders: 
	Object listeners[] = context.getApplicationEventListeners();

I assume that, when the exception is thrown, context is null, but I'm not sure what would cause this.  In every instance this error does not occur again when the user refreshes his/her request.

Is this a known bug in Tomcat 5.0.25?  Otherwise, could it be some sort of memory problem?  What would cause context to infrequently and seemingly randomly be null?
 
A full stack trace is below.  The name of my servlet is OrderBook.  I greatly appreciate any help.

2005-01-18 09:14:51 StandardWrapperValve[OrderBook]: Servlet.service() for servlet OrderBook threw exception
java.lang.NullPointerException
	at org.apache.coyote.tomcat5.CoyoteRequest.setAttribute(CoyoteRequest.java:1472)
	at org.apache.coyote.tomcat5.CoyoteRequestFacade.setAttribute(CoyoteRequestFacade.java:349)
	at com.ubs.koba.web.OrderBookController.doProcess(OrderBookController.java:36)
	at com.ubs.koba.web.BaseServlet.init(BaseServlet.java:92)
	at com.ubs.koba.web.BaseServlet.doGet(BaseServlet.java:139)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
	at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
	at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
	at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
	at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
	at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
	at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:793)
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:702)
	at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:571)
	at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:644)
	at java.lang.Thread.run(Thread.java:534)




Visit our website at http://www.ubs.com

This message contains confidential information and is intended only 
for the individual named.  If you are not the named addressee you 
should not disseminate, distribute or copy this e-mail.  Please 
notify the sender immediately by e-mail if you have received this 
e-mail by mistake and delete this e-mail from your system.

E-mail transmission cannot be guaranteed to be secure or error-free 
as information could be intercepted, corrupted, lost, destroyed, 
arrive late or incomplete, or contain viruses.  The sender therefore 
does not accept liability for any errors or omissions in the contents 
of this message which arise as a result of e-mail transmission.  If 
verification is required please request a hard-copy version.  This 
message is provided for informational purposes and should not be 
construed as a solicitation or offer to buy or sell any securities or 
related financial instruments.


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org