开发者社区> 问答> 正文

Druid在tomcat中报 java.lang.NoClassDefFound?报错

@wenshao 你好,想跟你请教个问题:druid 在 apache tomcat 里面经常要出现这样的报错,百度了很久不得其解。

九月 17, 2014 9:53:31 上午 org.apache.catalina.loader.WebappClassLoader loadClass
信息: Illegal access: this web application instance has been stopped already.  Could not load com.mysql.jdbc.ProfilerEventHandlerFactory.  The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact.
java.lang.IllegalStateException
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1612)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1571)
at com.mysql.jdbc.ConnectionImpl.realClose(ConnectionImpl.java:4677)
at com.mysql.jdbc.ConnectionImpl.close(ConnectionImpl.java:1615)
at com.alibaba.druid.filter.FilterChainImpl.connection_close(FilterChainImpl.java:169)
at com.alibaba.druid.filter.FilterAdapter.connection_close(FilterAdapter.java:776)
at com.alibaba.druid.filter.logging.LogFilter.connection_close(LogFilter.java:415)
at com.alibaba.druid.filter.FilterChainImpl.connection_close(FilterChainImpl.java:165)
at com.alibaba.druid.proxy.jdbc.ConnectionProxyImpl.close(ConnectionProxyImpl.java:115)
at com.alibaba.druid.util.JdbcUtils.close(JdbcUtils.java:82)
at com.alibaba.druid.pool.DruidDataSource.shrink(DruidDataSource.java:1915)
at com.alibaba.druid.pool.DruidDataSource$DestroyConnectionThread.run(DruidDataSource.java:1733)


Exception in thread "Druid-ConnectionPool-Destory-806406583" java.lang.NoClassDefFoundError: com/mysql/jdbc/ProfilerEventHandlerFactory
at com.mysql.jdbc.ConnectionImpl.realClose(ConnectionImpl.java:4677)
at com.mysql.jdbc.ConnectionImpl.close(ConnectionImpl.java:1615)
at com.alibaba.druid.filter.FilterChainImpl.connection_close(FilterChainImpl.java:169)
at com.alibaba.druid.filter.FilterAdapter.connection_close(FilterAdapter.java:776)
at com.alibaba.druid.filter.logging.LogFilter.connection_close(LogFilter.java:415)
at com.alibaba.druid.filter.FilterChainImpl.connection_close(FilterChainImpl.java:165)
at com.alibaba.druid.proxy.jdbc.ConnectionProxyImpl.close(ConnectionProxyImpl.java:115)
at com.alibaba.druid.util.JdbcUtils.close(JdbcUtils.java:82)
at com.alibaba.druid.pool.DruidDataSource.shrink(DruidDataSource.java:1915)
at com.alibaba.druid.pool.DruidDataSource$DestroyConnectionThread.run(DruidDataSource.java:1733)
Caused by: java.lang.ClassNotFoundException: com.mysql.jdbc.ProfilerEventHandlerFactory
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1720)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1571)
... 10 more
[Druid-ConnectionPool-Destory-116271079] DEBUG druid.sql.Connection - {conn-10001} closed
Exception in thread "Druid-ConnectionPool-Destory-2069188819" java.lang.NoClassDefFoundError: com/mysql/jdbc/ProfilerEventHandlerFactory
at com.mysql.jdbc.ConnectionImpl.realClose(ConnectionImpl.java:4677)
at com.mysql.jdbc.ConnectionImpl.close(ConnectionImpl.java:1615)
at com.alibaba.druid.util.JdbcUtils.close(JdbcUtils.java:82)
at com.alibaba.druid.pool.DruidDataSource.shrink(DruidDataSource.java:1915)
at com.alibaba.druid.pool.DruidDataSource$DestroyConnectionThread.run(DruidDataSource.java:1733)

