PDA

View Full Version : RMI class loader disabled


willwright
Jun 15th, 2006, 05:44 AM
Trying to expose an object over JMX but I'm getting security issues when I try and expose objects in my codebase. I understand that I probably need to set up a security manager and explicitly expose these objects over RMI but shouldn't this be done for me by the spring configuration as I explicitly define the objects/methods I'm exposing?

Error I get follows:

Problem invoking getStatus : java.rmi.UnmarshalException: error unmarshalling return; nested exception is: java.lang.ClassNotFoundException: com.bla.bla.Feed$Status (no security manager: RMI class loader disabled)

Thanks for any pointers!

gthiabaud
Jun 28th, 2007, 04:37 AM
http://forum.java.sun.com/thread.jspa?threadID=761394&messageID=4346325

Regards

Joris Kuipers
Jul 3rd, 2007, 08:45 AM
You'll only get this error if the classes that are serialized over JMX aren't present at the client side. Instead of using an RMI ClassLoader, you can also just include the classes in your JMX client.

If you're using JConsole, you can start it up like this to add some jars to its classpath (replace the paths to point to your local SDK):

jconsole -J-Djava.class.path=c:\java\jdk1.6.0_01\lib\jconsole. jar;c:\java\jdk1.6.0_01\lib\tools.jar;c:\path\to\l ocal.jar


That means, always include jconsole.jar and tools.jar and then include your own.