I’m trying to write a module in order to manage application streams through JMX calls.
Everything works fine using JConsole and invoking methods that accept/return String values or primitive data types.
However, if I have a method that returns (serializable) playlist item objects, then I get the following error:
java.rmi.UnmarshalException: error unmarshalling return; nested exception is: java.lang.ClassNotFoundException: mypkg.MyPlaylistItem (no security manager: RMI class loader disabled).
I tried in a server listener to set a SecurityManager as follows:
if (System.getSecurityManager() == null) System.setSecurityManager(new SecurityManager());
but in this way JConsole refuses to connect.
Could anybody help me? Thanks!