4 Replies Latest reply on Feb 28, 2003 1:57 AM by Marco Dubbeld

    Scoped deployment for SARs?

    Chris Kimpton Newbie

      Hi,

      I don't want to share classes between 2 mbeans. They rely on different (incompatible) versions of a 3rd party jar.

      Is it possible to have scoped deployment of SARs so that they don't see each others jars?


      I have tried using the scoped ear <loader-repository> element in my META-INF/jboss-app.xml.

      <jboss-app>
      <loader-repository>user123:loader=abc123</loader- repository>
      </jboss-app>

      But this seems to be cause the deployment to hang - failed to find deployer.

      I am assuming that the name above needs to be unique and that jboss will then create a specific classloader for that name...

      Thanks,
      Chris

        • 1. Re: Scoped deployment for SARs?
          Adrian Brock Master

          From discussions on the dev-list this should be
          fully supported by 3.2 final at the moment the top
          level must be an ear.

          Here's an example from the testsuite for a sar inside an
          ear with a loader-repository.

          <jboss-app>
          <loader-repository>jboss.test.cts:loader=cts-cmp2v2-sar.ear</loader-repository>

          cts-v2cmp.sar

          </jboss-app>

          Regards,
          Adrian

          • 2. Re: Scoped deployment for SARs?
            Marco Dubbeld Newbie

            Is it there for the SAR in 3.2.0RC2??????

            • 3. Re: Scoped deployment for SARs?
              Pratik Patel Newbie

              A similar question:

              I have two SARs providing the same type of service but using two different database backends, and different versions of some classes.

              I would like to deploy two WARs to provide a front-end for each one of these services. the WARs containing the respective versioned classes for the service it is associated with.

              APP A: SAR A (contains JAR X) <--> WAR A (contains JAR X)
              APP B: SAR B (contains JAR Z) <--> WAR B (contains JAR Z)

              What is the best way to deploy this in a single instance of JBoss?

              Now, I am somewhat familiar with the CL structure in JBoss, so I know why I get a ClassCastException when I deploy just APP A with SAR A and WAR A in separate EARs with <load-repository> set for each... it is trying to load the "local" version of the JAR's classes in the Webapp, thus throwing the CCE. I fixed this by putting JAR A in deploy/ and removing it from the SAR/WAR files. This, of course, means that there's no point in using the <load-repository> as now my JAR A is on the UCL.

              So... is it possible to fetch an _object_ that has been created in one CL from another CL containing the same _class_? In other words, is it possible to have the same JAR, in two separate loader-repositories (CL's), and the object can be fetched across the CL's without throwing a ClassCastException? I am using a MBeanServer.getAttribute() to get a handle on the object in SAR A.....

              cheers
              prp

              • 4. Re: Scoped deployment for SARs?
                Marco Dubbeld Newbie

                Should work when you deploy Jar A only once in the scope of application A. So only in the SAR or EAR, not in WAR.
                Jar A will be found in WAR A through scoped repository.

                Same for App B