大家好,我使用插件cargo-maven2-plugin在tomcat 8上运行我的集成测试(等待tomcat8-maven-plugin)
不幸的是,当我停止容器时,我有这个堆栈:
Web 应用程序 [sportInfo] 似乎已经启动了一个名为 [transcoder-2-1] 的线程,但未能停止它。这很可能造成内存泄漏。线程的堆栈跟踪:
和
java.lang.ref.WeakReference@606a2c5b}])但在 Web 应用程序停止时未能将其删除。线程将随着时间的推移而更新,以尝试避免可能的内存泄漏。
完整的堆栈:
[INFO] [talledLocalContainer] 声明:Web 应用程序 [sportInfo] 似乎已经启动了一个名为 [transcoder-2-1] 的线程,但未能停止它。这很可能造成内存泄漏。线程的堆栈跟踪:[INFO] [talledLocalContainer] sun.misc.Unsafe.park(Native Method) [INFO] [talledLocalContainer] java.util.concurrent.locks.LockSupport.park(LockSupport.java:175) [INFO] [ talledLocalContainer] java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039) [INFO] [talledLocalContainer] java.util.concurrent.ArrayBlockingQueue.take(ArrayBlockingQueue.java:403) [INFO] [talledLocalContainer] java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067) [信息] [talledLocalContainer] java.util.concurrent.ThreadPoolExecutor。runWorker(ThreadPoolExecutor.java:1127) [INFO] [talledLocalContainer] java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [INFO] [talledLocalContainer] java.lang.Thread.run(Thread.java: 745)[信息] [talledLocalContainer] déc。2015 年 1 月 1 日下午 6:46:42 org.apache.catalina.loader.WebappClassLoaderBase checkThreadLocalMapForLeaks [INFO] [talledLocalContainer] GRAVE:Web 应用程序 [sportInfo] 创建了一个 ThreadLocal,其键类型为 [org.apache.log4j.helpers.ThreadLocalMap ](值 [org.apache.log4j.helpers.ThreadLocalMap@38ba4aa4])和类型为 [java.util.Hashtable] 的值(值 [{threadId=52, sessionId=6090c68d-a0f2-4df1-954c-10e907c93535, clientApi =-1, hostName=macbook-pro-de-sarah.local, request=DELETE:/sportInfo/private/cache/sportInfo/regions}]) 但在 Web 应用程序停止时未能将其删除。线程将随着时间的推移而更新,以尝试避免可能的内存泄漏。[信息] [talledLocalContainer] 十二月。2015 年 1 月 1 日下午 6:46:42 org.apache.catalina.loader.WebappClassLoaderBase checkThreadLocalMapForLeaks [INFO] [talledLocalContainer] GRAVE:Web 应用程序 [sportInfo] 创建了一个 ThreadLocal,其键类型为 [com.sun.xml.bind.v2 .ClassFactory$1](值 [com.sun.xml.bind.v2.ClassFactory$1@6778ecb0])和类型为 [java.util.WeakHashMap] 的值(值 [{class fr.pmu.siteserver.domain.Type= java.lang.ref.WeakReference@6b3e31a2,类 fr.pmu.commons.services.mapping.IntegerListAdapter=java.lang.ref.WeakReference@30fb58d2,类 fr.pmu.siteserver.domain.Region=java.lang.ref。 WeakReference@5afecb03,类 fr.pmu.siteserver.domain.Class=java.lang.ref.WeakReference@7ac3b180,类 fr.pmu.siteserver.domain.SSResponse=java.lang.ref。WeakReference@606a2c5b}])但在 Web 应用程序停止时未能将其删除。线程将随着时间的推移而更新,以尝试避免可能的内存泄漏。
我的插件配置:
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>1.4.9</version>
<executions>
<execution>
<id>start-container</id>
<phase>pre-integration-test</phase>
<goals>
<goal>start</goal>
</goals>
</execution>
<execution>
<id>run</id>
<configuration>
<configuration>
<properties>
</properties>
</configuration>
</configuration>
<goals>
<goal>run</goal>
<goal>start</goal>
</goals>
</execution>
<execution>
<id>stop-container</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop</goal>
</goals>
<configuration>
<timeout>20000</timeout>
</configuration>
</execution>
</executions>
<configuration>
<container>
<containerId>tomcat8x</containerId>
<zipUrlInstaller>
<url>${tomcat8.url}</url>
</zipUrlInstaller>
<systemProperties>
<tomcat.instance.name>sportInfoIT</tomcat.instance.name>
<java.net.preferIPv4Stack>true</java.net.preferIPv4Stack>
</systemProperties>
</container>
<configuration>
<type>standalone</type>
<home>${environment.catalina.home}</home>
<properties>
<cargo.servlet.port>9084</cargo.servlet.port>
<path>/${project.build.finalName}</path>
</properties>
<files>
<file>
<file>${project.build.testOutputDirectory}</file>
<todir>lib</todir>
</file>
</files>
</configuration>
<deployables>
<deployable>
<groupId>${project.groupId}</groupId>
<artifactId>${project.artifactId}</artifactId>
<type>war</type>
<location>${project.build.directory}/${project.artifactId}-${project.version}.war
</location>
<properties>
<context>${project.build.finalName}</context>
</properties>
</deployable>
</deployables>
<deployer>
<type>installed</type>
</deployer>
</configuration>
</plugin>
你能帮我吗?