2 Replies Latest reply on Jul 16, 2004 8:17 AM by 101

    Classloader used to deploy *-ds.xml files

    101 Newbie

      I'm using ear scooped loader repositories, with Jboss 3.2.3. I need to separate my ear form other deployments, and that's the only way I know to do this.

      My problem is that when I have a *-ds.xml (hibernate stuff) in the ear, and jboss processes (deploys) the xml, then it's not using the ear scooped loader repository but instead the standard one (probably the one that loaded hibernate.rar).

      This prevents the datasource from proper operation, because my user classes needed by hibernate are isolated inside the loader repository.

      To overcome this I have to add hibernate.rar into the ear, but then i have another problem: i have two ear's and one depending on the other. Both need hibernate.rar but i can't put hibernate.rar in both ear's because jboss fails with an already registered resource adapter error.

      So i'm stuck... the only solution would be if JBoss would use the classloader that loaded the *-ds.xml to initialize the datasource. If i understand everything, then it could work because an ear scooped loader repository sees the stuff coming from the deploy directory, too. (So both ears would see hibernate classes coming from a single hibernate.rar deployed next to the ears)

      If it doesn't work, then maybe jboss could tolerate duplicate rar registrations coming from isolated ears?

      As a sidenote: i've got another similar issue with two war's in a single ear seeing each other's classes (due to an ear scoopend loader repository). I can't set a parameter that the war's should check their own classloaders/scoops and only ask for the parent when a class is not found. But I will ask it on a different forum.

      Thanks in advance,

      - 101

      PS: sorry for the hijack, will open new topics from now on.

        • 1. Re: Classloader used to deploy *-ds.xml files
          Adrian Brock Master

          Hmm. Why doesn't hibernate.rar or hibernate use the Thread's context classloader?

          You can resolve the MBean name conflict by changing the <display-name>
          and <adapter-display-name> for one deployment.
          JBoss4 has a better way to avoid this confict.

          Your sidenote should be the HTTPD forum.
          Please stick to one question <-> one thread so that others can find/follow the solutions.
          But look in jbossweb-xxx.sar/META-INF/jboss-service.xml

          • 2. Re: Classloader used to deploy *-ds.xml files
            101 Newbie

            It was a user bug... :)

            Hibernate does use the Thread's classloader first, except when loading it's properties. So copying the properties to the conf dir solved the issue.

            But thanks for the info, it's helped to understand things better!

            I owe you a beer, now you only need to visit Hungary once! :)