Tomcat server downtime solution

Error message:

java. lang.Object. wait(Native Method)

java. lang.ref. ReferenceQueue. remove(ReferenceQueue.java:143)

com. MysqL. jdbc. AbandonedConnectionCleanupThread. run(AbandonedConnectionCleanupThread.java:43)

Every time this error occurs, the Tomcat application server will be shut down. After adding the following java code, it will never stop.

terms of settlement:

Writing java code

@WebListener,这个注解相当于在web.xml配置如下内容

For solutions, please refer to the following website: https://stackoverflow.com/questions/25699985/the-web-application-appears-to-have-started-a-thread-named-abandoned-connect

Of course, when I refer to this solution again, I found that if the version of MySQL connection is too low, it will cause errors in the Java code listed above. By improving MySQL connection Java version can solve this problem

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>