You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Yogeshwar Srikrishnan <yo...@rackspace.com> on 2010/08/02 16:23:24 UTC

Issues with org.apache.catalina.connector.Request

I Keep getting this exception once in a while.The code line shows
>         Object listeners[] = context.getApplicationEventListeners();
> The version of apache that we use 5.5.23.
>
> java.lang.NullPointerException
>     at 
> org.apache.catalina.connector.Request.setAttribute(Request.java:1382)
>     at 
> org.apache.catalina.connector.RequestFacade.setAttribute(RequestFacade.java:501)

The value of context is null.Has anybody faced this issue?This doesn't 
happen all the time.
>
> -- 
> *Yogeshwar Srikrishnan*
> Software Engineer III
> Email: yogesh.srikrishnan@rackspace.com 
> <ma...@rackspace.com>
> Phone: (210) 459-1412




Confidentiality Notice: This e-mail message (including any attached or
embedded documents) is intended for the exclusive and confidential use of the
individual or entity to which this message is addressed, and unless otherwise
expressly indicated, is confidential and privileged information of Rackspace.
Any dissemination, distribution or copying of the enclosed material is prohibited.
If you receive this transmission in error, please notify us immediately by e-mail
at abuse@rackspace.com, and delete the original message.
Your cooperation is appreciated.


Re: Issues with org.apache.catalina.connector.Request

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Yogeshwar,

On 8/5/2010 11:03 AM, Yogeshwar Srikrishnan wrote:
> Thanks.Quite possible we are using certain REST resources as sub resource.
> Could be issues with the way its done!

This is not legal from a Servlet Spec standpoint. It's also bad practice
because you introduce some very difficult-to-diagnose issues such as this.

You could write a Filter to wrap the HttpSession object and log an error
anytime a Request object is placed into it. You can do this with other
resources as well to help you debug.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkxa4IUACgkQ9CaO5/Lv0PBFCACeN7Dy73DEnX+X8sX5/9Rgo5xs
58EAoI8DxP7YG3NNJzYyijKHo6rQPri7
=iglj
-----END PGP SIGNATURE-----

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


Re: Issues with org.apache.catalina.connector.Request

Posted by Yogeshwar Srikrishnan <yo...@rackspace.com>.
Thanks.Quite possible we are using certain REST resources as sub resource.
Could be issues with the way its done!
Thanks for the help.

On 08/05/2010 09:59 AM, Caldarale, Charles R wrote:
> It means it appears that you have stored a reference to the Request object in the session or some other scope that makes it erroneously accessible to multiple threads.


-- 
*Yogeshwar Srikrishnan*
Software Engineer III
Email: yogesh.srikrishnan@rackspace.com 
<ma...@rackspace.com>
Phone: (210) 459-1412


Confidentiality Notice: This e-mail message (including any attached or
embedded documents) is intended for the exclusive and confidential use of the
individual or entity to which this message is addressed, and unless otherwise
expressly indicated, is confidential and privileged information of Rackspace.
Any dissemination, distribution or copying of the enclosed material is prohibited.
If you receive this transmission in error, please notify us immediately by e-mail
at abuse@rackspace.com, and delete the original message.
Your cooperation is appreciated.


RE: Issues with org.apache.catalina.connector.Request

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Yogeshwar Srikrishnan [mailto:yogesh.srikrishnan@rackspace.com]
> Subject: Re: Issues with org.apache.catalina.connector.Request
> 
> > This smacks of a cached request
> > object, which is totally illegal.
> 
> "  what do you mean by that?

It means it appears that you have stored a reference to the Request object in the session or some other scope that makes it erroneously accessible to multiple threads.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.


Re: Issues with org.apache.catalina.connector.Request

Posted by Yogeshwar Srikrishnan <yo...@rackspace.com>.
Thanks Christopher.This is the custom exception.All that our code 
attempts is to invoke the
servletRequest.setAttribute where servletRequest is a HttpServletRequest 
and it is not cached.
When you say "

This smacks of a cached request
object, which is totally illegal.

"  what do you mean by that?

Regards

java.lang.NullPointerException
         at 
org.apache.catalina.connector.Request.setAttribute(Request.java:1382)
         at 
org.apache.catalina.connector.RequestFacade.setAttribute(RequestFacade.java:501)
         at

             bunch of custom classes where exception happens.....

         at sun.reflect.GeneratedMethodAccessor156.invoke(Unknown Source)
  at 
