tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: tomcat severe error when shutting down service but startup is clean
Date Fri, 13 Feb 2015 16:23:57 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

David,

On 2/12/15 12:59 PM, David kerber wrote:
> On 2/12/2015 12:48 PM, Cris Berneburg - US wrote:
>> 
>> -----Original Message----- From: David kerber
>> [mailto:dckerber@verizon.net] Sent: Thursday, February 12, 2015
>> 9:40 AM To: Tomcat Users List Subject: Re: tomcat severe error
>> when shutting down service but startup is clean
>> 
>> On 2/12/2015 9:06 AM, Wirth, Kevin wrote:
>>> I keep getting these weird tomcat errors on shutdown on a newly
>>> built system using tomcat 7.0.57 on  a windows 2012 server with
>>> jdk 1.7 that I can't figure out.  This is the catalina log: Feb
>>> 12, 2015 8:54:31 AM
>>> org.apache.catalina.loader.WebappClassLoader 
>>> clearReferencesJdbc SEVERE: The web application [/identityiq]
>>> registered the JDBC driver 
>>> [com.microsoft.sqlserver.jdbc.SQLServerDriver] but failed to 
>>> unregister it when the web application was stopped. To prevent
>>> a memory leak, the JDBC Driver has been forcibly unregistered. 
>>> Feb 12, 2015 8:54:31 AM
>>> org.apache.catalina.loader.WebappClassLoader 
>>> clearReferencesThreads SEVERE: The web application
>>> [/identityiq] appears to have started a thread named [Thread-3]
>>> but has failed to stop it. This is very likely to create a
>>> memory leak.
>> 
>>>>> I ran into this a while back, and it means exactly what it
>>>>> says: the db driver is being registered (loaded), but not
>>>>> being unloaded.  I fixed it by putting the db driver unload
>>>>> commands in a contextDestroyed method.
>> 
>> David
>> 
>> I have the same issue as Kevin.  What "unload commands" code did
>> you call in the contextDestroyed method?  Are those methods
>> "universal"? The reason I ask is because we use different ODBC
>> drivers for different environments.
> 
> I call this code from my .contextDestroyed method (I didn't write
> it, I copied it from somewhere on the web):
> 
> 
> public static void unRegisterDrivers() { try { for (
> Enumeration<Driver> drivers = DriverManager.getDrivers(); 
> drivers.hasMoreElements(); ) { DriverManager.deregisterDriver(
> drivers.nextElement() ); } } catch ( Exception e ) { /* log the
> exception */ } }

This is likely to over-reach in many scenarios. YMMV.

Also, Tomcat already de-registers drivers for you. So, this probably
isn't really changing anything.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJU3iUdAAoJEBzwKT+lPKRYjEAQAI2iNwQnzT4Rqv6qHswFPLE2
9S/Sb8JgM5ugN+FOkFu8jNllqvZA0wsqYY35a7JpKjKg8cVQcE9LF+gQrH4QJkhA
zdMK07pc756Q5XdxuMqIVwPy0TmQMKXDD2I/hAuWj1MTcyX57zaValTvdp29fOXm
NPiZe0LSd0unttawwFe5kbpF50pYlDWWVoBqyzRw9pCiAwC2z7mqG5Ytt9OXv4gR
p/l1Gu7sKdH6IDg7gcFCYh7qG9MzUz3kYc/5OSP+5nHTpRkJ7+d1/TKyYxF7EDmp
0stc0Q02O0/QoK9XZ5lfrgw1Bv7KXoiUaE5hbhtUj/3qV1PHjgGVaDOiCGXXSEiH
tp2gM3ex4Iz5qJcX0Jjr8WNuVSJb39Tvn1gtpuzui+EU95gnmfp2WFRBYw2V7SUM
SdyhPp/wvhd2hYYc9THOudFHkzzTBrdX8RqC/zHPWQPpctXSnntKxaczJWFl9Tcl
50AoSwxlLAEZ9S+phlyJuzlHU6mWOfz0LEJJinwBV/1a2pDAngFhuI/g0DQkyGi6
bz2oGfnev8/+NAiCFse7EzWvtc9U5F6RuXdxU0l66szw9Qu8htXMxQj4AfRnotPi
OFZunL0hSxTL5huR8LPfItjagfqqm3Ik/t7c8QdG2S2v4gw5CXgmWNWDr7abhvPj
o2ImiINb+5OBKDou78Nh
=IKCS
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message