1、问题
项目启动之后,就停了,报错如下:
Initialization Sequence datacenterId:16 workerId:17
The web application [my-web] appears to have started a thread named [Thread-3] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
Initialization Sequence datacenterId:16 workerId:10
8月 07, 2024 9:20:40 上午 org.apache.tomcat.util.descriptor.web.SecurityConstraint findUncoveredHttpMethods
严重: For security constraints with URL pattern [/*] only the HTTP methods [TRACE HEAD DELETE SEARCH PROPFIND COPY OPTIONS PUT] are covered. All other methods are uncovered.
8月 07, 2024 9:20:40 上午 org.apache.catalina.core.StandardService stopInternal
信息: Stopping service [Tomcat]
8月 07, 2024 9:20:40 上午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads
警告: The web application [caf-shjb-web] appears to have started a thread named [Thread-3] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
java.base@17.0.12/sun.net.dns.ResolverConfigurationImpl.notifyAddrChange0(Native Method)
java.base@17.0.12/sun.net.dns.ResolverConfigurationImpl$AddressChangeListener.run(ResolverConfigurationImpl.java:176)
8月 07, 2024 9:20:40 上午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads
警告: The web application [caf-shjb-web] appears to have started a thread named [lettuce-timer-3-1] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
java.base@17.0.12/java.lang.Thread.sleep(Native Method)
app//io.netty.util.HashedWheelTimer$Worker.waitForNextTick(HashedWheelTimer.java:600)
app//io.netty.util.HashedWheelTimer$Worker.run(HashedWheelTimer.java:496)
app//io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
java.base@17.0.12/java.lang.Thread.run(Thread.java:842)
Disconnected from the target VM, address: '127.0.0.1:58421', transport: 'socket'
Process finished with exit code 1
2、排查问题
参考资料:
https://zhuanlan.zhihu.com/p/583013219
分析为 没有增加@RequestParam注解,也没有设置required属性导致。
同理修改,并未能解决。
后发现启动类未增加注释。
3、解决
启动类增加 @EnableAutoConfiguration
问题解决。
OK,就这些吧。
有什么不对的还望指正,书写不易,觉得有帮助就点个赞吧!☺☺☺