[ mx4j-Bugs-851478 ] NotificationListener when server shutdown

"SourceForge.net" <[email protected]>
Newsgroups gmane.comp.java.mx4j.devel
Message-ID <[email protected]>
Bugs item #851478, was opened at 2003-11-30 09:50
Message generated for change (Comment added) made by biorn_steedom
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=450647&aid=851478&group_id=47745

Category: JSR 160 Implementation
Group: Release 2.0.0
Status: Closed
Resolution: Fixed
Priority: 5
Submitted By: Noah Body (sherington)
Assigned to: Simone Bordet (biorn_steedom)
Summary: NotificationListener when server shutdown

Initial Comment:
Hi,

I've just started using MX4J and remoting.

What I have is a server application (a Swing application) that creates an RMI Server Connector much like the RMI example that ships in the MX4J distribution.

I have an MBean implementation that extends NotificationBroadcasterSupport.

I also have a client application that connects to the server and registers a notification listener. The notification listener simply prints out the Notification to System.out.

Everything works fine, notifications get sent remotely without any problems - until I shut down my server application. When I shut down the server, I get a tight loop of this exception thrown over and over in the client application:

(JDK 1.4.2)

Caught IOException from fetchNotifications
java.rmi.UnmarshalException: Error unmarshaling return header; nested exception is:
        java.io.EOFException
        at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:203)
        at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:133)
        at javax.management.remote.rmi.RMIConnectionImpl_Stub.fetchNotifications(Unknown Source)
        at javax.management.remote.rmi.RMIConnector$1.fetchNotifications(RMIConnector.java:87)
        at mx4j.remote.RemoteNotificationClientHandler$NotificationFetcherThread.run(RemoteNotificationClientHandler.j
ava:287)
        at java.lang.Thread.run(Thread.java:534)
Caused by: java.io.EOFException
        at java.io.DataInputStream.readByte(DataInputStream.java:333)
        at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:189)
        ... 5 more
Caught IOException from fetchNotifications
java.rmi.ConnectException: Connection refused to host: 192.168.0.1; nested exception is:
        java.net.ConnectException: Connection refused
        at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:567)
        at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:185)
        at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:171)
        at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:101)
        at javax.management.remote.rmi.RMIConnectionImpl_Stub.fetchNotifications(Unknown Source)
        at javax.management.remote.rmi.RMIConnector$1.fetchNotifications(RMIConnector.java:87)
        at mx4j.remote.RemoteNotificationClientHandler$NotificationFetcherThread.run(RemoteNotificationClientHandler.j
ava:287)
        at java.lang.Thread.run(Thread.java:534)
Caused by: java.net.ConnectException: Connection refused
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
        at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
        at java.net.Socket.connect(Socket.java:452)
        at java.net.Socket.connect(Socket.java:402)
        at java.net.Socket.<init>(Socket.java:309)
        at java.net.Socket.<init>(Socket.java:124)
        at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:22)
        at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:128)
        at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:562)
        ... 7 more


----------------------------------------------------------------------

>Comment By: Simone Bordet (biorn_steedom)
Date: 2003-12-02 20:05

Message:
Logged In: YES 
user_id=128193

Noah, thanks for promptly trying the fix.
I have fixed the NPE when the environment map is null.
As for Jython, the build goes on without building the Jython
classes; all the rest is built normally.
Great you find the implementation working fine. This beta's
purpose is exactly to fine tune the rough details we did not
work out completely.

----------------------------------------------------------------------

Comment By: Noah Body (sherington)
Date: 2003-12-02 12:46

Message:
Logged In: YES 
user_id=731252

It seems to be fine now, thanks!

(The build fails without a Jython jar file installed even though the "Jython missing" notification seems to suggest it should be OK).

One problem with the new build, I did get an NPE here:

RMIConnector.java(85).

This happens because I invoke the following in my application code (worked in 2.0 beta 1):

JMXConnector connector = JMXConnectorFactory.connect( url );

The factory method passes a null 'environment' parameter and this causes the problem.

And is fixed if I do this instead:

JMXConnector connector = JMXConnectorFactory.connect( url, new HashMap() );

It's not worth me raising a new bug report for such a minor problem and seemingly trivial fix.

Anyway, I would like to add my thanks for such a great implementation. I love it when stuff just (mostly!) works straightaway.

-M.


----------------------------------------------------------------------

Comment By: Simone Bordet (biorn_steedom)
Date: 2003-12-01 19:57

Message:
Logged In: YES 
user_id=128193

It should be fixed in CVS. 
If you can give a try and comment here will be great. You
can find an MX4J fresh CVS checkout every night at
http://mx4j.sf.net/mx4j.tar.gz.
Will be part of the next release.
Thanks !

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=450647&aid=851478&group_id=47745


-------------------------------------------------------
This SF.net email is sponsored by OSDN's Audience Survey.
Help shape OSDN's sites and tell us what you think. Take this
five minute survey and you could win a $250 Gift Certificate.
http://www.wrgsurveys.com/2003/osdntech03.php?site=8
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.