1

我正在尝试在单台机器上运行两个节点 ehcahe 集群。我在机器上创建了两个 tomcat 实例,并使用标准的手动对等机制来复制缓存。我在一个应用程序中的 ehcahe .xml 是

<cacheManagerPeerProviderFactory     class="net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory"

properties="peerDiscovery=manual, rmiUrls=//172.19.1.99:50002/messageCache|//172.19.1.99:50002/messagesCache" />

 <cacheManagerPeerListenerFactory class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory"

属性=“主机名=本地主机,端口=40001,socketTimeoutMillis=12000” />

<defaultCache eternal="true" maxElementsInMemory="100" overflowToDisk="false" />

<cache name="messagesCache" maxElementsInMemory="10" eternal="true" overflowToDisk="false">
<cacheEventListenerFactory
   class="net.sf.ehcache.distribution.RMICacheReplicatorFactory"
   properties="replicateAsynchronously=true, replicatePuts=true, replicateUpdates=true,
                        replicateUpdatesViaCopy=false, replicateRemovals=true " />
  <bootstrapCacheLoaderFactory class="net.sf.ehcache.distribution.RMIBootstrapCacheLoaderFactory" />
 </cache>

在第二台服务器上的端口被互换,但是当我运行这个应用程序时。我总是收到此异常 WARN [net.sf.ehcache.distribution.RMIAsynchronousCacheReplicator]: Unable to send message to remote peer。消息是:RemoteException 在服务器线程中发生;嵌套异常是:java.rmi.UnmarshalException:错误解组参数;嵌套异常是:java.lang.ClassNotFoundException: com.ehcache.nagarroRMI.model.Message(无安全管理器:RMI 类加载器已禁用)

4

0 回答 0