这是我截取的输出的警告日志:
Connected to server
[2016-09-23 09:26:22,319] Artifact xk_mvn_1:war exploded: Artifact is being deployed, please wait...
23-Sep-2016 21:26:24.478 INFO [RMI TCP Connection(3)-127.0.0.1] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
[2016-09-23 09:26:26,148] Artifact xk_mvn_1:war exploded: Artifact is deployed successfully
[2016-09-23 09:26:26,148] Artifact xk_mvn_1:war exploded: Deploy took 3,829 milliseconds
23-Sep-2016 21:26:26.436 INFO [http-nio-8888-exec-1] [wqh.controller.MainController] .invoke0 wqh.controller:index_f
Fri Sep 23 21:26:26 CST 2016 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
Fri Sep 23 21:26:26 CST 2016 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
23-Sep-2016 21:26:26.827 INFO [http-nio-8888-exec-2] [wqh.controller.MainController] .invoke0 wqh.controller:index_f
23-Sep-2016 21:26:27.085 INFO [http-nio-8888-exec-3] [wqh.controller.MainController] .invoke0 wqh.controller:index_f
"C:\Program Files\Apache Software Foundation\Tomcat 9.0\bin\catalina.bat" stop
Using CATALINA_BASE: "C:\Users\devts\.IntelliJIdea15\system\tomcat\Unnamed_xk_mvn_1"
Using CATALINA_HOME: "C:\Program Files\Apache Software Foundation\Tomcat 9.0"
Using CATALINA_TMPDIR: "C:\Program Files\Apache Software Foundation\Tomcat 9.0\temp"
Using JRE_HOME: "C:\Program Files\Java\jdk1.8.0_92"
Using CLASSPATH: "C:\Program Files\Apache Software Foundation\Tomcat 9.0\bin\bootstrap.jar;C:\Program Files\Apache Software Foundation\Tomcat 9.0\bin\tomcat-juli.jar"
23-Sep-2016 21:26:31.340 INFO [main] org.apache.catalina.core.StandardServer.await A valid shutdown command was received via the shutdown port. Stopping the Server instance.
23-Sep-2016 21:26:31.340 INFO [main] org.apache.coyote.AbstractProtocol.pause Pausing ProtocolHandler ["http-nio-8888"]
23-Sep-2016 21:26:31.392 INFO [main] org.apache.coyote.AbstractProtocol.pause Pausing ProtocolHandler ["ajp-nio-8008"]
23-Sep-2016 21:26:31.443 INFO [main] org.apache.catalina.core.StandardService.stopInternal Stopping service Catalina
23-Sep-2016 21:26:31.461 WARNING [localhost-startStop-1] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesJdbc The web application [ROOT] registered the JDBC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
23-Sep-2016 21:26:31.461 WARNING [localhost-startStop-1] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [ROOT] appears to have started a thread named [Abandoned connection cleanup thread] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
java.lang.Object.wait(Native Method)
java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:143)
com.mysql.jdbc.AbandonedConnectionCleanupThread.run(AbandonedConnectionCleanupThread.java:43)
23-Sep-2016 21:26:31.462 WARNING [localhost-startStop-1] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [ROOT] appears to have started a thread named [Timer-0] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
java.lang.Object.wait(Native Method)
java.lang.Object.wait(Object.java:502)
java.util.TimerThread.mainLoop(Timer.java:526)
java.util.TimerThread.run(Timer.java:505)
23-Sep-2016 21:26:31.475 INFO [main] org.apache.coyote.AbstractProtocol.stop Stopping ProtocolHandler ["http-nio-8888"]
23-Sep-2016 21:26:31.477 INFO [main] org.apache.coyote.AbstractProtocol.stop Stopping ProtocolHandler ["ajp-nio-8008"]
23-Sep-2016 21:26:31.478 INFO [main] org.apache.coyote.AbstractProtocol.destroy Destroying ProtocolHandler ["http-nio-8888"]
23-Sep-2016 21:26:31.479 INFO [main] org.apache.coyote.AbstractProtocol.destroy Destroying ProtocolHandler ["ajp-nio-8008"]
运行环境:
IDEA15.06+JDK1.8+Tomcat9
疑问:这个警告代表什么?Timer-0是哪里来的?
`23-Sep-2016 21:26:31.462 WARNING [localhost-startStop-1] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [ROOT] appears to have started a thread named [Timer-0] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
`
実際には、データ接続プールを使用するときにデータドライバーが登録されましたが、Tomcat を閉じるときに登録が解除されませんでした。手動で登録を解除するだけです。
リーリーJDBC 接続が正しく閉じられていない。データベース接続を取得するコードが閉じていないか、または閉じられていないかを確認してください。
バージョンを下げてJDK1.7+Tomcat7を使ってみると良いでしょう