3 Replies Latest reply on Jul 31, 2008 1:24 PM by sam khan

    .ear classloading

    sam khan Newbie

      Hi,

      Is it possible to specify in which order JBoss loads classes? The application on which I am working is deployed as an exploded .ear. There is an APP-INF folder under which resides both 'classes' and 'lib' folders. I'd like JBoss to load classes from the 'classes' folder before the 'lib' folder. The reason why is that I have configured my Eclipse output folder to write to the 'classes' folder - obviously I'd like those files/changes to be picked up first. I have confirmed that at present JBoss is looking in the 'lib' folder and NOT scanning the 'classes' folder - I guess my first problem is getting JBoss to scan the 'classes' folder!

      Perhaps I am barking up the wrong tree and I shouldn't even consider writing directly to the 'classes' folder from Eclipse?

      Regards.

        • 1. Re: .ear classloading
          sam khan Newbie

          Sorry, forgot to mention am using version 4.0.2 but have the option to move to version 4.2 if that would make like easier.

          Thanks.

          • 2. Re: .ear classloading
            jaikiran pai Master

             

            "samkhanski" wrote:
            There is an APP-INF folder under which resides both 'classes' and 'lib' folders.


            The APP-INF is probably is WebLogic server specific folder. It won't be recognized by JBoss (or maybe even any other servers).

            To understand how classloading works in JBoss, see these:

            http://wiki.jboss.org/wiki/JBossClassLoadingUseCases

            http://wiki.jboss.org/wiki/ClassLoadingConfiguration

            "samkhanski" wrote:

            forgot to mention am using version 4.0.2 but have the option to move to version 4.2 if that would make like easier.


            If you have an option, then its always better to start off with the latest stable version of any application, that you are using. The latest stable version of JBoss is 4.2.3 GA.


            • 3. Re: .ear classloading
              sam khan Newbie

              Thanks for your reply. I guess I'm more interested in where JBoss looks for classes to load, rather than how it goes about loading them. What dirs does it look in first if:

              1.) It is deploying a .ear
              2.) There is an ejb module in that .ear

              My understanding is that the Manifest.mf file in the ejb module can (should?) specify the required classpath. I've tried adding 'APP-INF/classes' as the initial entry to the 'CLASS-PATH' statement in the manifest - but no luck. I've also removed all existing references to 'APP-INF/lib' in the manifest and the ejb still goes looking in APP-INF/lib for the classes it requires. It seems the path 'APP-INF/lib' is hardwired in JBoss as a place to look for classes. So, can I add APP-INF/classes as the initial place for JBoss to look? If not, what other directory can I use where JBoss will look before delving into APP-INF/lib?

              Thanks.