We are using JMX for communication between different EARs on the same Websphere application server (6.1). All works well if we only use Java types as arguments, but if we use our own classes as arguments the problem is that we get ClassCastExceptions on the receiver side. This is obviously a classloader problem: if the jar with the argument types is put into the JRE endorsed directory, such that all classloaders use exactly the same class, the exceptions disappear. But we would much prefer to put the library that defines the argument types in the EAR itself.
Now my question: is there a trick to persuade WAS to serialize and deserialize the arguments during the JMX call I guess in this case the ClassCastException would dissappear.