首页 > 代码库 > docker环境hosts配置错误导致的tomcat无法正常启动

docker环境hosts配置错误导致的tomcat无法正常启动

1      问题描述

  项目部署在linux(包括虚拟机)环境、window环境是上,tomcat启动正常,但是在迁移到docker环境,出现服务无法正常启动现象。

2      异常描述

2.1    应用日志

  总结来说日志中体现的是重复加载,表现形式如下:

  1)定时器重复

ERROR[pool-4-thread-4] com.*.acl.schedule.quartz.BaseQuartz(75) 启动com.*.acl.schedule.job.PowerInterceptVerifyJob

异常

org.quartz.ObjectAlreadyExistsException:Unable to store Job : ‘PowerInterceptVerifyGroup.PowerInterceptVerifyJob‘,because one already exists with this identification.

  2)类重复初始化

2016-08-2618:33:01,415 INFO  [pool-5-thread-4]com.*.acl.common.constant.PowerHolder(62) 初始化powerHolder

2016-08-2618:33:03,350 INFO  [http-apr-8080-exec-1]com.*.acl.common.constant.RuleHolder(45) 初始化RuleHolder

2016-08-2618:33:03,355 INFO  [http-apr-8080-exec-1]com.*.acl.common.constant.RuleHolder(70) 初始化ruleHolder耗时5毫秒,加载数据3

2016-08-2618:33:03,437 INFO  [http-apr-8080-exec-1]com.*.acl.common.constant.PowerHolder(62) 初始化powerHolder

2016-08-2618:33:06,895 INFO  [pool-5-thread-4]com.*.acl.common.constant.PowerHolder(94) 初始化powerHolder耗时5480毫秒,加载数据3253

2016-08-2618:33:06,897 INFO  [pool-5-thread-4]com.*.acl.service.impl.AsyncAclServiceImpl(113) 计数器总数=0

2.2    tomcat日志

localhost.log异常如下:

Aug 29, 2016 7:12:24 PM org.apache.catalina.core.StandardContextloadOnStartup

SEVERE: Servlet [acl] in web application []threw load() exception

java.net.UnknownHostException: c01.test.aclservice.hgh.*.com: Name orservice not known

       at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)

       at java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:901)

3      解决方案

按照tomcat的错误提醒,配置正确的hosts


小编:浴巾报道

本文出自 “12009495” 博客,请务必保留此出处http://12019495.blog.51cto.com/12009495/1845261

docker环境hosts配置错误导致的tomcat无法正常启动