title: How to remove errors UnsupportedOperationException and Possible memory leak
body: <p>I have been searching a lot but have not found a perfect one which can help me to solve this problem.
  I have web services and am generating the stub using JAX-WS.
  To access the methods of web services I have wriiten a class in which all the methods are static like </p>
  
  <pre><code>public static String getLocation()
  {
   //call to the web service
  }
  </code></pre>
  
  <p>I am specifying static because I want to confirm this is not the root cause of my problem.
  Now when I am checking the logs in the Tomcat directory the catilina log shows some thins like this...This error is occured when I Startup or shutdown the tomcat server</p>
  
  <pre><code>Mar 18, 2010 11:13:07 PM org.apache.catalina.core.ApplicationContext log
  INFO: HTMLManager: stop: Stopping web application at '/testWeb'
  Mar 18, 2010 11:13:07 PM org.apache.catalina.loader.WebappClassLoader    clearReferencesThreads
  SEVERE: A web application appears to have started a thread named [leakingThread]  but  has failed to stop it. This is very likely to create a memory leak.
  </code></pre>
  
  <p>Another error I am seeing is </p>
  
  <pre><code>SEVERE: Unable to determine string representation of value of type      [com.sun.xml.stream.writers.XMLStreamWriterImpl]
  java.lang.UnsupportedOperationException
  at com.sun.xml.stream.writers.XMLStreamWriterImpl.entrySet (XMLStreamWriterImpl.java:2134)
  at java.util.AbstractMap.toString(AbstractMap.java:478)
  at org.apache.catalina.loader.WebappClassLoader.clearThreadLocalMap(WebappClassLoader.java:2433)
  at org.apache.catalina.loader.WebappClassLoader.clearReferencesThreadLocals(WebappClassLoader.java:2349)
  at org.apache.catalina.loader.WebappClassLoader.clearReferences(WebappClassLoader.java:1921)
  at org.apache.catalina.loader.WebappClassLoader.stop(WebappClassLoader.java:1833)
  at org.apache.catalina.loader.WebappLoader.stop(WebappLoader.java:740)
  at org.apache.catalina.core.StandardContext.stop(StandardContext.java:4920)
  at org.apache.catalina.core.ContainerBase.removeChild(ContainerBase.java:936)
  </code></pre>
  
  <p>Please can any one help  me to clear these errors.
  Thanks in advance.</p>