使用Ehcache缓存同步启动时抛出异常net.sf.ehcache.CacheException: Can't assign requested address

本文档详细介绍了在使用Ehcache缓存并采用RMI通过UDP同步数据时,遇到的`net.sf.ehcache.CacheException: Can't assign requested address`异常。该异常出现在Macbook Pro的无线内网环境中,由于Java虚拟机默认使用IPv6接口,而配置的是IPv4的广播端口。解决方法是在启动JVM时指定使用IPv4网络接口,添加参数`-Djava.net.preferIPv4Stack=true`。
摘要由CSDN通过智能技术生成
问题:在使用Ehcache缓存,采用RMI(UDP传输协议)进行数据广播同步,启动项目时报异常: net.sf.ehcache.CacheException: Can’t assign requested address
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cacheManagerFactory' defined in class path resource [app-ehcache.xml]: Invocation of init method failed; nested exception is net.sf.ehcache.CacheException: Can't assign requested address
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1553)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
    
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值