Center OS部署系统时遇到的问题

部署上线时由于服务器是全新的,很多环境、工具都未安装。碰到很多以前没有遇到的问题

一、安装完环境:jdk、tomcat后部署上线,在启动tomcat时出现如下异常:

java.net.UnknownHostException: pay03.migutest: pay03.alipaytest
	at java.net.InetAddress.getLocalHost(InetAddress.java:1461)
	at com.mchange.v2.uid.UidUtils.generateVmId(UidUtils.java:70)
	at com.mchange.v2.uid.UidUtils.<clinit>(UidUtils.java:54)
	at com.mchange.v2.c3p0.impl.C3P0ImplUtils.<clinit>(C3P0ImplUtils.java:126)
	at com.mchange.v2.c3p0.impl.PoolBackedDataSourceBase.<init>(PoolBackedDataSourceBase.java:288)
	at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.<init>(AbstractPoolBackedDataSource.java:74)
	at com.mchange.v2.c3p0.AbstractComboPooledDataSource.<init>(AbstractComboPooledDataSource.java:142)
	at com.mchange.v2.c3p0.AbstractComboPooledDataSource.<init>(AbstractComboPooledDataSource.java:138)

 查询了很多答案,最终解决方案是在/etc目录下的hosts文件中添加对应host与内网ip的映射。

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.12.187 pay03.alipaytest  ##增加的行

重启tomat后,该问题解决了。

 

二、在访问登陆验证码时报错,一直响应500错误。后台开启debug日志后出现如下问题:

java.lang.Error: Probable fatal error:No fonts found.
.
.
.

 在国外网站上找到如下方式解决:

under Ubuntu you can install fonts by
    sudo apt-get install ttf-dejavu
or if you use CentOS, you can install fonts by
    yum install dejavu*

 由于是CenterOS系统,所以执行

# yum install dejavu*

 安装完字体后,再访问验证码链接就能正常显示了。

你可能感兴趣的:(Center OS部署系统时遇到的问题)