org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:166)
         at 
org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:82)
         at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:118)
         at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:186)
         at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:78)
         at 
org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58)
         at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
         at 
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
         at java.util.concurrent.FutureTask.run(FutureTask.java:138)
         at 
org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)
         at 
org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:98)
at 
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236)
         at 
org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:104)
         at 
org.apache.cxf.transport.servlet.ServletDestination.invoke(ServletDestination.java:99)
         at 
org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:452)
         at 
org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:196)
         at 
org.apache.cxf.transport.servlet.AbstractCXFServlet.invoke(AbstractCXFServlet.java:220)
         at 
org.apache.cxf.transport.servlet.AbstractCXFServlet.doGet(AbstractCXFServlet.java:158)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
         at 
org.apache.cxf.transport.servlet.AbstractCXFServlet.service(AbstractCXFServlet.java:211)
         at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
         at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
         at 
com.rackspace.cloud.servers.api.jaxrs.CacheControlFilter.doFilter(CacheControlFilter.java:50)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
         at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
         at 
com.rackspace.cloud.api.util.filter.ResponseHeaderFilter.doFilter(ResponseHeaderFilter.java:118)
         at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
         at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
         at 
com.rackspace.cloud.api.util.filter.UnavailableFilter.doFilter(UnavailableFilter.java:90)
         at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
         at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
         at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
         at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
         at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)

         at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
         at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
         at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
         at 
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
         at 
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
         at 
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
         at 
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
         at 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
         at java.lang.Thread.run(Thread.java:619)




On 08/04/2010 08:59 AM, Christopher Schultz wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Yogeshwar,
>
> On 8/2/2010 10:23 AM, Yogeshwar Srikrishnan wrote:
>    
>> I Keep getting this exception once in a while.The code line shows
>>      
>>>          Object listeners[] = context.getApplicationEventListeners();
>>> The version of apache that we use 5.5.23.
>>>
>>> java.lang.NullPointerException
>>>      at
>>> org.apache.catalina.connector.Request.setAttribute(Request.java:1382)
>>>      at
>>> org.apache.catalina.connector.RequestFacade.setAttribute(RequestFacade.java:501)
>>>
>>>        
>> The value of context is null.Has anybody faced this issue?This doesn't
>> happen all the time.
>>      
> Where is the rest of the stack trace? This smacks of a cached request
> object, which is totally illegal.
>
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iEYEARECAAYFAkxZcl0ACgkQ9CaO5/Lv0PCb5ACeMbDFyf5p/DkDcsUbnIDL9SvT
> W08An05ENoNlgHY//4LaI47/f3X/7jeS
> =VtwH
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>    


-- 
*Yogeshwar Srikrishnan*
Software Engineer III
Email: yogesh.srikrishnan@rackspace.com 
<ma...@rackspace.com>
Phone: (210) 459-1412


Confidentiality Notice: This e-mail message (including any attached or
embedded documents) is intended for the exclusive and confidential use of the
individual or entity to which this message is addressed, and unless otherwise
expressly indicated, is confidential and privileged information of Rackspace.
Any dissemination, distribution or copying of the enclosed material is prohibited.
If you receive this transmission in error, please notify us immediately by e-mail
at abuse@rackspace.com, and delete the original message.
Your cooperation is appreciated.


Re: Issues with org.apache.catalina.connector.Request

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Yogeshwar,

On 8/2/2010 10:23 AM, Yogeshwar Srikrishnan wrote:
> I Keep getting this exception once in a while.The code line shows
>>         Object listeners[] = context.getApplicationEventListeners();
>> The version of apache that we use 5.5.23.
>>
>> java.lang.NullPointerException
>>     at
>> org.apache.catalina.connector.Request.setAttribute(Request.java:1382)
>>     at
>> org.apache.catalina.connector.RequestFacade.setAttribute(RequestFacade.java:501)
>>
> 
> The value of context is null.Has anybody faced this issue?This doesn't
> happen all the time.

Where is the rest of the stack trace? This smacks of a cached request
object, which is totally illegal.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkxZcl0ACgkQ9CaO5/Lv0PCb5ACeMbDFyf5p/DkDcsUbnIDL9SvT
W08An05ENoNlgHY//4LaI47/f3X/7jeS
=VtwH
-----END PGP SIGNATURE-----

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