我正在尝试做一个项目,为我包含的xmlbeans 2.6.0.jar创建xlsx文件。当我尝试重新启动glassfish时,我得到了以下错误。请任何人来解决这个问题,并帮助我
Error:
Severe: The web application [/test] created a ThreadLocal with
key of type [org.apache.xmlbeans.impl.schema.SchemaTypeLoaderImpl$1]
(value
[org.apache.xmlbeans.impl.schema.SchemaTypeLoaderImpl$1@4f7c1b38]) and
a value of type [java.util.ArrayList] (value
[[java.lang.ref.SoftReference@51ec7f5b]]) 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.
Severe: The web application [/test] created a ThreadLocal with
key of type [org.apache.xmlbeans.impl.store.Locale$1] (value
[org.apache.xmlbeans.impl.store.Locale$1@736da929]) and a value of
type [java.lang.ref.SoftReference] (value
[java.lang.ref.SoftReference@60681b99]) 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.
Severe: The web application [/test] created a ThreadLocal with
key of type [org.apache.xmlbeans.XmlBeans$1] (value
[org.apache.xmlbeans.XmlBeans$1@4fe26977]) and a value of type
[java.lang.ref.SoftReference] (value
[java.lang.ref.SoftReference@7d46d177]) 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.发布于 2016-01-22 00:04:37
这是a known issue of XML Beans库。
你可以试试Jochen Kemnade的建议:
作为一种变通方法,我将POI转换移动到一个专用的线程池中,当我的webapp上下文被破坏时,我将其关闭。这样,所有的泄漏都会随池一起下降,而Tomcat的处理程序线程会保持干净
在Executor中完成工作,然后去掉它。
发布于 2019-08-08 01:55:55
自XMLBeans 3.1.0 (从Apache POI 4.1.0开始包含)以来,有一种方法可用于手动清除当前线程中XMLBeans中的所有线程本地变量:
org.apache.xmlbeans.ThreadLocalUtil.clearAllThreadLocals()请参阅https://issues.apache.org/jira/browse/XMLBEANS-502和http://xmlbeans.apache.org/status.html
https://stackoverflow.com/questions/32864558
复制相似问题