原创

sun.misc.Unsafe.park(Native Method)

今天启动springboot项目时报错,报错信息如下

2019-07-26 09:18:02 [main] INFO  org.apache.catalina.core.StandardService Stopping service [Tomcat]
2019-07-26 09:18:02 [localhost-startStop-1] WARN  org.apache.catalina.loader.WebappClassLoaderBase The web application [ROOT] appears to have started a thread named [pollingConfigurationSource] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
 sun.misc.Unsafe.park(Native Method)
 java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
 java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078)
 java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1093)
 java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:809)
 java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1074)
 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1134)
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
 java.lang.Thread.run(Thread.java:748)
2019-07-26 09:18:02 [localhost-startStop-1] WARN  org.apache.catalina.loader.WebappClassLoaderBase The web application [ROOT] appears to have started a thread named [spring.cloud.inetutils] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
 java.net.Inet6AddressImpl.getHostByAddr(Native Method)
 java.net.InetAddress$2.getHostByAddr(InetAddress.java:932)
 java.net.InetAddress.getHostFromNameService(InetAddress.java:617)
 java.net.InetAddress.getHostName(InetAddress.java:559)
 java.net.InetAddress.getHostName(InetAddress.java:531)
 org.springframework.cloud.commons.util.InetUtils$$Lambda$77/428696898.call(Unknown Source)
 java.util.concurrent.FutureTask.run(FutureTask.java:266)
 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
 java.lang.Thread.run(Thread.java:748)

Process finished with exit code 1

解决办法:
经过两个小时的代码查错,发现是
properties配置文件中没有加配置
导致在使用@Value获取值时没有获取到,报的这个稀奇古怪的异常

正文到此结束
本文目录