1 Reply Latest reply on Mar 11, 2011 11:31 AM by lil_z420

    Remote MBean invocation classpath issue

    lil_z420

      I am currently upgrading our AS from 4.0.5 to 6.0. We currently have an ear with a mbean packaged in a sar. We also have a war that is packaged outside the ear that is used by the remote clients using a servlet and JNLP.

       

      The issue I am having is when I am remotely invoking the mbean (using MBeanServerConnection)and passing a shared object (a class that is package in a jar that is in both the ear and war) as a parameter, the server is throwing a ClassNotFoundException during the unmarshalling. I've debugged it on the server and noticed that the server is looking up the classloader based on the object name. The problem is that is returning the default classloader and not the classloader of the ear.

       

      Other calls to the mbean passing primitives works fine as well as calls that return shared objects (since the classpath on the client has the shared objects)

       

      I've looked and looked and cannot figure out what to configure to get the classloader lookup to use the classloader of the ear. Any ideas? This currently works on our 4.0.5 AS.

       

      I've tried using the classloading configuration found here by having the ear and war share a loader-repository but that also did not work. Any other suggestions would be great.