Раньше я работал на Glassfish. Перешел на томее. Оказывается эта ошибка, в чем проблема? Я все сделал по инструкции и не знаю в чем причина.
Это server.xml:
<Resource name="jdbc/chessman_work"
auth="Container"
type="javax.sql.DataSource"
driverClassName="com.mysql.cj.jdbc.Driver"
classpath="${basedir}/lib/mysql-connector.jar"
url="jdbc:mysql://localhost:3306/chessman_work?zeroDateTimeBehavior=CONVERT_TO_NULL&serverTimezone=UTC&useSSL=false"
username="root"
password="root"
maxActive="100"
maxIdle="30"
maxWait="10000" />
context.xml:
<Context>
<!-- Default set of monitored resources. If one of these changes, the -->
<!-- web application will be reloaded. -->
<WatchedResource>WEB-INF/web.xml</WatchedResource>
<WatchedResource>WEB-INF/tomcat-web.xml</WatchedResource>
<WatchedResource>${catalina.base}/conf/web.xml</WatchedResource>
<ResourceLink name="jdbc/chessman_work" global="jdbc/chessman_work" auth="Container" type="javax.sql.DataSource" />
<!-- Uncomment this to disable session persistence across Tomcat restarts -->
<!--
<Manager pathname="" />
-->
</Context>
.log:
12-Jan-2019 12:59:37.210 INFO [main] sun.reflect.DelegatingMethodAccessorImpl.invoke Server startup in 25381 ms
12-Jan-2019 12:59:37.656 INFO [http-nio-8080-exec-6] org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl$PoolState.stop HHH10001008: Cleaning up connection pool [jdbc:mysql://localhost:3306/chessman_work?zeroDateTimeBehavior=CONVERT_TO_NULL&serverTimezone=UTC&useSSL=false]
12-Jan-2019 12:59:37.675 INFO [http-nio-8080-exec-6] org.apache.openejb.assembler.classic.Assembler.destroyApplication Undeploying app: F:\Developer\Programms\Chessman\ChessmanWork\target\ChessmanWork
12-Jan-2019 12:59:38.088 WARNING [http-nio-8080-exec-6] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesJdbc The web application [ChessmanWork] registered the JDBC driver [com.mysql.cj.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.
12-Jan-2019 12:59:38.090 WARNING [http-nio-8080-exec-6] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [ChessmanWork] 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:144)
com.mysql.cj.jdbc.AbandonedConnectionCleanupThread.run(AbandonedConnectionCleanupThread.java:70)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
java.lang.Thread.run(Thread.java:748)
12-Jan-2019 12:59:38.607 INFO [http-nio-8080-exec-6] sun.reflect.DelegatingMethodAccessorImpl.invoke Undeploying context [/ChessmanWork]
12-Jan-2019 12:59:38.651 INFO [http-nio-8080-exec-3] sun.reflect.DelegatingMethodAccessorImpl.invoke Deploying deployment descriptor [F:\Servers\apache-tomee-plume-8.0.0-M1\conf\Catalina\localhost\ChessmanWork.xml]
12-Jan-2019 12:59:38.658 WARNING [http-nio-8080-exec-3] sun.reflect.NativeMethodAccessorImpl.invoke The path attribute with value [/ChessmanWork] in deployment descriptor [F:\Servers\apache-tomee-plume-8.0.0-M1\conf\Catalina\localhost\ChessmanWork.xml] has been ignored
12-Jan-2019 12:59:38.660 INFO [http-nio-8080-exec-3] org.apache.tomee.catalina.TomcatWebAppBuilder.init ------------------------- localhost -> /ChessmanWork
12-Jan-2019 12:59:38.838 INFO [Abandoned connection cleanup thread] org.apache.catalina.loader.WebappClassLoaderBase.checkStateForResourceLoading Illegal access: this web application instance has been stopped already. Could not load []. The following stack trace is thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access.
java.lang.IllegalStateException: Illegal access: this web application instance has been stopped already. Could not load []. The following stack trace is thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access.
at org.apache.catalina.loader.WebappClassLoaderBase.checkStateForResourceLoading(WebappClassLoaderBase.java:1329)
at org.apache.catalina.loader.WebappClassLoaderBase.getResource(WebappClassLoaderBase.java:1006)
at com.mysql.cj.jdbc.AbandonedConnectionCleanupThread.checkContextClassLoaders(AbandonedConnectionCleanupThread.java:96)
at com.mysql.cj.jdbc.AbandonedConnectionCleanupThread.run(AbandonedConnectionCleanupThread.java:69)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)