How can I properly shutdown a JAX-WS Spring application on Tomcat?
Asked Answered
Y

1

9

After launching the application and immediately shutting down Tomcat, I receive the following two warnings of Tomcat:

Mrz 11, 2013 11:25:06 AM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
Schwerwiegend: The web application [] created a ThreadLocal with key of type [com.sun.xml.ws.api.server.ThreadLocalContainerResolver$1] (value [com.sun.xml.ws.api.server.ThreadLocalContainerResolver$1@9be26c]) and a value of type [com.sun.xml.ws.api.server.Container.NoneContainer] (value [com.sun.xml.ws.api.server.Container$NoneContainer@4c563]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
Mrz 11, 2013 11:25:06 AM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
Schwerwiegend: The web application [] created a ThreadLocal with key of type [com.sun.xml.bind.v2.ClassFactory$1] (value [com.sun.xml.bind.v2.ClassFactory$1@13af0d9]) and a value of type [java.util.WeakHashMap] (value [{class javax.xml.bind.annotation.adapters.CollapsedStringAdapter=java.lang.ref.WeakReference@9a5a11, class com.sun.xml.ws.runtime.config.TubelineDefinition=java.lang.ref.WeakReference@18f22cf, class javax.xml.bind.annotation.W3CDomHandler=java.lang.ref.WeakReference@368055, class java.util.ArrayList=java.lang.ref.WeakReference@2350a9, class com.sun.xml.ws.runtime.config.TubeFactoryConfig=java.lang.ref.WeakReference@84a0f6, class com.sun.xml.ws.runtime.config.TubeFactoryList=java.lang.ref.WeakReference@1638d4f, class com.sun.xml.ws.runtime.config.MetroConfig=java.lang.ref.WeakReference@d259f1, class com.sun.xml.ws.runtime.config.Tubelines=java.lang.ref.WeakReference@f12fa}]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.

Tomcat refuses to shutdown and hangs. I am using the com.sun.xml.ws.transport.http.servlet.WSSpringServlet. How should this webapp be closed properly?

Yesteryear answered 11/3, 2013 at 10:39 Comment(5)
I'm getting the same problem ! Did you find the solution ?Tessellation
@user3146733 Unfortunately not. I wrote a shutdownlistener which kills the remaining Threads.Yesteryear
Thanks! what did you write in this shutdownlistener ? and where did you call this listener ?Tessellation
I found similar post when I look around the forum and would share it here. Hope still could help. #9865492Ergonomics
can everyone coming here, please subscribe to github.com/javaee/metro-jax-ws/issues/1145 and +1 the issue, so it gets some love.Hydromancy
P
0

You can go to the tomcat application manager and find the application stop the application first. and then shut down the tomcat server.

Prussian answered 10/9, 2013 at 9:44 Comment(1)
That is not the point: Stopping the application from within the manager will cause the server to hang because there are ThreadLocals still allocated. I need a shutdown hook for the WSSpringServlet.Yesteryear

© 2022 - 2024 — McMap. All rights reserved.