This discussion is archived
3 Replies Latest reply: Jun 7, 2010 5:27 PM by 843798 RSS

Unable to add non-serializable NotificationListener to remote MBean

843798 Newbie
Currently Being Moderated
I'm using OpenDMK v1.0b2 and am trying to add a notification listener to a remote MBean that was mounted via the CascadingService. I'm getting a NotSerializableException from the cascading proxy and can't figure out how to get around that problem. My agent application mounts MBeans from a JVM on a differerent computer using the cascading service. I need to register a listener for notifications from one of the remote MBeans that will update information in various files when it receives notifications from the remote MBean. The handles to these files cannot be serialized so I'm at a loss as to how to proceed. What am I doing wrong? How should I be doing this?

Here's a portion of the stack trace that shows the exception:
Caused by: java.io.NotSerializableException: monitor.MyListener
     at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1156)
     at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
     at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
     at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
     at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
     at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
     at com.sun.jmx.remote.generic.ObjectWrappingImpl.wrap(ObjectWrappingImpl.java:70)
     at javax.management.remote.generic.ClientIntermediary.addNotificationListener(ClientIntermediary.java:626)
     at javax.management.remote.generic.GenericConnector$RemoteMBeanServerConnection.addNotificationListener(GenericConnector.java:580)
     at com.sun.jdmk.remote.cascading.proxy.CascadingProxy.addNotificationListener(CascadingProxy.java:575)
     ... 27 more