0

How to share the session in multiple WAR in EAR file in JBOSS-7.3.6 ?

we have following entry in jboss-all.xml JBoss 7.2 version (before migration)

<jboss xmlns="urn:jboss:1.0">
    <shared-session-config xmlns="urn:jboss:shared-session-config:1.0">
        <max-active-sessions>10</max-active-sessions>
        <session-config>
            <session-timeout>0</session-timeout>
            <cookie-config>
                <name>JSESSIONID</name>
                <domain>domainName</domain>
                <path>/cookiePath</path>
                <comment>cookie comment</comment>
                <http-only>true</http-only>
                <secure>true</secure>
                <max-age>-1</max-age>
            </cookie-config>
            <tracking-mode>COOKIE</tracking-mode>
        </session-config>
        <replication-config>
            <cache-name>web</cache-name>
            <replication-granularity>SESSION</replication-granularity>
        </replication-config>
    </shared-session-config>
</jboss>

But now I'm putting the same xml.. or below xml snippet but could not work in JBOSS-7.3.6

 <shared-session-config xmlns="urn:jboss:shared-session-config:2.0">
<distributable/> 
        <max-active-sessions>10</max-active-sessions>
 -- rest copy from above

getting the following exception

21:50:31,221 ERROR [io.undertow.request] (default task-1) UT005023: Exception handling request to URL: java.lang.IllegalStateException: WFLYCLWEBUT0001: Session idKL5QLs4873uTTnzT6JFg03_avxMEa8Q1-B4Jy4 is invalid
        at org.wildfly.clustering.web.undertow.session.DistributableSession.validate(DistributableSession.java:265)
        at org.wildfly.clustering.web.undertow.session.DistributableSession.validate(DistributableSession.java:257)

Can anyone suggest how to achieve ?

Thanks in advance !

Amit Jain
  • 1
  • 4

1 Answers1

0

First of all you have to know that sharing sessions between web applications would violate the JavaEE Servlet specification! That means your applications may not be portable! However you can check the coresponding documentation for more info: Development Guide / Configuring Session Sharing Between Subdeployments In Enterprise Archives

  • Thanks for comment.. its legacy application alon we need to support the higher jboss ebap version for the company security. – Amit Jain Jul 02 '21 at 06:07
  • I have already read the document and prepared all conf files bit not working .. but did not work .. jboss-all.xml has shared tag which is mentioned in documents but no luck – Amit Jain Jul 02 '21 at 06:09