You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Pat Malatack <pm...@gmail.com> on 2008/05/17 21:45:55 UTC

Sessions in Stand Alone CXF

Is it possible to have sessions in a stand alone CXF instance.  I
currently have my web methods behind and apache server using mod_proxy
and i am actually using a php script in between to manage the session
(inject something like a userID before calling the webmethod) but i
would like to maintain state across endpoints in CXF and eliminate the
php script/hack.  Is this possible and if so is there guidance on how
to do it?

Thanks

-- 
Pat Malatack
pmala5@gmail.com

Re: Sessions in Stand Alone CXF

Posted by mattgoldspink <ma...@gmail.com>.
Hi Dan,

Apologies I didn't see that. It is pretty much identical to my patch.
Unfortunately we can't move to 2.3.x yet because we have a huge number of
applications which will be using this code that are on 2.2.x and we have a
lot of deep integration code with Jetty 6 and other parts of CXF. For now
I'll just continue patching the 2.2.x branch with my patch.

Thanks for the quick reply.

Matt
-- 
View this message in context: http://cxf.547215.n5.nabble.com/Sessions-in-Stand-Alone-CXF-tp557869p3347494.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Sessions in Stand Alone CXF

Posted by Daniel Kulp <dk...@apache.org>.
I believe this was already fixed:

https://svn.apache.org/viewvc?view=revision&revision=1023972

Can you test with 2.3.1 and let me know?

Dan
 

On Tuesday 18 January 2011 1:24:35 pm mattgoldspink wrote:
> Hi Dan,
> 
> We need this feature. I've submitted an issue with a patch I've been using
> for this:  https://issues.apache.org/jira/browse/CXF-3256
> https://issues.apache.org/jira/browse/CXF-3256
> 
> I couldn't get it to work by caching the SessionHandler as that would throw
> an exception when it was bound to a second context, however caching just
> the HashSessionmanager works just fine.
> 
> Thanks,
> Matt

-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog

Re: Sessions in Stand Alone CXF

Posted by mattgoldspink <ma...@gmail.com>.
Hi Dan,

We need this feature. I've submitted an issue with a patch I've been using
for this:  https://issues.apache.org/jira/browse/CXF-3256
https://issues.apache.org/jira/browse/CXF-3256 

I couldn't get it to work by caching the SessionHandler as that would throw
an exception when it was bound to a second context, however caching just the
HashSessionmanager works just fine.

Thanks,
Matt
-- 
View this message in context: http://cxf.547215.n5.nabble.com/Sessions-in-Stand-Alone-CXF-tp557869p3346607.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Sessions in Stand Alone CXF

Posted by Daniel Kulp <dk...@apache.org>.
Just looked at the code.   Unfortunately, the answer is no.  I thought  
the session was per port, but it's actually per context.   Can you log  
a jira?   I don't think it would be hard to change.   I think the  
sessionHandler created on line 325 of JettyHTTPServerEngine.java would  
just need to be an instance variable created on first use.   All the  
contexts created would then share it.

If you could actually try that and submit a patch in the jira, that  
would be GREAT.

Thanks!
Dan



On May 26, 2008, at 4:55 PM, Pat Malatack wrote:

> Thanks for the help Dan... I was able to get session support up and
> running using the spring configuration you pointed me too although its
> only valid for each endpoint.  Is it possible to share the session in
> standalone cxf across multiple endpoints?
>
> On Sun, May 18, 2008 at 7:31 PM, Daniel Kulp <dk...@apache.org> wrote:
>>
>> I think so, yes.   The spring configuration schema for the Jetty  
>> engine
>> contains a "sessionSupport" attribute for turning on sessions:
>> http://cwiki.apache.org/CXF20DOC/jetty-configuration.html
>>
>> Dan
>>
>>
>>
>>
>> On May 17, 2008, at 3:45 PM, Pat Malatack wrote:
>>
>>> Is it possible to have sessions in a stand alone CXF instance.  I
>>> currently have my web methods behind and apache server using  
>>> mod_proxy
>>> and i am actually using a php script in between to manage the  
>>> session
>>> (inject something like a userID before calling the webmethod) but i
>>> would like to maintain state across endpoints in CXF and eliminate  
>>> the
>>> php script/hack.  Is this possible and if so is there guidance on  
>>> how
>>> to do it?
>>>
>>> Thanks
>>>
>>> --
>>>
>>> Pat Malatack
>>> pmala5@gmail.com
>>
>> ---
>> Daniel Kulp
>> dkulp@apache.org
>> http://www.dankulp.com/blog
>>
>>
>>
>>
>>
>
>
>
> -- 
> Pat Malatack
> pmala5@gmail.com

---
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog





Re: Sessions in Stand Alone CXF

Posted by Pat Malatack <pm...@gmail.com>.
Thanks for the help Dan... I was able to get session support up and
running using the spring configuration you pointed me too although its
only valid for each endpoint.  Is it possible to share the session in
standalone cxf across multiple endpoints?

On Sun, May 18, 2008 at 7:31 PM, Daniel Kulp <dk...@apache.org> wrote:
>
> I think so, yes.   The spring configuration schema for the Jetty engine
> contains a "sessionSupport" attribute for turning on sessions:
> http://cwiki.apache.org/CXF20DOC/jetty-configuration.html
>
> Dan
>
>
>
>
> On May 17, 2008, at 3:45 PM, Pat Malatack wrote:
>
>> Is it possible to have sessions in a stand alone CXF instance.  I
>> currently have my web methods behind and apache server using mod_proxy
>> and i am actually using a php script in between to manage the session
>> (inject something like a userID before calling the webmethod) but i
>> would like to maintain state across endpoints in CXF and eliminate the
>> php script/hack.  Is this possible and if so is there guidance on how
>> to do it?
>>
>> Thanks
>>
>> --
>>
>> Pat Malatack
>> pmala5@gmail.com
>
> ---
> Daniel Kulp
> dkulp@apache.org
> http://www.dankulp.com/blog
>
>
>
>
>



-- 
Pat Malatack
pmala5@gmail.com

Re: Sessions in Stand Alone CXF

Posted by Daniel Kulp <dk...@apache.org>.
I think so, yes.   The spring configuration schema for the Jetty  
engine contains a "sessionSupport" attribute for turning on sessions:
http://cwiki.apache.org/CXF20DOC/jetty-configuration.html

Dan




On May 17, 2008, at 3:45 PM, Pat Malatack wrote:

> Is it possible to have sessions in a stand alone CXF instance.  I
> currently have my web methods behind and apache server using mod_proxy
> and i am actually using a php script in between to manage the session
> (inject something like a userID before calling the webmethod) but i
> would like to maintain state across endpoints in CXF and eliminate the
> php script/hack.  Is this possible and if so is there guidance on how
> to do it?
>
> Thanks
>
> --
>
> Pat Malatack
> pmala5@gmail.com

---
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog