1. 程式人生 > >EhCache啟動報Error starting heartbeat. Error was: Can't assign requested addre

EhCache啟動報Error starting heartbeat. Error was: Can't assign requested addre

最近採用EhCache解決分散式快取問題,我的開發筆記本為MacBook PRO,昨天晚上除錯完好的demo程式,今天早上啟動時竟然報以下錯誤:

[2017-04-12 10:35:33,267] 460  [localhost-startStop-1] INFO [org.springframework.cache.ehcache.EhCacheManagerFactoryBean.afterPropertiesSet(EhCacheManagerFactoryBean.java:129)] - Initializing EhCache CacheManager
10:35:33.399 [localhost-startStop-1] ERROR net.sf.ehcache.distribution.MulticastRMICacheManagerPeerProvider - Error starting heartbeat. Error was: Can't assign requested address
java.net.SocketException: Can't assign requested address
	at java.net.PlainDatagramSocketImpl.join(Native Method) ~[?:1.8.0_74]
	at java.net.AbstractPlainDatagramSocketImpl.join(AbstractPlainDatagramSocketImpl.java:178) ~[?:1.8.0_74]
	at java.net.MulticastSocket.joinGroup(MulticastSocket.java:323) ~[?:1.8.0_74]
	at net.sf.ehcache.distribution.MulticastKeepaliveHeartbeatReceiver.init(MulticastKeepaliveHeartbeatReceiver.java:88) ~[ehcache-2.8.2.jar:2.8.2]
	at net.sf.ehcache.distribution.MulticastRMICacheManagerPeerProvider.init(MulticastRMICacheManagerPeerProvider.java:95) [ehcache-2.8.2.jar:2.8.2]
	at net.sf.ehcache.CacheManager.doInit(CacheManager.java:471) [ehcache-2.8.2.jar:2.8.2]
	at net.sf.ehcache.CacheManager.init(CacheManager.java:387) [ehcache-2.8.2.jar:2.8.2]
	at net.sf.ehcache.CacheManager.<init>(CacheManager.java:263) [ehcache-2.8.2.jar:2.8.2]
	at org.springframework.cache.ehcache.EhCacheManagerFactoryBean.afterPropertiesSet(EhCacheManagerFactoryBean.java:157) [spring-context-support-4.2.5.RELEASE.jar:4.2.5.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1637) [spring-beans-4.2.5.RELEASE.jar:4.2.5.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574) [spring-beans-4.2.5.RELEASE.jar:4.2.5.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545) [spring-beans-4.2.5.RELEASE.jar:4.2.5.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482) [spring-beans-4.2.5.RELEASE.jar:4.2.5.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) [spring-beans-4.2.5.RELEASE.jar:4.2.5.RELEASE]
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) [spring-beans-4.2.5.RELEASE.jar:4.2.5.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) [spring-beans-4.2.5.RELEASE.jar:4.2.5.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) [spring-beans-4.2.5.RELEASE.jar:4.2.5.RELEASE]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:753) [spring-beans-4.2.5.RELEASE.jar:4.2.5.RELEASE]
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:839) [spring-context-4.2.5.RELEASE.jar:4.2.5.RELEASE]
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:538) [spring-context-4.2.5.RELEASE.jar:4.2.5.RELEASE]
	at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:444) [spring-web-4.2.5.RELEASE.jar:4.2.5.RELEASE]
	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:326) [spring-web-4.2.5.RELEASE.jar:4.2.5.RELEASE]
	at com.jzq.listener.WebContextListener.initWebApplicationContext(WebContextListener.java:14) [classes/:?]
	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107) [spring-web-4.2.5.RELEASE.jar:4.2.5.RELEASE]
	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4842) [catalina.jar:8.0.36]
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5303) [catalina.jar:8.0.36]
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147) [catalina.jar:8.0.36]
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1407) [catalina.jar:8.0.36]
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1397) [catalina.jar:8.0.36]
	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_74]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_74]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_74]
	at java.lang.Thread.run(Thread.java:745) [?:1.8.0_74]
GOOGLE該錯誤後發現是網路問題所致,才想到昨天晚上開發的時候是通過有線上網的,而今天早上連的是無線。切換為有線網路後,錯誤果然消失。。。

產生這個問題的原因是通過java.net.NetworkInterface.getDefault().獲取預設網路介面的時候得到的是IPv6,以下為英文原文解釋:

This was caused by an IPv6 address being returned from java.net.NetworkInterface.getDefault(). I'm on a Macbook and was using wireless -- p2p0 (used for AirDrop) was returned as the default network interface but my p2p0 only has an IPv6 ether entry [found by running ipconfig]. 

Two solutions, both of which worked for me (I prefer the first because it works whether you are using a wired or wireless connection) 

Start the JVM with -Djava.net.preferIPv4Stack=true. This caused java.net.NetworkInterface.getDefault() to return my vboxnet0 network interface -- not sure what you'll get if you're not running a host-only VM. 
Turn off wireless and use a wired connection
在jvm啟動引數中新增-Djava.net.preferIPv4Stack=true.即可解決。如下圖:


相關推薦

EhCache啟動Error starting heartbeat. Error was: Can't assign requested addre

