4 Replies Latest reply on Feb 11, 2011 1:32 PM by mrfixit440

    classloading in jboss 4.2.3.ga

    mrfixit440

      I have 2 ears deployed in 4.2.3.ga.  #1 app publishes objects to JMS and #2 app listens on JMS and retrieves them. When I have the associated jars up in app-inf/lib of app #2, I get classcast exceptions during object retrieval.  When I move the associated jars of app#2 into a war file, everything works fine. seems like when they are in app-inf/lib, they are public to jms processes which makes the objects being passed have 2 different classpaths, or something like that.

        • 1. classloading in jboss 4.2.3.ga
          jaikiran

          Dan Rush wrote:

           

          seems like when they are in app-inf/lib, they are public to jms processes which makes the objects being passed have 2 different classpaths, or something like that.

          APP-INF/lib? Are you sure? Because JBoss AS doesn't give any special treatment to such folder.

          • 2. classloading in jboss 4.2.3.ga
            mrfixit440

            Yes I'm sure.  I also have to put an entry in META-INF\application.xml to get my app to see the jar like this:

             

            <module>

                   <java>APP-INF/lib/foo_name.jar</java>

            </module>

             

            maybe that has something to do with it.

            • 3. classloading in jboss 4.2.3.ga
              jaikiran

              Okay, so you have explicitly added the jar in that folder as a java module. Without that, JBoss AS won't even consider that folder to be in classpath.

              • 4. classloading in jboss 4.2.3.ga
                mrfixit440

                OK, currently in this ear, there is 3 war files with empty WEB-INF/lib folders and all the jars they use are in APP-INF/lib with respective application.xml entries like above.  Sounds like this shouldn't be setup like this. Each war should have their own copy of jars in their respective web-inf/lib folder, correct? Thanks for your help