I cannot for the life of me figure out how to configure session handling when setting up CXF from a service.xml blueprint.

Things I'd hope might work -- specify my preferred SessionHandler as a provider, or supply a jetty-web.xml in my bundle -- don't have any effect. It's easy enough if you have access to the ServletContextHandler or WebAppContext, and for non-jersey webapps the snippet at [1] in jetty-web.xml works a treat. But the link between CXF and Jetty seems murky when coming from an OSGi blueprint. It might work to ditch the blueprint and use a web.xml descriptor instead, specifying CXFServlet, and expecting a jetty-web.xml to be read for that servlet ... but that feels like a step backwards.

Isn't this a common use case, persisting sessions among servers or across restarts? Jetty has a whole chapter on it at [1]. But I'm not finding anything on it in the CXF docs.

So I welcome help from the experts!

Thanks
Alex


[1] from https://www.eclipse.org/jetty/documentation/9.4.x/sessions-usecases.html

<Configure class="org.eclipse.jetty.webapp.WebAppContext">
  <Call id="sh" name="getSessionHandler">
    <Set name="sessionCache">
      <New class="org.eclipse.jetty.server.session.DefaultSessionCache">
        <Arg><Ref id="sh"/></Arg>
        <Set name="sessionDataStore">
<New class="org.eclipse.jetty.server.session.FileSessionDataStore">
             <Set name="storeDir">/tmp/sessions</Set>
           </New>
        </Set>
      </New>
    </Set>
  </Call>
</Configure>

Reply via email to