3 Replies Latest reply on Jun 26, 2003 3:06 AM by frito

    loading different versions of same class

    rjst

      I'm trying to load two different versions of the same class, each in it's own EAR.

      Apparently, after jboss loads the first class, it uses it for the second application, resulting in class UID errors.

      My questions are :

      -Is this the expected behavior ? If so why ?
      -How can I change it ?

      thanks
      Ricardo Trindade

        • 1. Re: loading different versions of same class
          raja05

          Yes, this is an expected behaviour. JBoss uses a Unified Classloader approach where all the classes are stored in a flat directory package irrespective of their individual deployment units. If you have multiple versions of the same class, scope each ear file by adding a jboss-app.xml
          with these entries in it.
          <jboss-app> <loader-repository>:loader=myfile.ear</loader-repository> </jboss-app>

          See more info in the Admindevel guide(paid docs) for Scoping.

          -Raj

          • 2. Re: loading different versions of same class
            dlds

            Adding the jboss-app.xml to the ear file does the trick.
            But what if I want to scope several subpackages in the
            ear file. I have looked into the jboss-app dtd and only
            one loader-repository element can be used.

            Also have another question. What are the module elements for ?

            Regards,

            Daniel Santos

            • 3. Re: loading different versions of same class
              frito

              The loader-repository tag can be used with every deployment in your jboss specific deployment descriptor like jboss.xml, jboss-web.xml or jboss-app.xml .

              Don't ask me about the module tag. All I know is mentioned in the dtd ;-)

              Greetings,
              Frito