欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Linux环境下C3P0加载失败

程序员文章站 2022-07-13 14:26:07
...

在windows下部署包含C3P0的war包没问题,部署到linux下面的tomcat下C3P0报错,报错信息如下

com.mchange.v2.uid.UidUtils. Failed to get local InetAddress for VMID. This is unlikely to matter. At all. We'll add some extra randomness
 java.net.UnknownHostException: host.localdomain: host.localdomain: Name or service not known
	at java.base/java.net.InetAddress.getLocalHost(Unknown Source)

 java.net.UnknownHostException: host.localdomain: host.localdomain: Name or service not known

注意这行。是由于linux系统下/etc/hosts文件没有 host.localdomain: host.localdomain 导致的错误。编辑hosts文件 


vim /etc/hosts

添加

host.localdomain

至文件

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4 host.localdomain
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6