解決C3P0在Linux下Failed to get local InetAddress for VMID問題

hunhun1122發表於2018-03-29

報錯:om.mchange.v2.c3p0.impl.C3P0ImplUtils {C3P0ImplUtils.java:125} - Failed to get local InetAddress for VMID. This is unlikely to matter. At 

或者這麼一個錯:

com.mchange.v2.c3p0.impl.C3P0ImplUtils  - Failed to get local InetAddress for VMID. 

This is unlikely to matter. At all. We'll add some extra randomness

java.net.UnknownHostException: v-dxt-guankong1: v-dxt-guankong1

 

找不到主機。

於是,先去看主機在什麼位置定義的:

cat /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=v-dxt-guankong1

 

然後,修改host檔案

vi /etc/hosts 在行127.0.0.1 localhost localhost.localdomain 後加上v-dxt-guankong1儲存即可。


加上主機名即可!


相關文章