[ mx4j-Bugs-847322 ] NotificationBroadcasterSupport error/failed remote listener

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

Category: JMX implementation
>Group: Release 2.0.0
>Status: Closed
>Resolution: Invalid
Priority: 5
Submitted By: Aaron Mulder (ammulder)
>Assigned to: Simone Bordet (biorn_steedom)
Summary: NotificationBroadcasterSupport error/failed remote listener

Initial Comment:
I have a NotificationListener of type Remote that is
registered with an MBeanServer in a remote VM.  When I
shut down the VM that the listener is in, this leaves
the server VM with a disconnected stub.  The
NotificationBroadcasterSupport class does not handle
this gracefully.

    [java] Caused by:
java.lang.reflect.UndeclaredThrowableException
    [java]      at $Proxy0.hashCode(Unknown Source)
    [java]      at
mx4j.server.interceptor.NotificationListenerMBeanServerInterceptor$ListenerWrapper.hashCode(NotificationListenerMBeanServerInterceptor.java:67)
    [java]      at java.util.HashMap.hash(HashMap.java:261)
    [java]      at
java.util.HashMap.putForCreate(HashMap.java:404)
    [java]      at
java.util.HashMap.putAllForCreate(HashMap.java:425)
    [java]      at
java.util.HashMap.clone(HashMap.java:656)
    [java]      at
javax.management.NotificationBroadcasterSupport.sendNotification(NotificationBroadcasterSupport.java:257)

It looks like the calculation of the HashCode fails for
the disconnected stub, and this is not one of the
operations that the NotificationListener it prepared
for failure on.

Additionally, I'd ideally like some way to cause the
failed listener to be removed automatically, so this
exception doesn't crop up on every notification forever
more.  Unfortunately, there's no apparent way from the
outside to determine exactly which NotificationListener
failed, so I think perhaps this must be done
automatically within NotificationBroadcasterSupport.


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

>Comment By: Simone Bordet (biorn_steedom)
Date: 2003-12-14 00:05

Message:
Logged In: YES 
user_id=128193

Aaron,
I am reluctant to add this functionality to
NotificationBroadcasterSupport, mainly for 2 reasons:
1. It is possible to subclass NBS and override
sendNotification() or handleNotification() to manage special
listeners.
2. JSR 160 has gone in a direction where remote listeners
are handled by the implementation so that they are not
implementing any java.rmi.Remote semantic.

Sure I am biased, but I think JSR 160 solution for remote
listeners has some edge on solutions that use
java.rmi.Remote semantic for the listeners.

I am open to discussion on this issue that I find very
interesting if you are on a different position, for example
via email.

I am closing this bug as invalid, being intended you can
reopen it if you think this resolution is not appropriate.

Thanks,

Simon

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

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


-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
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.