3 Replies Latest reply on Mar 12, 2013 3:42 AM by thomas.diesler

    How to use session replication in domain mode and OSGi?

    cberger

      Hi,

       

      I want to use JBoss in domain mode and enable clustering so I could get session replication and HA. I was able to setup the domain mode and to use distributed deployment of osgi bundles.

      However, I have some bundles which are using servlets and http session and therefore I want to have session replication. I've configured the following cache:

       

       

       <subsystem xmlns="urn:jboss:domain:infinispan:1.4" default-cache-container="web">               
                      <cache-container name="web" aliases="standard-session-cache" default-cache="repl" module="org.jboss.as.clustering.web.infinispan">
                          <transport lock-timeout="60000"/>
                          <replicated-cache name="repl" mode="ASYNC" batching="true">
                              <file-store/>
                          </replicated-cache>
                          <replicated-cache name="sso" mode="SYNC" batching="true"/>
                          <distributed-cache name="dist" mode="ASYNC" batching="true" l1-lifespan="0">
                              <file-store/>
                          </distributed-cache>
                      </cache-container>
      

       

      But even if one server fails, the session is not replicated. When I check the docu, it's described to use <distributable/>in your JEE-WAR or @Clusterable in EJBs. But I can't find any hint to enable session replication for OSGi-Bundles.

       

      Is it not working?

       

      Thanks

       

      Christian

        • 1. Re: How to use session replication in domain mode and OSGi?
          thomas.diesler

          Whether a webapp deployment is a bundle or not should be transparent. If this works for an ordinary war (i.e. without OSGi metadata) and does not work with the same deployment that has OSGi metadata added to it - we have a bug

          • 2. Re: How to use session replication in domain mode and OSGi?
            cberger

            Thomas Diesler wrote:

             

            Whether a webapp deployment is a bundle or not should be transparent. If this works for an ordinary war (i.e. without OSGi metadata) and does not work with the same deployment that has OSGi metadata added to it - we have a bug

            Maybe you misunderstood. I don't understand how to enable session replication from within a normal bundle. These bundles are not WABs, they are just plain osgi bundles with Servlets. So I do not have any kind of deployment descriptor like web.xml etc.

             

            So should I add a web.xml just to provide the <distributable/> - flag and will this file even parsed without any Web-ContextPath-Header?

             

            Thanks in advance

             

            Chris

            • 3. Re: How to use session replication in domain mode and OSGi?
              thomas.diesler

              Session replication is a concept from JavaEE, not from OSGi.

               

              As I suggested above, I would try to get it to work without OSGi first (i.e. plain war, ejb3). If that works make your deployments OSGi bundles - it should continue to work.