You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@karaf.apache.org by "Kurt Westerfeld (JIRA)" <ji...@apache.org> on 2015/12/16 20:36:47 UTC

[jira] [Comment Edited] (KARAF-4218) JAAS boot classes are not marked serializable

    [ https://issues.apache.org/jira/browse/KARAF-4218?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15060131#comment-15060131 ] 

Kurt Westerfeld edited comment on KARAF-4218 at 12/16/15 7:36 PM:
------------------------------------------------------------------

The example I gave for jetty-web.xml actually doesn't work with the Karaf 4.0.4-SNAPSHOT because the Jetty version upgrade in pax-web 4.2.4 breaks the HashSessionManager.setStoreDirectory() API.

Here is a version that works for the later Jetty:

{noformat}
<?xml version="1.0"  encoding="UTF-8"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
  <Set name="sessionHandler">
    <New class="org.eclipse.jetty.server.session.SessionHandler">
      <Arg>
        <New class="org.eclipse.jetty.server.session.HashSessionManager">
          <Set name="storeDirectory">
            <New class="java.io.File">
              <Arg>${karaf.data}/sessions</Arg>
            </New>
          </Set>
          <Set name="savePeriod" type="int">10</Set>
        </New>
      </Arg>
    </New>
  </Set>
</Configure>
{noformat}


was (Author: kurt.westerfeld@gmail.com):
The example I gave for jetty-web.xml actually doesn't work with the Karaf 4.0.4-SNAPSHOT because the Jetty version upgrade in pax-web 4.2.4 breaks the HashSessionManager.setStoreDirectory() API.

Here is a version that works for the later Jetty:

{noformat}
<?xml version="1.0"  encoding="UTF-8"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
  <Set name="sessionHandler">
    <New class="org.eclipse.jetty.server.session.SessionHandler">
      <Arg>
        <New class="org.eclipse.jetty.server.session.HashSessionManager">
          <Set name="storeDirectory">
            <New class="java.io.File">
              <Arg>${karaf.data}/sessions</Arg>
            </New>
          </Set>
          <Set name="savePeriod">10</Set>
        </New>
      </Arg>
    </New>
  </Set>
</Configure>
{noformat}

> JAAS boot classes are not marked serializable
> ---------------------------------------------
>
>                 Key: KARAF-4218
>                 URL: https://issues.apache.org/jira/browse/KARAF-4218
>             Project: Karaf
>          Issue Type: Bug
>          Components: karaf-osgi, karaf-security
>    Affects Versions: 4.0.3
>            Reporter: Kurt Westerfeld
>            Assignee: Jean-Baptiste Onofré
>             Fix For: 4.0.4
>
>
> The principal classes in the jaas/boot module (org.apache.karaf.jaas.boot.principal package) are not marked serializable.  I am trying to setup clustering for a hawtio-based console, and the app stores javax.security.Subject in session data, which is not serializable because org.apache.karaf.jaas.boot.principal.UserPrincipal/etc are not marked serializable. 
> Setting up a configuration for this is easy.  Simply create a WAB project that has WEB-INF/jetty-web.xml as follows.  The session manager in this case simply causes the sessions to serialize to disk.  Most clustering solutions rely on serializable session data.
> {noformat}
> <?xml version="1.0"  encoding="UTF-8"?>
> <!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
> <Configure class="org.eclipse.jetty.webapp.WebAppContext">
>   <Set name="sessionHandler">
>     <New class="org.eclipse.jetty.server.session.SessionHandler">
>       <Arg>
>         <New class="org.eclipse.jetty.server.session.HashSessionManager">
>           <Set name="storeDirectory">${karaf.data}/sessions</Set>
>           <Set name="savePeriod">10</Set>
>         </New>
>       </Arg>
>     </New>
>   </Set>
> </Configure>
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)