最近採用EhCache解決分散式快取問題,我的開發筆記本為MacBook PRO,昨天晚上除錯完好的demo程式,今天早上啟動時竟然報以下錯誤: [2017-04-12 10:35:33,267] 460 [localhost-startStop-1] INFO [org

Myeclipse啟動錯:An error has occurred.See the log file

entry classpath ret 出現 restore div nap cati security 出現這個問題是因為斷電前myeclipse還在運行,日誌報錯如下: !ENTRY org.eclipse.osgi 4 0 2017-07-24 08:29:48.4

memcache啟動錯:memcached: error while loading shared libraries: libevent-XXXXX5: cannot 。。。。

share mem dev 鏈接 debug 修改文件 memcache null 鏈接地址 創建連接 ln -s /usr/lib/libevent-2.1.so.6 /usr/lib/libevent-2.1.so.6 如果還不行就下面解決 執行下面語句查看鏈接

Eclipse啟動錯:An internal error occurred during: "Updating indexes".org/eclipse/core/runtime/internal/adaptor/BasicLocation解決方法

update download 4.0 oca and load 異常 for ror Eclipse一直用的好好的,突然這兩天每次啟動都會出現如下的錯誤:An internal error occurred during: "Updating indexes".org/e

nginx啟動錯:nginx: [error] open() "/var/run/nginx/nginx.pid" failed (2: No such file or directory) 的解決辦法

問題:   重啟虛擬機器後,再次重啟nginx會報錯: nginx: [error] open() "/var/run/nginx/nginx.pid" failed (2: No such file or directory)  問題原因:   提示資訊說明在 /var/

Spring啟動Druid register mbean error異常

執行一個tomcat專案正常,當執行兩個tomcat則報異常。 ERROR [com.alibaba.druid.stat.DruidDataSourceStatManager] – unregister mbean error javax.management.Insta

解決 docker 錯: Error starting daemon: error initializing graphdriver: backing file system is unsupported for this graph driver

CentOS 7.5 x64下 sudo yum install docker -y systemctl enable docker systemctl start docker 發現啟動失敗 journalctl -xe 查詢獲得報錯 Jan 11 22:4

啟動mysql出錯Starting MySQL. ERROR! The server quit without updating PID file (/var/lib/mysql/spark01.pi

參考檔案的連結地址:http://icesquare.com/wordpress/mysql-starting-mysql-error-the-server-quit-without-updating-pid-file/

mysql-mariadb啟動錯恢復資料([ERROR] mysqld got signal 6)

160226 11:00:21  InnoDB: Page checksum 913642282 (32bit_calc: 472052024), prior-to-4.0.14-form checksum 2048873750 InnoDB: stored checksum 913642282, prio

springboot啟動錯:whitelabel error page

錯誤描述: Whitelabel Error PageThis application has no explicit mapping for /error, so you are seeing

Error starting daemon: error initializing graphdriver: driver not supported

  This error must be caused by the version check becaus after adding --storage-opt overlay2.override_kernel_check=1 as a argument to

frps 提示 Create server listener error, listen tcp ip:7000: bind: cannot assign requested address

遇到在執行frps時提示:Create server listener error, listen tcp ip:7000: bind: cannot assign requested address 編輯frps.ini配置檔案 設定 bind_addr =

tomcat 啟動Could not publish to the server. Please assign JRE to the server的解決方法

" shutdown="SHUTDOWN"> <Listener className="org.apache.catalina.startup.VersionLoggerListener" /> <!-- Security listener. Documentation at

裝完mysql啟動錯:“Table ‘mysql.plugin’ doesn’t exist” 解決方法

裝完mysql後啟動mysql發現啟動不了,錯誤日誌裡面會提示Table ‘mysql.plugin’ doesn’t exist,出現此錯誤的原因有兩種。 一種是裝完mysql之後沒有執行初始化mysql系統資料庫的指令碼,如果是這種情況,要先做指令碼的初始化,方法如

使用Ehcache緩存同步啟動時拋出異常net.sf.ehcache.CacheException: Can't assign requested address

request ESS 端口 true 內網 ear .net 了無 ehcache 這個問題在插入公司內網網線的時候不會復現,由於我使用的是公司無線網絡,故導致此問題。 具體解決辦法是:在啟動服務時,指定使用默認ipv4的網絡接口。可以在啟動jvm時添加參數-Djava

Python錯:UnicodeDecodeError: ‘gbk‘ codec cant ...

代碼 seq new error ltib utf byte pen osi python讀取文件時提示:UnicodeDecodeError: ‘gbk‘ codec can‘t decode byte 0xaa in position 82: illegal multi

windows下用Python連線mysql錯問題“MySQLdb in Python: “Can't connect to MySQL server on 'localhost'””

""" __author__ = 'chenguolin' __date__=2014-02-17 """ import MySQLdb db = MySQLdb.connect(host="

通過xstart啟動gnome桌面 連線時報錯:Can't open display: localhost:10.0

安裝包: xorg-x11-xauth xterm.x86_64 0:253-1.el6 Execute command path:/usr/bin/xterm  Xstart連線Linux遠端桌面有一個好處,伺服器端不用做什麼設定,開啟SSH即可。 伺服器要有桌面環境,和X Window 用XDMCP

[python]解決Windows下安裝第三方外掛錯:UnicodeDecodeError: 'ascii' codec can't decode byte 0xcb in position 0:

系統:win10 IDE:pycharm Python版本:2.7 安裝第三方外掛是報錯: 報錯原因與編碼有關,pip把下載的臨時檔案存放在了使用者臨時檔案中,這個目錄一般是C:\Users

VS2015 下python程式設計,錯:'utf-8' codec can't decode byte,解決辦法?

問題描述,形如以下的C++呼叫python程式碼,在vs2015下報中文編碼錯誤 #include <iostream> using namespace std; int main() { Py_Initialize(); /*初始化