九月 17, 2014 9:53:31 上午 org.apache.catalina.loader.WebappClassLoader loadClass
信息: Illegal access: this web application instance has been stopped already.  Could not load com.mysql.jdbc.ProfilerEventHandlerFactory.  The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact.
java.lang.IllegalStateException
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1612)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1571)
at com.mysql.jdbc.ConnectionImpl.realClose(ConnectionImpl.java:4677)
at com.mysql.jdbc.ConnectionImpl.close(ConnectionImpl.java:1615)
at com.alibaba.druid.filter.FilterChainImpl.connection_close(FilterChainImpl.java:169)
at com.alibaba.druid.filter.FilterAdapter.connection_close(FilterAdapter.java:776)
at com.alibaba.druid.filter.logging.LogFilter.connection_close(LogFilter.java:415)
at com.alibaba.druid.filter.FilterChainImpl.connection_close(FilterChainImpl.java:165)
at com.alibaba.druid.proxy.jdbc.ConnectionProxyImpl.close(ConnectionProxyImpl.java:115)
at com.alibaba.druid.util.JdbcUtils.close(JdbcUtils.java:82)
at com.alibaba.druid.pool.DruidDataSource.shrink(DruidDataSource.java:1915)
at com.alibaba.druid.pool.DruidDataSource$DestroyConnectionThread.run(DruidDataSource.java:1733)


Exception in thread "Druid-ConnectionPool-Destory-806406583" java.lang.NoClassDefFoundError: com/mysql/jdbc/ProfilerEventHandlerFactory
at com.mysql.jdbc.ConnectionImpl.realClose(ConnectionImpl.java:4677)
at com.mysql.jdbc.ConnectionImpl.close(ConnectionImpl.java:1615)
at com.alibaba.druid.filter.FilterChainImpl.connection_close(FilterChainImpl.java:169)
at com.alibaba.druid.filter.FilterAdapter.connection_close(FilterAdapter.java:776)
at com.alibaba.druid.filter.logging.LogFilter.connection_close(LogFilter.java:415)
at com.alibaba.druid.filter.FilterChainImpl.connection_close(FilterChainImpl.java:165)
at com.alibaba.druid.proxy.jdbc.ConnectionProxyImpl.close(ConnectionProxyImpl.java:115)
at com.alibaba.druid.util.JdbcUtils.close(JdbcUtils.java:82)
at com.alibaba.druid.pool.DruidDataSource.shrink(DruidDataSource.java:1915)
at com.alibaba.druid.pool.DruidDataSource$DestroyConnectionThread.run(DruidDataSource.java:1733)
Caused by: java.lang.ClassNotFoundException: com.mysql.jdbc.ProfilerEventHandlerFactory
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1720)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1571)
... 10 more
[Druid-ConnectionPool-Destory-116271079] DEBUG druid.sql.Connection - {conn-10001} closed
Exception in thread "Druid-ConnectionPool-Destory-2069188819" java.lang.NoClassDefFoundError: com/mysql/jdbc/ProfilerEventHandlerFactory
at com.mysql.jdbc.ConnectionImpl.realClose(ConnectionImpl.java:4677)
at com.mysql.jdbc.ConnectionImpl.close(ConnectionImpl.java:1615)
at com.alibaba.druid.util.JdbcUtils.close(JdbcUtils.java:82)
at com.alibaba.druid.pool.DruidDataSource.shrink(DruidDataSource.java:1915)
at com.alibaba.druid.pool.DruidDataSource$DestroyConnectionThread.run(DruidDataSource.java:1733)

展开
收起
爱吃鱼的程序员 2020-06-14 21:42:56 1855 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    我也是这样。。。

    @wenshao

    多个mysqldriver混在一起冲突了?druid需要和mysql版本对应吗,我这边也出现这个问题就用了一个啊,没多个。。jar包冲突~~~~~能具体一点不?

    thiswebapplicationinstancehasbeenstoppedalready.---实例已经停止

    因此不能假造 com.mysql.jdbc.ProfilerEventHandlerFactory

    又或者

    Druid-ConnectionPool-Destory-806406583

    com/mysql/jdbc/ProfilerEventHandlerFactory-----可能 Druid要求的mysql的驱动包的版本相对较高

    那么最后这个问题究竟是如何解决的呢,没人回答?

    这问题解决了没?解决了没?

    挖坟

    2020-06-14 21:43:12
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
Spring Cloud Alibaba - 重新定义 Java Cloud-Native 立即下载
The Reactive Cloud Native Arch 立即下载
JAVA开发手册1.5.0 立即下载