2 Replies Latest reply on Apr 21, 2005 6:56 PM by jofi

    Classloading and WS

    jofi

      I have an application deployed inVM through a simple JMX wrapper. The application itself deploys its own modules from a repository independent of jboss, lets say: c:\myapp\deploy.

      To get this working i add the urls to the modules in myapp\deploy to the mbeans RepositoryClassLoader, and set that classloader to load the myapp modules. So far so good.

      The myapp application registers itself in jndi, to be accessible locally from a sessionbean used as a web service endpoint. This session bean exists in its own jar file in default\deploy.

      When running a test ws client it complains on not finding a classloader for the object returned by a jndi lookup to myapp.

      I may have misunderstood but it seems just adding urls to the cl repository is just not enough...

      Any suggestions?

      (jboss 4.0.1 sp1, default configuration)

        • 1. Re: Classloading and WS
          thomas.diesler

          Have you enabled trace level debugging on the classloading? Does the loader repository see the URLs that you are trying to load classes from? There is no scoping of loader repositories, right?

          • 2. Re: Classloading and WS
            jofi

            Well, fist of all i've discoverd i've been a lousy spec.reader (not the first time: )) - the .ear packaging should make it possible for me to set up a shared classpath through the manifest. Any how; i didnt get it to work so i continued on the classloader path letting my application use the jboss repositoryloader and add my external jars there using the addURL(..) method. Since all the jboss deployed modules 'kind of' share the same classes in a repository, i could now make applications see the external jars. I couldnt add the external jars using another classloader, since they would have been loaded twice.

            What i really wantet was to add the hole classloader (my apps orginal urlclassloader) to the jboss loader hierarchy using the addclassloader method, but i've not got it to work properly.

            So it looks like i've solved it - in a way. I'm not sure if its possible to do it another way (like setting classpath in descriptors of .MFs), since mye embedded mbean app rely on loading its modules from a different location in a controlled matter.

            Ideally i would have accessed the embedded application through some local jndi registry - if such exists (i would guess so)...just to get it work i created a simple static class holding the local reference i needed.

            I'm also not sure if this has evolved to be the right forum - since this is not really about WS :-)