JBoss/EC2上的EHCache RMI复制抛出java.RMI.NoSuchObjectException:表中没有这样的对象
正在尝试在Amazon EC2上的2台JBoss 4.2服务器之间创建基于EHCache RMI的缓存复制。目前,这被设置为手动对等发现,具有从Server2到Server1的单向复制 配置如下: 服务器1JBoss/EC2上的EHCache RMI复制抛出java.RMI.NoSuchObjectException:表中没有这样的对象,jboss,replication,rmi,ehcache,Jboss,Replication,Rmi,Ehcache,正在尝试在Amazon EC2上的2台JBoss 4.2服务器之间创建基于EHCache RMI的缓存复制。目前,这被设置为手动对等发现,具有从Server2到Server1的单向复制 配置如下: 服务器1 <cacheManagerPeerProviderFactory class="net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory" properties="peerDiscovery=manual"
<cacheManagerPeerProviderFactory
class="net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory"
properties="peerDiscovery=manual"/>
<cacheManagerPeerListenerFactory
class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory"
properties="hostName=host1, port=40001,
socketTimeoutMillis=3000"/>
<cache name="cache1"
maxElementsInMemory="0"
eternal="false"
overflowToDisk="true"
timeToIdleSeconds="600"
timeToLiveSeconds="600"
diskPersistent="true"
diskExpiryThreadIntervalSeconds="60"
statistics="true">
<cacheEventListenerFactory
class="net.sf.ehcache.distribution.RMICacheReplicatorFactory"
properties="replicatePuts=false, replicateUpdates=false,
replicateRemovals=false"/>
</cache>
我还将Server2作为一个独立的Java程序(使用与上面所示相同的ehcache.xml)而不是JBoss服务器进行了尝试。但只要Server1是JBoss服务器,我就会看到这个例外
如果我在同一台主机上部署Server1和Server2(JBoss或Java程序),效果会很好。但一旦我把它们移到不同的主机上,它就死在我身上了
任何帮助都将不胜感激。谢谢…java.rmi.NoSuchObjectException表示存根引用的对象当前未导出。它一定是在某个时候导出的,否则就没有存根了。可能是垃圾收集,首先是DGC,然后是本地GC。您可以通过在静态变量中保留对远程对象(不是存根)的引用来防止这种情况。但似乎相关的远程对象不是您的对象,而是他们的对象,在这种情况下,您需要找到他们的错误报告系统。
java.rmi.NoSuchObjectException
表示存根引用的对象当前未导出。它一定是在某个时候导出的,否则就没有存根了。可能是垃圾收集,首先是DGC,然后是本地GC。您可以通过在静态变量中保留对远程对象(不是存根)的引用来防止这种情况。但似乎远程对象不是你的而是他们的,在这种情况下,你需要找到他们的bug报告系统
<cacheManagerPeerProviderFactory
class="net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory"
properties="peerDiscovery=manual,
rmiUrls=//host1:40001/cache1"/>
<cacheManagerPeerListenerFactory
class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory"
properties="hostName=host2, port=40002,
socketTimeoutMillis=3000"/>
<cache name="cache1"
maxElementsInMemory="0"
eternal="false"
overflowToDisk="false"
timeToIdleSeconds="7200"
timeToLiveSeconds="7200">
<cacheEventListenerFactory
class="net.sf.ehcache.distribution.RMICacheReplicatorFactory"
properties="replicateAsynchronously=false"/>
</cache>
Jul 10, 2012 3:25:37 PM net.sf.ehcache.distribution.RMISynchronousCacheReplicator replicatePutNotification
SEVERE: Exception on replication of putNotification. no such object in table. Continuing...
java.rmi.NoSuchObjectException: no such object in table
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:255)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:233)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:142)
at net.sf.ehcache.distribution.RMICachePeer_Stub.put(Unknown Source)
at net.sf.ehcache.distribution.RMISynchronousCacheReplicator.replicatePutNotification(RMISynchronousCacheReplicator.java:149)
at net.sf.ehcache.distribution.RMISynchronousCacheReplicator.notifyElementPut(RMISynchronousCacheReplicator.java:132)
at net.sf.ehcache.event.RegisteredEventListeners.notifyListener(RegisteredEventListeners.java:294)
at net.sf.ehcache.event.RegisteredEventListeners.invokeListener(RegisteredEventListeners.java:284)
at net.sf.ehcache.event.RegisteredEventListeners.internalNotifyElementPut(RegisteredEventListeners.java:144)
at net.sf.ehcache.event.RegisteredEventListeners.notifyElementPut(RegisteredEventListeners.java:122)
at net.sf.ehcache.Cache.notifyPutInternalListeners(Cache.java:1515)
at net.sf.ehcache.Cache.putInternal(Cache.java:1490)
at net.sf.ehcache.Cache.put(Cache.java:1417)
at net.sf.ehcache.Cache.put(Cache.java:1382)