mysql连接报java.math.BigInteger cannot be cast to java.lang.Long异常

项目启动时的数据库链接异常

异常描述:

项目发布时,将项目拷贝到服务器,启动运行,发生异常:

29-Mar-2019 09:29:16.238 INFO [Druid-ConnectionPool-Create-941073878] org.apache.catalina.loader.WebappClassLoaderBase.checkStateForResourceLoading Illegal access: this web application instance has been stopped already. Could not load [com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread]. 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 [com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread]. 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:1348)
	at org.apache.catalina.loader.WebappClassLoaderBase.checkStateForClassLoading(WebappClassLoaderBase.java:1336)
	at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1195)
	at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1157)

问题定位:数据库连接池不能创建数据链接

问题思考
  1. 本地数据库相关环境:mysql5.0.17
  2. 服务器数据库相关环境:mysql8.0.14
问题源

本地环境中,maven依赖了5.0.1版本的mysql-connector,此版本jar不能链接mysql8.0.14

解决

修改pom中的mysql-connector版本,正常运行

你可能感兴趣的:(数据库)