0 Replies Latest reply on Apr 23, 2003 11:18 AM by Merv Newell

    Remote notification listener

    Merv Newell Newbie


      I have been testing functionality of MBeans and have run into a problem that I can't seem to get around.

      I have created an MBean that allows for a variable to be updated and then broadcast a notification that the variable has been updated. I then created one client that calls a method to update the variable. I then created a second client that creates a RemoteMBeanServer and adds a notification listener to capture the notifications.

      This all works fine. The problem occurs if the RemoteListener app is not shut down properly, say the app is terminated, the "removeConnection" method is never called at which point the client app the does the update gets a error everytime the update is called. The error is that it can't connect to the IP of the RemoteListener. Even if I stop and start both the client that does the update and the remotelistener client I still get the same can't connect error.

      It appears that the client will always go back to that instance of the remote listener that it was originally connected too, even though it is no longer valid.

      Hopefully I explained this well enough, its kind of involved trying to explain.

      Does anybody have any ideas?


      Error message from client
      IP is where the RemoteListener application was running.

      RuntimeMBeanException: RuntimeException in MBean operation 'updateUserName(,java
      Cause: org.jboss.util.NestedRuntimeException: Connection refused to host: 10.1.1
      .101; nested exception is:
      java.net.ConnectException: Connection refused: connect; - nested throwab
      le: (java.rmi.ConnectException: Connection refused to host:; nested e
      xception is:
      java.net.ConnectException: Connection refused: connect)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
      at org.jboss.jmx.adaptor.rmi.RMIAdaptorImpl.invoke(RMIAdaptorImpl.java:2
      at sun.reflect.GeneratedMethodAccessor63.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      at java.lang.reflect.Method.invoke(Method.java:324)
      at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
      at sun.rmi.transport.Transport$1.run(Transport.java:148)
      at java.security.AccessController.doPrivileged(Native Method)
      at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
      at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:4
      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport
      at java.lang.Thread.run(Thread.java:536)
      at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Stream
      at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:
      at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:133)
      at org.jboss.jmx.adaptor.rmi.RMIAdaptorImpl_Stub.invoke(Unknown Source)
      at Client.updateUserName(Client.java:108)
      at Client.doMainLoop(Client.java:58)
      at Client.main(Client.java:38)