ehcache使用自动发现的方式配置了集群,测试字符串缓存同步都正常,但是缓存的对象无法同步,这是为什么呢?
 配置信息
 <cacheManagerPeerProviderFactory class="net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory"
                                      properties="peerDiscovery=automatic, multicastGroupAddress=230.0.0.1,multicastGroupPort=4446, timeToLive=0"/>
 
 
     <!--  hostName不可配置为127.0.0.1 -->
     <cacheManagerPeerListenerFactory
             class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory"
             properties="hostName=localhost, port=40001,socketTimeoutMillis=2000"/>
 
 A机器执行:
 Element element1 = new Element("key", "A Server update");
 cache.put(element1);
 B机器可以根据key查询到正确的结果 
 A机器执行:
 Dictionary dic = new Dictionary("A server update dictionary");
 Element element1 = new Element("dictionary", dic );
 cache.put(element1);
 B机器没能更新缓存。对象类型不能进行集群吗?Dictionary已经继承Serializable,也写了serialVersionUID。 
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。