You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by "KARR, DAVID" <dk...@att.com> on 2013/05/29 18:33:54 UTC
Need to turn off keepalive for cxf jax-rs requests?
I have a CXF JAX-RS app running within a larger EAR serving normal web pages, running in WebLogic.
We're seeing occurrences of the following exception:
Caused by: java.lang.NullPointerException
at weblogic.servlet.internal.ServletRequestImpl$SessionHelper.initSessionInfo(ServletRequestImpl.java:2611)
>From the google results for this, it appears that WebLogic is caching a request object that should not be cached (or something like that). The recommended solution is to "disable keepalive". Is this something I can do in the CXF controller, or perhaps in an outbound interceptor?
Re: Need to turn off keepalive for cxf jax-rs requests?
Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi
Adding response headers should become simpler starting from CXF 2.7.x,
David, please consider migrating, JAX-RS 2.0 response filters are quite
effective
Sergey
On Fri, May 31, 2013 at 12:07 AM, Daniel Kulp <dk...@apache.org> wrote:
>
> On May 29, 2013, at 1:52 PM, "KARR, DAVID" <dk...@att.com> wrote:
>
> >> -----Original Message-----
> >> From: KARR, DAVID
> >> Sent: Wednesday, May 29, 2013 9:34 AM
> >> To: users@cxf.apache.org
> >> Subject: Need to turn off keepalive for cxf jax-rs requests?
> >>
> >> I have a CXF JAX-RS app running within a larger EAR serving normal web
> pages,
> >> running in WebLogic.
> >>
> >> We're seeing occurrences of the following exception:
> >>
> >> Caused by: java.lang.NullPointerException
> >> at
> >>
> weblogic.servlet.internal.ServletRequestImpl$SessionHelper.initSessionInfo(Se
> >> rvletRequestImpl.java:2611)
> >>
> >> From the google results for this, it appears that WebLogic is caching a
> >> request object that should not be cached (or something like that). The
> >> recommended solution is to "disable keepalive". Is this something I
> can do
> >> in the CXF controller, or perhaps in an outbound interceptor?
> >
> > Assuming turning off keepalive is what I need to do, I assume I need to
> write a class extending "AbstractOutDatabindingInterceptor" (as described
> at <
> http://cxf.apache.org/docs/jax-rs-filters.html#JAX-RSFilters-Overridingresponsestatuscodeandheaders>)
> and add a "Keep-Alive: timeout=0" header, and reference this bean in the
> "jaxrs:outInterceptors" section of my "jaxrs:server" definition. Does this
> seem like the right thing to do?
>
> Probably. Maybe add a "Connection: Close" header as well.
>
>
> --
> Daniel Kulp
> dkulp@apache.org - http://dankulp.com/blog
> Talend Community Coder - http://coders.talend.com
>
>
Re: Need to turn off keepalive for cxf jax-rs requests?
Posted by Daniel Kulp <dk...@apache.org>.
On May 29, 2013, at 1:52 PM, "KARR, DAVID" <dk...@att.com> wrote:
>> -----Original Message-----
>> From: KARR, DAVID
>> Sent: Wednesday, May 29, 2013 9:34 AM
>> To: users@cxf.apache.org
>> Subject: Need to turn off keepalive for cxf jax-rs requests?
>>
>> I have a CXF JAX-RS app running within a larger EAR serving normal web pages,
>> running in WebLogic.
>>
>> We're seeing occurrences of the following exception:
>>
>> Caused by: java.lang.NullPointerException
>> at
>> weblogic.servlet.internal.ServletRequestImpl$SessionHelper.initSessionInfo(Se
>> rvletRequestImpl.java:2611)
>>
>> From the google results for this, it appears that WebLogic is caching a
>> request object that should not be cached (or something like that). The
>> recommended solution is to "disable keepalive". Is this something I can do
>> in the CXF controller, or perhaps in an outbound interceptor?
>
> Assuming turning off keepalive is what I need to do, I assume I need to write a class extending "AbstractOutDatabindingInterceptor" (as described at < http://cxf.apache.org/docs/jax-rs-filters.html#JAX-RSFilters-Overridingresponsestatuscodeandheaders>) and add a "Keep-Alive: timeout=0" header, and reference this bean in the "jaxrs:outInterceptors" section of my "jaxrs:server" definition. Does this seem like the right thing to do?
Probably. Maybe add a "Connection: Close" header as well.
--
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com
RE: Need to turn off keepalive for cxf jax-rs requests?
Posted by "KARR, DAVID" <dk...@att.com>.
> -----Original Message-----
> From: KARR, DAVID
> Sent: Wednesday, May 29, 2013 9:34 AM
> To: users@cxf.apache.org
> Subject: Need to turn off keepalive for cxf jax-rs requests?
>
> I have a CXF JAX-RS app running within a larger EAR serving normal web pages,
> running in WebLogic.
>
> We're seeing occurrences of the following exception:
>
> Caused by: java.lang.NullPointerException
> at
> weblogic.servlet.internal.ServletRequestImpl$SessionHelper.initSessionInfo(Se
> rvletRequestImpl.java:2611)
>
> From the google results for this, it appears that WebLogic is caching a
> request object that should not be cached (or something like that). The
> recommended solution is to "disable keepalive". Is this something I can do
> in the CXF controller, or perhaps in an outbound interceptor?
Assuming turning off keepalive is what I need to do, I assume I need to write a class extending "AbstractOutDatabindingInterceptor" (as described at < http://cxf.apache.org/docs/jax-rs-filters.html#JAX-RSFilters-Overridingresponsestatuscodeandheaders>) and add a "Keep-Alive: timeout=0" header, and reference this bean in the "jaxrs:outInterceptors" section of my "jaxrs:server" definition. Does this seem like the right thing to do?