On Friday 01 February 2008, Chris Campbell wrote: > I am using CXFServlet in tomcat, and intend to load balance > instances of them with apache mod_jk, and want to use sticky sessions. > > I figure I have to create a session somewhere, as I do not see a > session created (JSESSIONID ?) automatically. For reasons not worth > going into, I do not need the session for state, beyond making sure > that the sticky-ness works on the load-balancer. > > I have tried getting the HttpServletRequest in an interceptor > (USER_LOGICAL phase) and creating an HttpSession if there is none, > and it seems to work. > > The problem is that I have a few soap endpoints at different URLs, > and the session seems to be created for each endpoint, so calls to > Service /Foo gets on session and /Bar another. This causes my sticky > session load balancer to send /Foo to one of the load balanced > CXFServlet and /Bar to another . > > Is there some way to create the Session so that it is valid for all > the service endpoints? Is setting the Session in an interceptor a > bad idea?
That should be completely fine assuming that works with tomcat. This really is a tomcat question which I don't really know much about. I would assume if all the endpoints are on the CXFServlet instance they would have properly shared the session. If they are in separate wars, maybe not. I don't know know enough about the servlet spec to know what the rules are around that. -- J. Daniel Kulp Principal Engineer, IONA [EMAIL PROTECTED] http://www.dankulp.com/blog
