When I close tomcat, it throws several errors related to OrientDB. This issue is I believe similar to this one, #2508
See original GitHub issueI am using Spring 4.0.5 for dependency injection. I have defined OrientDB as a bean in the root application context which shares it with everything. I have even specified the shutdown() method to terminate the bean safely. I am using 1.7.8 version and an older version of blueprints (2.5.0-SNAPSHOT) which was working. I have noticed that the 2.4.0 version of blueprints-orient-graph has an issue too. This works and I am able to fetch data too, but while closing the server it is giving some errors.
<bean id="orientConnector"
class="com.tinkerpop.blueprints.impls.orient.OrientGraph" destroy-method="shutdown">
<constructor-arg type="String">
<value>remote:localhost/database/#####</value>
</constructor-arg>
<constructor-arg type="String">
<value>admin</value>
</constructor-arg>
<constructor-arg type="String">
<value>admin</value>
</constructor-arg>
</bean>
The problem comes when I shutdown the server manually and I can see a bunch of errors mostly related to some threads that cannot be closed by Tomcat. Will this cause any troubles later?
INFO: Closing Spring root WebApplicationContext INFO : org.springframework.web.context.support.XmlWebApplicationContext - Closing Root WebApplicationContext: startup date [Thu Aug 28 15:39:25 IST 2014]; root of context hierarchy Aug 28, 2014 3:39:52 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads SEVERE: The web application [/PredictorWebService] appears to have started a thread named [Timer-0] but has failed to stop it. This is very likely to create a memory leak. Aug 28, 2014 3:39:52 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads SEVERE: The web application [/PredictorWebService] appears to have started a thread named [OrientDB MemoryWatchDog] but has failed to stop it. This is very likely to create a memory leak. Aug 28, 2014 3:39:52 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads SEVERE: The web application [/PredictorWebService] appears to have started a thread named [OrientDB <- Asynch Client (/127.0.0.1:2424)] but has failed to stop it. This is very likely to create a memory leak. Aug 28, 2014 3:39:52 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks SEVERE: The web application [/PredictorWebService] created a ThreadLocal with key of type [com.orientechnologies.orient.client.remote.OStorageRemoteThreadLocal](value [com.orientechnologies.orient.client.remote.OStorageRemoteThreadLocal@346bc53f]) and a value of type [com.orientechnologies.orient.client.remote.OStorageRemoteThreadLocal.OStorageRemoteSession](value [com.orientechnologies.orient.client.remote.OStorageRemoteThreadLocal$OStorageRemoteSession@f62c5fc]) 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. Aug 28, 2014 3:39:52 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks SEVERE: The web application [/PredictorWebService] created a ThreadLocal with key of type [com.orientechnologies.orient.core.db.ODatabaseRecordThreadLocal](value [com.orientechnologies.orient.core.db.ODatabaseRecordThreadLocal@1db42b48]) and a value of type [com.orientechnologies.orient.core.db.record.ODatabaseRecordTx](value [OrientDB[remote:localhost/database/EMT_DB] %28users: 3%29]) 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. Aug 28, 2014 3:39:52 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks SEVERE: The web application [/PredictorWebService] created a ThreadLocal with key of type [java.lang.ThreadLocal](value [java.lang.ThreadLocal@1f859334]) and a value of type [com.tinkerpop.blueprints.impls.orient.OrientGraphContext](value [com.tinkerpop.blueprints.impls.orient.OrientGraphContext@7a834b16]) 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. Aug 28, 2014 3:39:52 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks SEVERE: The web application [/PredictorWebService] created a ThreadLocal with key of type [com.orientechnologies.orient.client.remote.OStorageRemoteThreadLocal](value [com.orientechnologies.orient.client.remote.OStorageRemoteThreadLocal@346bc53f]) and a value of type [com.orientechnologies.orient.client.remote.OStorageRemoteThreadLocal.OStorageRemoteSession](value [com.orientechnologies.orient.client.remote.OStorageRemoteThreadLocal$OStorageRemoteSession@41b6d030]) 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. Aug 28, 2014 3:39:52 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks SEVERE: The web application [/PredictorWebService] created a ThreadLocal with key of type [com.orientechnologies.orient.core.db.ODatabaseRecordThreadLocal](value [com.orientechnologies.orient.core.db.ODatabaseRecordThreadLocal@1db42b48]) and a value of type [com.orientechnologies.orient.core.db.record.ODatabaseRecordTx](value [OrientDB[remote:localhost/database/EMT_DB] %28users: 3%29]) 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. Aug 28, 2014 3:39:52 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks SEVERE: The web application [/PredictorWebService] created a ThreadLocal with key of type [java.lang.ThreadLocal](value [java.lang.ThreadLocal@1f859334]) and a value of type [com.tinkerpop.blueprints.impls.orient.OrientGraphContext](value [com.tinkerpop.blueprints.impls.orient.OrientGraphContext@491e2104]) 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. Aug 28, 2014 3:39:52 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks SEVERE: The web application [/PredictorWebService] created a ThreadLocal with key of type [com.orientechnologies.orient.client.remote.OStorageRemoteThreadLocal](value [com.orientechnologies.orient.client.remote.OStorageRemoteThreadLocal@346bc53f]) and a value of type [com.orientechnologies.orient.client.remote.OStorageRemoteThreadLocal.OStorageRemoteSession](value [com.orientechnologies.orient.client.remote.OStorageRemoteThreadLocal$OStorageRemoteSession@5909b31c]) 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. Aug 28, 2014 3:39:52 PM org.apache.coyote.AbstractProtocol stop INFO: Stopping ProtocolHandler [“http-bio-8443”]
Issue Analytics
- State:
- Created 9 years ago
- Comments:5 (1 by maintainers)
Top GitHub Comments
I saw something like this. The problem was in “Shutdown hook” that is set in Orient. Solution is following: remove default hook
and shutdown DB explicitly from “onShutdown” methods of your application
That will make process of shutdown more synchronous and predictable.
Hi laa, thank you for considering it.
Hi PhantomYdn, actually I am using the blueprints interface to connect to the Database so that I can create a generic implementation and this is one primary requirement. This happens when the blueprints client calls the shutdown method which shuts it down just fine in a non threaded environment.