3 Replies Latest reply on Jul 21, 2011 9:21 AM by nimo22

    classloading question

    nimo22

      Hello,

       

      for example:

       

      I have this in jboss-deployment-structure.xml:

       

      <dependencies>

      <module name="org.apache.commons.beanutils" />

      </dependencies>

       

      So I have added the dependency "commons.beanutils".

       

      If "commons.beanutils" would have a internal dependency to "commons.logging", did the jboss classloader add the transitive dependency of "commons.logging" to the classpath of my application war or only to the classpath of the module "commons.beanutils"? If I would add this:

       

      <dependencies>

      <module name="org.apache.commons.beanutils" />

      <module name="org.apache.commons.logging" slot="3.1" />

      </dependencies>

       

      then jboss-classloader added the logging version 3.1 to my classpath and the logging version which is needed by beanutils and which can differ from slot 3.1 to the classpath of commons.beanutils, am I right?

        • 1. Re: classloading question
          jaikiran

          What's the question?

           

          EDIT: Now that you edited your first post, my reply makes no sense.

          • 2. Re: classloading question
            nimo22

            Okay, I have checked it and saw that in modules.xml of "org.apache.commons.beanutils" :

             

            <module xmlns="urn:jboss:module:1.0" name="org.apache.commons.beanutils">

                <resources>

                    <resource-root path="commons-beanutils-1.8.0.jar"/>

                    <!-- Insert resources here -->

                </resources>

             

                <dependencies>

                    <module name="org.apache.commons.logging"/>

                </dependencies>

            </module>

             

             

            So beanutils loads logging, but, luckily, my app (which is also treated as a module) does not have access to logging. I have to use another explicit dependency to logging, if I want to access its api - this is really cool! So no dependency hell, anymore;)

            • 3. Re: classloading question
              nimo22

              yes, sorry for that. I accidentally pressed STRG+S while writing the first post..my blame.