今天在项目启动的时候,出现以下异常,开始以为是内存空间不足引起,后面加大内存空间到5G,启动依然出现该错,使用Google和百度搜索后依然没有解决。
2019/07/29-20:28:06 [localhost-startStop-1] WARN org.apache.catalina.loader.WebappClassLoaderBase - The web application [iot-ms] appears to have started a thread named [HikariPool-1 housekeeper] 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/29-20:28:06 [localhost-startStop-1] WARN org.apache.catalina.loader.WebappClassLoaderBase - The web application [iot-ms] appears to have started a thread named [lettuce-eventExecutorLoop-2-1] 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.LinkedBlockingQueue.poll(LinkedBlockingQueue.java:467)
io.netty.util.concurrent.SingleThreadEventExecutor.takeTask(SingleThreadEventExecutor.java:251)
io.netty.util.concurrent.DefaultEventExecutor.run(DefaultEventExecutor.java:64)
io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:905)
io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
java.lang.Thread.run(Thread.java:748)
最后认真回想今天提交的代码,发现有一个DTO不是自己定义的,是使用的第三方包中的,怀疑是由PostDeviceCommandOutDTO2引起,于是把该方法注释后项目启动成功。
@ApiOperation(value = "查询",notes = "查询")
@RequestMapping(value = "commandCallback",method = RequestMethod.POST)
public @ResponseBody ResposeVO commandCallback(@RequestBody @Valid PostDeviceCommandOutDTO2 dto){
System.out.println(dto);
return ResponseFactory.ok("成功");
}
问题分析:
打开该DTO进入源码看到类中有一个com.fasterxml.jackson.databind.node.ObjectNode类型的属性,问题就是该属性引起swagger扫描属性循环引用造成。
网友评论