question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

When I close tomcat, it throws several errors related to OrientDB. This issue is I believe similar to this one, #2508

See original GitHub issue

I 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:closed
  • Created 9 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
PhantomYdncommented, Aug 31, 2014

I saw something like this. The problem was in “Shutdown hook” that is set in Orient. Solution is following: remove default hook

Orient.instance().removeShutdownHook();

and shutdown DB explicitly from “onShutdown” methods of your application

Orient.instance().shutdown();

That will make process of shutdown more synchronous and predictable.

1reaction
Dante-666commented, Aug 31, 2014

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Collibra Data Quality
Fixed an issue that caused the file type parser to throw an error message when the ... o You can now select different...
Read more >
Tomcat error after deploying from source code
I have to manually create this directory, which then removes one error when starting Tomcat. This brings up a new error though, which...
Read more >
Untitled
Uk release date for the hobbit dvd, Zweite haut fassade detail, Schaum french grammar 5th edition, Holec k-464, Amc 533d, Fly lima to...
Read more >
Jinq - OSCHINA - 中文开源技术交流社区
Jinq 为开发者提供轻松自然的方式来在 Java 应用中编写数据库查询。你可以把数据库当成普通的存储在集合里的 Java 对象,然后通过迭代器来访问这些对象,而代码会自动 ...
Read more >
ALL LI Targeting Options 10.19.2022 Blog Version | PDF ... - Scribd
100001 AGRICULTURE, AGRICULTURE OPERATIONS, AND RELATED SCIENCES 100002 Agriculture, General 100003 Agricultural Business and Management
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found