2015-09-01 3 views
1

Вот мой EHCache конфигурации XML на 10.0.110.134 машине:RMI репликации с одноадресной из Ehcache не работает

<cache name="sessionIds" maxElementsInMemory="5000" eternal="false" 
      overflowToDisk="false" timeToIdleSeconds="0" timeToLiveSeconds="0" 
      memoryStoreEvictionPolicy="LRU"> 
<bootstrapCacheLoaderFactory 
      class="net.sf.ehcache.distribution.RMIBootstrapCacheLoaderFactory"/> 

    </cache> 

    <!-- Cluster Configuration --> 

     <cacheManagerPeerProviderFactory 
class="net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory" 
properties="peerDiscovery=manual, 
rmiUrls=//10.0.110.133:40001/sessionIds"/> 


<cacheManagerPeerListenerFactory 
class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory" 
properties="hostName=10.0.110.134, port=40001, 
socketTimeoutMillis=20000"/> 

здесь ошибка у меня после запуска обе машины:

DEBUG ConfigurationFactory - Configuring ehcache from InputStream 
[MyAPP] 01 Sep 2015 12:36:58 DEBUG CacheManager - Creating new CacheManager with Configuration Object 
[MyAPP] 01 Sep 2015 12:36:58 DEBUG PropertyUtil - propertiesString is null. 
[MyAPP] 01 Sep 2015 12:36:58 DEBUG ConfigurationHelper - No CacheManagerEventListenerFactory class specified. Skipping... 
[MyAPP] 01 Sep 2015 12:36:58 DEBUG PropertyUtil - Value found for hostName: 10.0.110.134 
[MyAPP] 01 Sep 2015 12:36:58 DEBUG PropertyUtil - Value found for port: 40001 
[MyAPP] 01 Sep 2015 12:36:58 DEBUG PropertyUtil - Value found for remoteObjectPort: null 
[MyAPP] 01 Sep 2015 12:36:58 DEBUG PropertyUtil - Value found for socketTimeoutMillis: 20000 
[MyAPP] 01 Sep 2015 12:36:58 DEBUG PropertyUtil - Value found for peerDiscovery: manual 
[MyAPP] 01 Sep 2015 12:36:58 DEBUG PropertyUtil - Value found for rmiUrls: //10.0.110.133:40001/sessionIds 
[MyAPP] 01 Sep 2015 12:36:58 DEBUG RMICacheManagerPeerProviderFactory - Registering peer //10.0.110.133:40001/sessionIds 
[MyAPP] 01 Sep 2015 12:36:58 DEBUG RMICacheManagerPeerListener - 0 RMICachePeers bound in registry for RMI listener 
[MyAPP] 01 Sep 2015 12:36:58 DEBUG PropertyUtil - propertiesString is null. 
[MyAPP] 01 Sep 2015 12:36:58 DEBUG Cache - CacheWriter factory not configured. Skipping... 
[MyAPP] 01 Sep 2015 12:36:58 DEBUG ConfigurationHelper - No CacheExceptionHandlerFactory class specified. Skipping... 
[MyAPP] 01 Sep 2015 12:36:58 DEBUG MemoryStore - Initialized net.sf.ehcache.store.NotifyingMemoryStore for sessionIds 
[MyAPP] 01 Sep 2015 12:36:58 DEBUG Cache - Initialised cache: sessionIds 
[MyAPP] 01 Sep 2015 12:36:58 DEBUG RMICacheManagerPeerListener - Adding to RMI listener 
[MyAPP] 01 Sep 2015 12:36:58 DEBUG RMICacheManagerPeerListener - 0 RMICachePeers bound in registry for RMI listener 
[MyAPP] 01 Sep 2015 12:36:58 DEBUG ConfigurationHelper - CacheDecoratorFactory not configured. Skipping for 'sessionIds'. 
[MyAPP] 01 Sep 2015 12:36:58 DEBUG ConfigurationHelper - CacheDecoratorFactory not configured for defaultCache. Skipping for 'sessionIds'. 
[MyAPP] 01 Sep 2015 12:36:58 DEBUG RMIBootstrapCacheLoader - Attempting to acquire cache peers for cache sessionIds to bootstrap from. Will wait up to 0ms for cache to join cluster. 
[MyAPP] 01 Sep 2015 12:36:58 DEBUG RMICacheManagerPeerProvider - Lookup URL //10.0.110.133:40001/sessionIds 
[MyAPP] 01 Sep 2015 12:36:58 DEBUG ManualRMICacheManagerPeerProvider - Looking up rmiUrl //10.0.110.133:40001/sessionIds through exception sessionIds. This may be normal if a node has gone offline. Or it may indicate network connectivity difficulties 
java.rmi.NotBoundException: sessionIds 
    at sun.rmi.registry.RegistryImpl.lookup(RegistryImpl.java:137) 
    at sun.rmi.registry.RegistryImpl_Skel.dispatch(Unknown Source) 
    at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:409) 
    at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:267) 
    at sun.rmi.transport.Transport$2.run(Transport.java:202) 
    at sun.rmi.transport.Transport$2.run(Transport.java:199) 
    at java.security.AccessController.doPrivileged(Native Method) 
    at sun.rmi.transport.Transport.serviceCall(Transport.java:198) 
    at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:567) 
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:828) 
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.access$400(TCPTransport.java:619) 
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler$1.run(TCPTransport.java:684) 
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler$1.run(TCPTransport.java:681) 
    at java.security.AccessController.doPrivileged(Native Method) 
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:681) 
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) 
    at java.lang.Thread.run(Thread.java:745) 
    at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:275) 
    at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:252) 
    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:378) 
    at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source) 
    at java.rmi.Naming.lookup(Naming.java:101) 
    at net.sf.ehcache.distribution.RMICacheManagerPeerProvider.lookupRemoteCachePeer(RMICacheManagerPeerProvider.java:127) 
    at net.sf.ehcache.distribution.ManualRMICacheManagerPeerProvider.listRemoteCachePeers(ManualRMICacheManagerPeerProvider.java:95) 
    at net.sf.ehcache.distribution.RMIBootstrapCacheLoader.listRemoteCachePeers(RMIBootstrapCacheLoader.java:245) 
    at net.sf.ehcache.distribution.RMIBootstrapCacheLoader.acquireCachePeers(RMIBootstrapCacheLoader.java:198) 
    at net.sf.ehcache.distribution.RMIBootstrapCacheLoader.doLoad(RMIBootstrapCacheLoader.java:132) 
    at net.sf.ehcache.distribution.RMIBootstrapCacheLoader$BootstrapThread.run(RMIBootstrapCacheLoader.java:107) 
[MyAPP] 01 Sep 2015 12:36:59 DEBUG RMIBootstrapCacheLoader - cache peers: [] 
[MyAPP] 01 Sep 2015 12:36:59 DEBUG RMIBootstrapCacheLoader - Empty list of cache peers for cache sessionIds. No cache peer to bootstrap from. 
[MyAPP] 01 Sep 2015 12:37:14 DEBUG CacheManager - Attempting to create an existing singleton. Existing singleton returned. 

+0

У вас возникли проблемы с этой проблемой? Я столкнулся с той же проблемой, что и в соответствии с нижеприведенным ответом, все еще не работает. Любая помощь будет принята с благодарностью. Благодарю. – Vimal

ответ

0

Хотя это, вероятно, слишком поздно для OP, сам кэш должен регистрироваться в RMIReplicatorCacheFactory, например.

<cache name="sessionIds" maxElementsInMemory="5000" eternal="false" 
    overflowToDisk="false" timeToIdleSeconds="0" timeToLiveSeconds="0" 
      memoryStoreEvictionPolicy="LRU">  
    <cacheEventListenerFactory class="net.sf.ehcache.distribution.RMICacheReplicatorFactory"/> 
    ... 
</cache> 
Смежные вопросы