Tomcat start times wrong: java.net.UnknownHostException

Source: Internet
Author: User

The exception information is as follows:

info:failed to get local inetaddress forVMID. Unlikely to matter. At all. We'll add some extra randomnessjava.net.unknownhostexception:ran-oam:ran-oam:name or service not known at Java.net.InetAddress.getLocalHost (Inetaddress.java:1473) at Com.mchange.v2.uid.UidUtils.generateVmId (Uidutils.java: -) at Com.mchange.v2.uid.UidUtils.<clinit> (Uidutils.java: Wu) 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: About) at Com.mchange.v2.c3p0.AbstractComboPooledDataSource.<init> (Abstractcombopooleddatasource.java:142) at Com.mchange.v2.c3p0.AbstractComboPooledDataSource.<init> (Abstractcombopooleddatasource.java:138) at Com.mchange.v2.c3p0.ComboPooledDataSource.<init> (Combopooleddatasource.java: -) at Sun.reflect.NativeConstructorAccessorImpl.newInstance0 (Native Method) at Sun.reflect.NativeConstructorAcce Ssorimpl.newinstance (Nativeconstructoraccessorimpl.java: $) at Sun.reflect.DelegatingConstructorAccessorImpl.newInstance (Delegatingconstructoraccessorimpl.java: $) at Java.lang.reflect.Constructor.newInstance (Constructor.java:526) at Org.springframework.beans.BeanUtils.instantiateClass (Beanutils.java:148) at Org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate ( Simpleinstantiationstrategy.java: the) at Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean ( Abstractautowirecapablebeanfactory.java:1004) at Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance ( Abstractautowirecapablebeanfactory.java:957) at Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean ( Abstractautowirecapablebeanfactory.java:490) at Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean ( Abstractautowirecapablebeanfactory.java:461) at org.springframework.beans.factory.support.abstractbeanfactory$1. GetObject (Abstractbeanfactory.java:295) at Org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton ( Defaultsingletonbeanregistry.java:223) at Org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean (Abstractbeanfactory.java:292) at Org.springframework.beans.factory.support.AbstractBeanFactory.getBean (Abstractbeanfactory.java:194) at Org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons ( Defaultlistablebeanfactory.java:626) at Org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization ( Abstractapplicationcontext.java:932) at Org.springframework.context.support.AbstractApplicationContext.refresh (Abstractapplicationcontext.java: 479) at Org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext ( Contextloader.java:389) at Org.springframework.web.context.ContextLoader.initWebApplicationContext (Contextloader.java:294) at org.springframework.web.context.ContextLoaderListener.contextInitialized (Contextloaderlistener.java:  the) at Org.apache.catalina.core.StandardContext.listenerStart (Standardcontext.java:5016) at Org.apache.catalina.core.StandardContext.startInternal (Standardcontext.java:5524) at Org.apache.catalina.util.LifecycleBase.start (Lifecyclebase.java: Max) at Org.apache.catalina.core.ContainerBase.addChildInternal (Containerbase.java:901) at Org.apache.catalina.core.ContainerBase.addChild (Containerbase.java:877) at Org.apache.catalina.core.StandardHost.addChild (Standardhost.java:649) at Org.apache.catalina.startup.HostConfig.deployDirectory (Hostconfig.java:1245) at Org.apache.catalina.startup.hostconfig$deploydirectory.run (Hostconfig.java:1895) at Java.util.concurrent.executors$runnableadapter.call (Executors.java:471) at Java.util.concurrent.FutureTask.run (Futuretask.java:262) at Java.util.concurrent.ThreadPoolExecutor.runWorker (Threadpoolexecutor.java:1145) at Java.util.concurrent.threadpoolexecutor$worker.run (Threadpoolexecutor.java:615) at Java.lang.Thread.run (Thread.java:745) caused By:java.net.UnknownHostException:ran-oam:name or service not known at JAVA.NET.INET6ADDRESSIMPL.LOOKUPALLHOSTADDR (Native Method) at JAVA.NET.INETADD ress$1. LOOKUPALLHOSTADDR (Inetaddress.java:901) at Java.net.InetAddress.getAddressesFromNameService (Inetaddress.java:1293) at Java.net.InetAddress.getLocalHost (Inetaddress.java:1469)    ...  A  More

Workaround, configure the host name.

View Host Name:

Echo ' hostname '

After executing the above command, the hostname will be printed, and this note will be used later. For example, my host name is "Ran-oam."

To modify a file:

VI /etc/hosts

Write the host name, as

After completing the modifications, restart Tomcat and find the problem resolved.

Tomcat start times wrong: java.net.UnknownHostException

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.