- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
环境:服务器:Jboss 4.2.3.GA
我们使用 c3p0 0.9.1.2 作为连接池。
每当我们在 Jboss AS 中热部署 war 文件时,都会遇到来自 c3p0 的内存泄漏。它最终导致“java.lang.OutOfMemoryError: PermGen space”错误,我们被迫重新启动我们的应用程序服务器。
有人遇到过这个问题吗?这个问题有什么解决方法吗?
Stacktrace如下:
14:50:16,097 INFO [WebappClassLoader] Illegal access: this web application instance has been stopped already. Could not load com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask. 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:1244)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204)
at com.mchange.v2.resourcepool.BasicResourcePool.destroyResource(BasicResourcePool.java:980)
at com.mchange.v2.resourcepool.BasicResourcePool.removeResource(BasicResourcePool.java:1406)
at com.mchange.v2.resourcepool.BasicResourcePool.removeResource(BasicResourcePool.java:1378)
at com.mchange.v2.resourcepool.BasicResourcePool.cullExpired(BasicResourcePool.java:1462)
at com.mchange.v2.resourcepool.BasicResourcePool.access$1900(BasicResourcePool.java:32)
at com.mchange.v2.resourcepool.BasicResourcePool$CullTask.run(BasicResourcePool.java:1937)
at java.util.TimerThread.mainLoop(Timer.java:512)
at java.util.TimerThread.run(Timer.java:462)
14:50:22,328 ERROR [STDERR] Exception in thread "Timer-5"
14:50:22,329 ERROR [STDERR] java.lang.NoClassDefFoundError: com/mchange/v2/resourcepool/BasicResourcePool$1DestroyResourceTask
14:50:22,329 ERROR [STDERR] at com.mchange.v2.resourcepool.BasicResourcePool.destroyResource(BasicResourcePool.java:980)
14:50:22,329 ERROR [STDERR] at com.mchange.v2.resourcepool.BasicResourcePool.removeResource(BasicResourcePool.java:1406)
14:50:22,329 ERROR [STDERR] at com.mchange.v2.resourcepool.BasicResourcePool.removeResource(BasicResourcePool.java:1378)
14:50:22,329 ERROR [STDERR] at com.mchange.v2.resourcepool.BasicResourcePool.cullExpired(BasicResourcePool.java:1462)
14:50:22,329 ERROR [STDERR] at com.mchange.v2.resourcepool.BasicResourcePool.access$1900(BasicResourcePool.java:32)
14:50:22,329 ERROR [STDERR] at com.mchange.v2.resourcepool.BasicResourcePool$CullTask.run(BasicResourcePool.java:1937)
14:50:22,329 ERROR [STDERR] at java.util.TimerThread.mainLoop(Timer.java:512)
14:50:22,329 ERROR [STDERR] at java.util.TimerThread.run(Timer.java:462)
14:50:22,329 ERROR [STDERR] Caused by: java.lang.ClassNotFoundException: com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask
14:50:22,329 ERROR [STDERR] at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1358)
14:50:22,329 ERROR [STDERR] at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204)
14:50:22,329 ERROR [STDERR] ... 8 more
14:50:23,081 ERROR [STDERR] Exception in thread "Timer-6"
14:50:23,082 ERROR [STDERR] java.lang.NoClassDefFoundError: com/mchange/v2/resourcepool/BasicResourcePool$1DestroyResourceTask
14:50:23,082 ERROR [STDERR] at com.mchange.v2.resourcepool.BasicResourcePool.destroyResource(BasicResourcePool.java:980)
14:50:23,082 ERROR [STDERR] at com.mchange.v2.resourcepool.BasicResourcePool.removeResource(BasicResourcePool.java:1406)
14:50:23,082 ERROR [STDERR] at com.mchange.v2.resourcepool.BasicResourcePool.removeResource(BasicResourcePool.java:1378)
14:50:23,082 ERROR [STDERR] at com.mchange.v2.resourcepool.BasicResourcePool.cullExpired(BasicResourcePool.java:1462)
14:50:23,082 ERROR [STDERR] at com.mchange.v2.resourcepool.BasicResourcePool.access$1900(BasicResourcePool.java:32)
14:50:23,082 ERROR [STDERR] at com.mchange.v2.resourcepool.BasicResourcePool$CullTask.run(BasicResourcePool.java:1937)
14:50:23,082 ERROR [STDERR] at java.util.TimerThread.mainLoop(Timer.java:512)
14:50:23,083 ERROR [STDERR] at java.util.TimerThread.run(Timer.java:462)
14:51:59,105 INFO [WebappClassLoader] Illegal access: this web application instance has been stopped already. Could not load com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask. 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:1244)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204)
at com.mchange.v2.resourcepool.BasicResourcePool.destroyResource(BasicResourcePool.java:980)
at com.mchange.v2.resourcepool.BasicResourcePool.removeResource(BasicResourcePool.java:1406)
at com.mchange.v2.resourcepool.BasicResourcePool.removeResource(BasicResourcePool.java:1378)
at com.mchange.v2.resourcepool.BasicResourcePool.cullExpired(BasicResourcePool.java:1462)
at com.mchange.v2.resourcepool.BasicResourcePool.access$1900(BasicResourcePool.java:32)
at com.mchange.v2.resourcepool.BasicResourcePool$CullTask.run(BasicResourcePool.java:1937)
at java.util.TimerThread.mainLoop(Timer.java:512)
at java.util.TimerThread.run(Timer.java:462)
^[[1;2C14:56:03,597 ERROR [STDERR] Exception in thread "Timer-11"
14:56:03,598 ERROR [STDERR] java.lang.NoClassDefFoundError: com/mchange/v2/resourcepool/BasicResourcePool$1DestroyResourceTask
14:56:03,598 ERROR [STDERR] at com.mchange.v2.resourcepool.BasicResourcePool.destroyResource(BasicResourcePool.java:980)
14:56:03,598 ERROR [STDERR] at com.mchange.v2.resourcepool.BasicResourcePool.removeResource(BasicResourcePool.java:1406)
14:56:03,598 ERROR [STDERR] at com.mchange.v2.resourcepool.BasicResourcePool.removeResource(BasicResourcePool.java:1378)
14:56:03,598 ERROR [STDERR] at com.mchange.v2.resourcepool.BasicResourcePool.cullExpired(BasicResourcePool.java:1462)
14:56:03,598 ERROR [STDERR] at com.mchange.v2.resourcepool.BasicResourcePool.access$1900(BasicResourcePool.java:32)
14:56:03,598 ERROR [STDERR] at com.mchange.v2.resourcepool.BasicResourcePool$CullTask.run(BasicResourcePool.java:1937)
Listening for transport dt_socket at address: 8787
14:56:03,598 ERROR [STDERR] at java.util.TimerThread.mainLoop(Timer.java:512)
14:56:03,598 ERROR [STDERR] at java.util.TimerThread.run(Timer.java:462)
14:56:03,598 ERROR [STDERR] Exception in thread "Timer-10"
14:56:03,607 ERROR [STDERR] java.lang.NoClassDefFoundError: com/mchange/v2/resourcepool/BasicResourcePool$1DestroyResourceTask
14:56:03,607 ERROR [STDERR] at com.mchange.v2.resourcepool.BasicResourcePool.destroyResource(BasicResourcePool.java:980)
14:56:03,607 ERROR [STDERR] at com.mchange.v2.resourcepool.BasicResourcePool.removeResource(BasicResourcePool.java:1406)
14:56:03,607 ERROR [STDERR] at com.mchange.v2.resourcepool.BasicResourcePool.removeResource(BasicResourcePool.java:1378)
14:56:03,607 ERROR [STDERR] at com.mchange.v2.resourcepool.BasicResourcePool.cullExpired(BasicResourcePool.java:1462)
14:56:03,607 ERROR [STDERR] at com.mchange.v2.resourcepool.BasicResourcePool.access$1900(BasicResourcePool.java:32)
14:56:03,607 ERROR [STDERR] at com.mchange.v2.resourcepool.BasicResourcePool$CullTask.run(BasicResourcePool.java:1937)
14:56:03,607 ERROR [STDERR] at java.util.TimerThread.mainLoop(Timer.java:512)
14:56:03,607 ERROR [STDERR] at java.util.TimerThread.run(Timer.java:462)
14:56:03,607 ERROR [STDERR] Exception in thread "Timer-9"
14:56:03,607 ERROR [STDERR] java.lang.NoClassDefFoundError: com/mchange/v2/resourcepool/BasicResourcePool$1DestroyResourceTask
14:56:03,607 ERROR [STDERR] at com.mchange.v2.resourcepool.BasicResourcePool.destroyResource(BasicResourcePool.java:980)
14:56:03,607 ERROR [STDERR] at com.mchange.v2.resourcepool.BasicResourcePool.removeResource(BasicResourcePool.java:1406)
14:56:03,607 ERROR [STDERR] at com.mchange.v2.resourcepool.BasicResourcePool.removeResource(BasicResourcePool.java:1378)
14:56:03,607 ERROR [STDERR] at com.mchange.v2.resourcepool.BasicResourcePool.cullExpired(BasicResourcePool.java:1462)
14:56:03,607 ERROR [STDERR] at com.mchange.v2.resourcepool.BasicResourcePool.access$1900(BasicResourcePool.java:32)
14:56:03,607 ERROR [STDERR] at com.mchange.v2.resourcepool.BasicResourcePool$CullTask.run(BasicResourcePool.java:1937)
14:56:03,607 ERROR [STDERR] at java.util.TimerThread.mainLoop(Timer.java:512)
14:56:03,607 ERROR [STDERR] at java.util.TimerThread.run(Timer.java:462)
14:56:03,607 ERROR [STDERR] Caused by: java.lang.ClassNotFoundException: com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask
14:56:03,607 ERROR [STDERR] at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1358)
14:56:03,607 ERROR [STDERR] at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204)
14:56:03,607 ERROR [STDERR] ... 8 more
最佳答案
Whenever we hot-deploy war files in Jboss AS are encountering the memory leak from c3p0.
如果您在 JBoss 4.2(或任何其他版本的 JBoss)中进行热部署,您最终会泄漏 PermGen 池中的内存,并且服务器将需要重新启动。据我所知,没有解决方法,而且它与 c3p0 无关。
在开发中,这只是一个小麻烦。在生产中,您根本不应该这样做。
关于web-applications - c3p0 中的内存泄漏 - java.lang.NoClassDefFoundError : com/mchange/v2/resourcepool/BasicResourcePool,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10350499/
当我收到错误消息时,我应该在哪里指示类依赖性: 找不到类“com.mchange.v2.c3p0.ComboPooledDataSource” 找不到类“org.springframework.jdb
WARN (BasicResourcePool.java:1841) - com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@5ccb7
我有一个使用连接池的 Spring boot 项目。它在我的电脑上工作正常,但是当我的同事从 git 中提取代码然后尝试运行时。它抛出了如下错误: 2018-02-28 14:49:24.527 W
我正在尝试使用以下代码创建 context.xml: ComboPooledDataSource cpds = new ComboPooledDataSource(); try {
问题: 程序使用 com.mchange.v2.c3p0.ComboPooledDataSource 连接到 Sybase 服务器 程序依次执行 runSQL1() 和 runSQL2() 两个方法
我有一个应用程序可以并行插入数据库数据 block (从技术上讲,很多 native INSERT 查询都在 EntityManager 对象上执行)。 我现在正试图了解如何加速这些插入。数据库主机和
我的 c3p0 配置如下,有时我会在我的控制台中收到以下错误消息。为什么我会收到这个? 5 100 300 50 300
各位,我是一个java新手。我正在尝试调试其他人编写的应用程序。当应用程序访问数据库时,我会看到以下语句。 DEBUG [TP-Processor9] - ooo Using Connection [
我在我的项目中配置了以下 c3p0 设置。但是在执行jar文件时,我发现“没有可写属性”。请告诉我如何解决这个问题。 配置:- dataSource.setClassName("com.mchange
我在 tomcat 版本 7 上部署了一个 java 应用程序。对于数据源,我使用了连接到 mysql 数据库的 c3p0。它多年来一直运行良好,最近我开始收到此错误:“客户端在等待从 com.mch
我将 Java EE DAL 设置为 jar 库。我使用JPA + Hibernate + C3P0进行连接池管理。 EntityManager 类由以下 bean 生成 package my.dal
截至最近,我的 API 在从 Web 应用程序请求 PUT 时一直产生以下错误。由于某种奇怪的原因,它只发生在 PUT 上。有时它会起作用(垃圾邮件点击运行此 PUT 请求的项目),而有时它会失败并出
我正在使用一个移动网络应用程序,其中数据库部分我使用Hibernate,连接池c3p0,当我在开始工作正常,但是在执行了一些事务(例如选择、保存、更新)之后,我收到以下异常,我不知道为什么会发生, S
当我尝试使用 c3p0 测试 mysql 数据库连接时,Eclipse 显示以下错误: caused by:java.lang.NoClassDefFoundError:com/mchange/v2/
获取 NullPointerException 我收到 NullPointerException Exception in thread "com.mchange.v2.async.ThreadPoo
我正在开发一个 spring MVC 项目。项目仍在开发中,如果我将 war 部署到我的本地 Tomcat 7 服务器,我会在 STS 中收到以下警告。 控制台警告: ClassLoaderLeakP
我得到以下信息 java.lang.ClassCastException: com.mchange.v2.c3p0.impl.NewProxyConnection 当下面的代码执行时。你能帮我解决一下
环境:服务器:Jboss 4.2.3.GA 我们使用 c3p0 0.9.1.2 作为连接池。 每当我们在 Jboss AS 中热部署 war 文件时,都会遇到来自 c3p0 的内存泄漏。它最终导致“j
我正在使用 C3P0 0.9.1.2 为我的连接池配置数据源。 加载上下文时会引发错误。这是跟踪: java.lang.NoSuchMethodException: com.mchange.v2.c3
环境:服务器:Jboss 4.2.3.GA 我们使用 c3p0 0.9.1.2 作为连接池。 每当我们在 Jboss AS 中热部署 war 文件时,都会遇到来自 c3p0 的内存泄漏。它最终导致“j
我是一名优秀的程序员,十分优秀!