1 Reply Latest reply on Feb 6, 2005 1:37 PM by John Leveille

    classloader crossing into another jar?

    John Leveille Newbie

      Hi there. I am running JBoss 3.2.3 on Windows XP under Java 1.4.1. I deployed my app one day and then said ... hey, I want to deploy another version of my app ...

      So I copied the war, renamed it, and threw it in the deploy directory (with some property file changes to point to a different database). To my surprise, it pointed at the same database as my previous app.

      So I began to think that I had some confusion among static classes. Maybe I was crossing over into a static class in my primary version of the app. But then I decided to deploy the second app without the classes in it. To my shock and amazement, it ran!

      I continued down this path by creating a simple app that loaded a prop file and printed the contents. I copied the app and made the two wars have different prop files. I eliminated the statics I was using (expcept for the JRE internals, of course -- no idea what they are doing) and I ran the test.

      The result was that I cannot get these two apps to print different properties.

      Is this a defect in JBoss or am I too dense to keep from clobbering myself with overlapping code? TIA.

        • 1. Re: classloader crossing into another jar?
          John Leveille Newbie

          After some searching I found my own answer. It turns out to be the default behavior of the JBoss Unified Class Loader (UCL). I found a discussion thread about it here


          Basically, it turns out that JBoss tried to make some things easier and ended up with some unexpected behavior list wars and ears that can read each others classes, jars, properties, etc. This caused a real problem for me when I tried to deploy to nearly-similar versions of the same web app in two diferent war files.

          I am going to try the recommendations provided in the thread I referenced since I am using JBoss 3.2.3 and see if they work.