NoSuchObjectException exception in RMI
2006-08-10 02:35
417 查看
If you are using RMI calling, this exception java.rmi.NoSuchObjectException maybe come up after network failed.
Perhaps the root causation is an issue(or bug) of RMI: the binded implement object has been GCed by DGC protocol.
we can reference this URL for detail:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4114579
To reproduce this failure, we can break down the network connection on a Server for a while, then restore
network and execute :
interface = Naming.lookup();
interface.methodName(); // NoSuchObjectException will throw out
To resolve this problem, you can add two classes RMIHelper, ServiceObjectKeeper to encapsulate RMI calling,
and replace all old calling
Naming.rebind() with RMIHelper.rebind(), Naming.bind() with RMIHelper.bind().
Thus will hold a strong reference to the remote object in the local VM.
The following content is picked up from J2SDK, it point out Java have a hidden trouble on this topic.
Note that if a network partition exists between a client and a remote server object, it is possible that premature collection
of the remote object will occur (since the transport might believe that the client crashed). Because of the possibility of premature collection, remote references cannot guarantee referential integrity; in other words, it is always possible that a remote reference
may in fact not refer to an existing object. An attempt to use such a reference will generate a
--- From J2SDK 1.4.1
Java Remote Method Invocation – 3.3 Garbage Collection of Remote Objects
Perhaps the root causation is an issue(or bug) of RMI: the binded implement object has been GCed by DGC protocol.
we can reference this URL for detail:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4114579
To reproduce this failure, we can break down the network connection on a Server for a while, then restore
network and execute :
interface = Naming.lookup();
interface.methodName(); // NoSuchObjectException will throw out
To resolve this problem, you can add two classes RMIHelper, ServiceObjectKeeper to encapsulate RMI calling,
and replace all old calling
Naming.rebind() with RMIHelper.rebind(), Naming.bind() with RMIHelper.bind().
Thus will hold a strong reference to the remote object in the local VM.
The following content is picked up from J2SDK, it point out Java have a hidden trouble on this topic.
Note that if a network partition exists between a client and a remote server object, it is possible that premature collection
of the remote object will occur (since the transport might believe that the client crashed). Because of the possibility of premature collection, remote references cannot guarantee referential integrity; in other words, it is always possible that a remote reference
may in fact not refer to an existing object. An attempt to use such a reference will generate a
RemoteExceptionwhich must be handled by the application.
--- From J2SDK 1.4.1
Java Remote Method Invocation – 3.3 Garbage Collection of Remote Objects
相关文章推荐
- java.rmi.NoSuchObjectException: no such object in table
- Spring RMI java.rmi.NoSuchObjectException: no such object in table
- 奋斗了n(n>7)小时,终于解决了连接远程JMS JNDI的问题:java.rmi.NoSuchObjectException: no such object in table
- java.rmi.NoSuchObjectException: no such object in table
- java.rmi.NoSuchObjectException: no such object in table异常问题解析
- RMI no such object in table异常
- 连接远程JMS JNDI的问题:java.rmi.NoSuchObjectException
- elasticsearch 报出 Exception in thread "main" java.lang.NoSuchFieldError: LUCENE_3_6
- 解决:Redis:java.util.NoSuchElementException: Unable to validate object at
- java中Exception in thread "main" java.util.NoSuchElementException
- Exception in thread "main" java.lang.NoSuchFieldError: level
- Exception in thread "main" java.lang.NoSuchFieldError: INSTANCE
- hive Exception in thread "main" java.lang.NoSuchFieldError: type
- java.util.NoSuchElementException: Timeout waiting for idle object
- jedis异常:NoSuchElementException: Timeout waiting for idle object
- jedis异常 NoSuchElementException Timeout waiting for idle object
- java.util.NoSuchElementException: Timeout waiting for idle object
- Exception in thread "main" java.util.NoSuchElementException
- Exception in thread "main" java.lang.NoSuchFieldError的 一种解决办法
- [解决方法]org.dbunit.dataset.NoSuchTableException: Did not find table 'tab1' in schema 'null'