Remote NotificationFilter with RMIConnector...
janny77 May 14, 2003 9:30 AMHi all,
I'm a newbie and I'm using JBoss 3.2.1.
I have a problem with RMIConnector and the remote notification mechanism. I successfully instantiate a RemoteMBeanServer and added a listener to a remote MBean without using any filter (null in addNotificationListener statement), all works fine and I rightly catch all notifications. But when I try to use a personalized filter I encounter in this exception:
////////////////////////////////////////////////////////////
RuntimeMBeanException: null
Cause: org.jboss.util.NestedRuntimeException: error marshalling arguments; nested exception is:
java.io.NotSerializableException: org.jboss.jmx.connector.TestClient; - nested throwable: (java.rmi.MarshalException: error marshalling arguments; nested exception is:
java.io.NotSerializableException: org.jboss.jmx.connector.TestClient)
at org.jboss.jmx.connector.rmi.RMIConnectorImpl.addNotificationListener(RMIConnectorImpl.java:431)
at org.jboss.jmx.connector.notification.ClientNotificationListener.addNotificationListener(ClientNotificationListener.java:95)
at org.jboss.jmx.connector.notification.RMIClientNotificationListener.(RMIClientNotificationListener.java:54)
at org.jboss.jmx.connector.rmi.RMIConnectorImpl.addNotificationListener(RMIConnectorImpl.java:445)
at org.jboss.jmx.connector.TestClient.run(TestClient.java:136)
at org.jboss.jmx.connector.TestClient.main(TestClient.java:65)
///////////////////////////////////////////////////////////
I used an inline declaration for the filter:
lConnector.addNotificationListener(
myXMBean,
listener,
new NotificationFilter(){
public boolean isNotificationEnabled(Notification notification) {
return true;
}
},
myXMBean
);
I also try to use an explicit external class implementing the filter logic:
class InternalFilter implements NotificationFilter{
public InternalFilter(){}
public boolean isNotificationEnabled(Notification notification) {
return true;
}
}
...
...
lConnector.addNotificationListener(myXMBean,listener,new InternalFilter(),myXMBean);
with a different result...
////////////////////////////////////////////////////////////
RuntimeMBeanException: null
Cause: org.jboss.util.NestedRuntimeException: RemoteException occurred in server thread; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException: org.jboss.jmx.connector.InternalFilter (no security manager: RMI class loader disabled); - nested throwable: (java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException: org.jboss.jmx.connector.InternalFilter (no security manager: RMI class loader disabled))
at org.jboss.jmx.connector.rmi.RMIConnectorImpl.addNotificationListener(RMIConnectorImpl.java:431)
at org.jboss.jmx.connector.notification.ClientNotificationListener.addNotificationListener(ClientNotificationListener.java:95)
at org.jboss.jmx.connector.notification.RMIClientNotificationListener.(RMIClientNotificationListener.java:54)
at org.jboss.jmx.connector.rmi.RMIConnectorImpl.addNotificationListener(RMIConnectorImpl.java:445)
at org.jboss.jmx.connector.TestClient.run(TestClient.java:146)
at org.jboss.jmx.connector.TestClient.main(TestClient.java:65)
////////////////////////////////////////////////////////////
What's wrong???
I known that many improvements will be made in JBoss 4.0 in remoting, but at the moment I need to stay with 3.2!
Thanks