You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Si...@devk.de on 2015/10/27 15:39:21 UTC

Tomcat 6, DB2 Driver Problems

Hi,

we are using Apache Tomcat/6.0.41. I added the database driver " db2jcc4.jar" into the tomcat lib folder.
Our application don't deploy the database driver. We are connecting to  the datasource with a jndi datasource lookup.

But, after a HotDeployment I get every minute the following log-message

org.apache.catalina.loader.WebappClassLoader findResourceInternal
Information: Illegal access: this web application instance has been stopped already.  Could not load DB2JccConfiguration.properties.  The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact.


Any suggestions?

Thx,
Simone



Bitte denken Sie an die Umwelt. Müssen Sie diese E-Mail ausdrucken?
Wichtiger Hinweis zum Schutz Ihrer Daten!
 
Der Schutz von Kundendaten ist uns ein wichtiges Anliegen. Aus diesem Grund hat sich die DEVK freiwillig verpflichtet, die "Verhaltensregeln für den Umgang mit personenbezogenen Daten durch die deutsche Versicherungswirtschaft" (Code of Conduct) einzuhalten. Sie regeln die Erhebung, Verarbeitung und Nutzung von personenbezogenen Daten. Den vollen Wortlaut des Code of Conduct finden Sie unter www.devk.de/datenschutz.

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


AW: Tomcat 6, DB2 Driver Problems

Posted by Si...@devk.de.
Yes it is the lib folder of the tomcat


-----Ursprüngliche Nachricht-----
Von: Anderson Ramos [mailto:anderson.andy1981@gmail.com] 
Gesendet: Dienstag, 27. Oktober 2015 15:46
An: Tomcat Users List
Betreff: Re: Tomcat 6, DB2 Driver Problems

Hi Simone !

Are you tried to put this jar driver on tomcat common libs ?

I hope helped you.

Best regards...
Em 27/10/2015 12:39, <Si...@devk.de> escreveu:

> Hi,
>
> we are using Apache Tomcat/6.0.41. I added the database driver "
> db2jcc4.jar" into the tomcat lib folder.
> Our application don't deploy the database driver. We are connecting to
> the datasource with a jndi datasource lookup.
>
> But, after a HotDeployment I get every minute the following log-message
>
> org.apache.catalina.loader.WebappClassLoader findResourceInternal
> Information: Illegal access: this web application instance has been
> stopped already.  Could not load DB2JccConfiguration.properties.  The
> eventual following stack trace is caused by an error thrown for debugging
> purposes as well as to attempt to terminate the thread which caused the
> illegal access, and has no functional impact.
>
>
> Any suggestions?
>
> Thx,
> Simone
>
>
>
> Bitte denken Sie an die Umwelt. Müssen Sie diese E-Mail ausdrucken?
> Wichtiger Hinweis zum Schutz Ihrer Daten!
>
> Der Schutz von Kundendaten ist uns ein wichtiges Anliegen. Aus diesem
> Grund hat sich die DEVK freiwillig verpflichtet, die "Verhaltensregeln für
> den Umgang mit personenbezogenen Daten durch die deutsche
> Versicherungswirtschaft" (Code of Conduct) einzuhalten. Sie regeln die
> Erhebung, Verarbeitung und Nutzung von personenbezogenen Daten. Den vollen
> Wortlaut des Code of Conduct finden Sie unter www.devk.de/datenschutz.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
Wichtiger Hinweis zum Schutz Ihrer Daten!
 
Der Schutz von Kundendaten ist uns ein wichtiges Anliegen. Aus diesem Grund hat sich die DEVK freiwillig verpflichtet, die "Verhaltensregeln für den Umgang mit personenbezogenen Daten durch die deutsche Versicherungswirtschaft" (Code of Conduct) einzuhalten. Sie regeln die Erhebung, Verarbeitung und Nutzung von personenbezogenen Daten. Den vollen Wortlaut des Code of Conduct finden Sie unter www.devk.de/datenschutz.

Re: Tomcat 6, DB2 Driver Problems

Posted by Anderson Ramos <an...@gmail.com>.
Hi Simone !

Are you tried to put this jar driver on tomcat common libs ?

I hope helped you.

Best regards...
Em 27/10/2015 12:39, <Si...@devk.de> escreveu:

> Hi,
>
> we are using Apache Tomcat/6.0.41. I added the database driver "
> db2jcc4.jar" into the tomcat lib folder.
> Our application don't deploy the database driver. We are connecting to
> the datasource with a jndi datasource lookup.
>
> But, after a HotDeployment I get every minute the following log-message
>
> org.apache.catalina.loader.WebappClassLoader findResourceInternal
> Information: Illegal access: this web application instance has been
> stopped already.  Could not load DB2JccConfiguration.properties.  The
> eventual following stack trace is caused by an error thrown for debugging
> purposes as well as to attempt to terminate the thread which caused the
> illegal access, and has no functional impact.
>
>
> Any suggestions?
>
> Thx,
> Simone
>
>
>
> Bitte denken Sie an die Umwelt. Müssen Sie diese E-Mail ausdrucken?
> Wichtiger Hinweis zum Schutz Ihrer Daten!
>
> Der Schutz von Kundendaten ist uns ein wichtiges Anliegen. Aus diesem
> Grund hat sich die DEVK freiwillig verpflichtet, die "Verhaltensregeln für
> den Umgang mit personenbezogenen Daten durch die deutsche
> Versicherungswirtschaft" (Code of Conduct) einzuhalten. Sie regeln die
> Erhebung, Verarbeitung und Nutzung von personenbezogenen Daten. Den vollen
> Wortlaut des Code of Conduct finden Sie unter www.devk.de/datenschutz.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: AW: AW: AW: Tomcat 6, DB2 Driver Problems

Posted by Phil Steitz <ph...@gmail.com>.
On 10/29/15 7:14 AM, Christopher Schultz wrote:
> Simon,
>
> On 10/29/15 4:28 AM, Simone.Rodenbach.ext@devk.de wrote:
>> Thx,
>>
>> I hope this information helps: (The org.apache.commons.pool.impl.GenericObjectPool starts a timer ... )
>>
>> ava.util.TimerThread @ 0xc0772288                                                       |Timer-0|          128 |           384 |org.apache.catalina.loader.WebappClassLoader @ 0xc04bed30|true
>> |- at java.lang.Object.wait(J)V (Native Method)                                          |       |              |               |                                                         |
>> |- at java.util.TimerThread.mainLoop()V (Timer.java:552)                                 |       |              |               |                                                         |
>> |- at java.util.TimerThread.run()V (Timer.java:505)                                      |       |              |               |                                                         |
>> |  '- <local> java.util.TimerThread @ 0xc0772288  Timer-0 Thread                         |       |          128 |           384 |                                                         |
>> |     |- <class> class java.util.TimerThread @ 0xc0cd5080 System Class                   |       |            0 |             0 |                                                         |
>> |     |- group java.lang.ThreadGroup @ 0xc048b400  main                                  |       |           48 |           208 |                                                         |
>> |     |- contextClassLoader org.apache.catalina.loader.WebappClassLoader @ 0xc04bed30    |       |          200 |     1.314.384 |                                                         |
>> |     |- <Java Local>, queue java.util.TaskQueue @ 0xc0758a80 Busy Monitor               |       |           24 |         1.528 |                                                         |
>> |     |- <Java Local> java.util.TimerThread @ 0xc0772288  Timer-0 Thread                 |       |          128 |           384 |                                                         |
>> |     |- name char[7] @ 0xc0772408  Timer-0                                              |       |           32 |            32 |                                                         |
>> |     |- inheritedAccessControlContext java.security.AccessControlContext @ 0xc0772428   |       |           40 |           104 |                                                         |
>> |     |- inheritableThreadLocals java.lang.ThreadLocal$ThreadLocalMap @ 0xc0772490       |       |           24 |           104 |                                                         |
>> |     |- blockerLock java.lang.Object @ 0xc07724f8                                       |       |           16 |            16 |                                                         |
>> |     |- <Java Local> org.apache.commons.pool.impl.GenericObjectPool$Evictor @ 0xeefe76d0|       |           40 |            40 |                                                         |
>> |     |- <Java Local> java.lang.Object @ 0xeefe76f8                                      |       |           16 |            16 |                                                         |
>> |     '- Total: 11 entries                                                               |       |              |               |                                                         |
>> '- Total: 3 entries                                                                      |       |              |               |                                                         |
>> --------------------------------------------------------------------------------------------------------------------------------------------
> This was very difficult to interpret.
>
>> The stacktrace shows only:
>>
>> Timer-1
>>   at java.lang.Object.wait(J)V (Native Method)
>>   at java.util.TimerThread.mainLoop()V (Timer.java:552)
>>   at java.util.TimerThread.run()V (Timer.java:505)
> This was not, and it was about what I expected.
>
> Usually when a thread if blocked on a monitor, it will give you the hex
> address of the object being used as the monitor, and then you can do
> find out what object that is. In the case of the Timer, it might just be
> it's waiting on itself.
>
> Once you find out what that timer does when it wakes up, you'll probably
> find out who created the timer.
>
> If the timer thread truly is executing the GenericObjectEvictor, then
> there may be a bug in Tomcat. I don't see anything in the changelog that
> would explain this, but could you re-try your testing with Tomcat 6.0.44?

If it is a problem related to the Evictor, it is likely in commons
pool.  As Chris pointed out, the config specified the commons dbcp
datasource directly, rather than using the tomcat-provided
repackaged jar.  It would be good to know what versions of Commons
Pool and DBCP you have in the classpath.  If you remove the DS
override and upgrade to 6.0.44 you will pick up the latest
compatible versions.  If for some reason you want to keep the
override, you should check the versions and make sure that Pool is
1.5.7 (or 1.6) and DBCP is 1.4.

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



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


Re: AW: AW: AW: Tomcat 6, DB2 Driver Problems

Posted by Christopher Schultz <ch...@christopherschultz.net>.
Simon,

On 10/29/15 4:28 AM, Simone.Rodenbach.ext@devk.de wrote:
> Thx,
> 
> I hope this information helps: (The org.apache.commons.pool.impl.GenericObjectPool starts a timer ... )
> 
> ava.util.TimerThread @ 0xc0772288                                                       |Timer-0|          128 |           384 |org.apache.catalina.loader.WebappClassLoader @ 0xc04bed30|true
> |- at java.lang.Object.wait(J)V (Native Method)                                          |       |              |               |                                                         |
> |- at java.util.TimerThread.mainLoop()V (Timer.java:552)                                 |       |              |               |                                                         |
> |- at java.util.TimerThread.run()V (Timer.java:505)                                      |       |              |               |                                                         |
> |  '- <local> java.util.TimerThread @ 0xc0772288  Timer-0 Thread                         |       |          128 |           384 |                                                         |
> |     |- <class> class java.util.TimerThread @ 0xc0cd5080 System Class                   |       |            0 |             0 |                                                         |
> |     |- group java.lang.ThreadGroup @ 0xc048b400  main                                  |       |           48 |           208 |                                                         |
> |     |- contextClassLoader org.apache.catalina.loader.WebappClassLoader @ 0xc04bed30    |       |          200 |     1.314.384 |                                                         |
> |     |- <Java Local>, queue java.util.TaskQueue @ 0xc0758a80 Busy Monitor               |       |           24 |         1.528 |                                                         |
> |     |- <Java Local> java.util.TimerThread @ 0xc0772288  Timer-0 Thread                 |       |          128 |           384 |                                                         |
> |     |- name char[7] @ 0xc0772408  Timer-0                                              |       |           32 |            32 |                                                         |
> |     |- inheritedAccessControlContext java.security.AccessControlContext @ 0xc0772428   |       |           40 |           104 |                                                         |
> |     |- inheritableThreadLocals java.lang.ThreadLocal$ThreadLocalMap @ 0xc0772490       |       |           24 |           104 |                                                         |
> |     |- blockerLock java.lang.Object @ 0xc07724f8                                       |       |           16 |            16 |                                                         |
> |     |- <Java Local> org.apache.commons.pool.impl.GenericObjectPool$Evictor @ 0xeefe76d0|       |           40 |            40 |                                                         |
> |     |- <Java Local> java.lang.Object @ 0xeefe76f8                                      |       |           16 |            16 |                                                         |
> |     '- Total: 11 entries                                                               |       |              |               |                                                         |
> '- Total: 3 entries                                                                      |       |              |               |                                                         |
> --------------------------------------------------------------------------------------------------------------------------------------------

This was very difficult to interpret.

> The stacktrace shows only:
> 
> Timer-1
>   at java.lang.Object.wait(J)V (Native Method)
>   at java.util.TimerThread.mainLoop()V (Timer.java:552)
>   at java.util.TimerThread.run()V (Timer.java:505)

This was not, and it was about what I expected.

Usually when a thread if blocked on a monitor, it will give you the hex
address of the object being used as the monitor, and then you can do
find out what object that is. In the case of the Timer, it might just be
it's waiting on itself.

Once you find out what that timer does when it wakes up, you'll probably
find out who created the timer.

If the timer thread truly is executing the GenericObjectEvictor, then
there may be a bug in Tomcat. I don't see anything in the changelog that
would explain this, but could you re-try your testing with Tomcat 6.0.44?

-chris

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


AW: AW: AW: Tomcat 6, DB2 Driver Problems

Posted by Si...@devk.de.
Thx,

I hope this information helps: (The org.apache.commons.pool.impl.GenericObjectPool starts a timer ... )

ava.util.TimerThread @ 0xc0772288                                                       |Timer-0|          128 |           384 |org.apache.catalina.loader.WebappClassLoader @ 0xc04bed30|true
|- at java.lang.Object.wait(J)V (Native Method)                                          |       |              |               |                                                         |
|- at java.util.TimerThread.mainLoop()V (Timer.java:552)                                 |       |              |               |                                                         |
|- at java.util.TimerThread.run()V (Timer.java:505)                                      |       |              |               |                                                         |
|  '- <local> java.util.TimerThread @ 0xc0772288  Timer-0 Thread                         |       |          128 |           384 |                                                         |
|     |- <class> class java.util.TimerThread @ 0xc0cd5080 System Class                   |       |            0 |             0 |                                                         |
|     |- group java.lang.ThreadGroup @ 0xc048b400  main                                  |       |           48 |           208 |                                                         |
|     |- contextClassLoader org.apache.catalina.loader.WebappClassLoader @ 0xc04bed30    |       |          200 |     1.314.384 |                                                         |
|     |- <Java Local>, queue java.util.TaskQueue @ 0xc0758a80 Busy Monitor               |       |           24 |         1.528 |                                                         |
|     |- <Java Local> java.util.TimerThread @ 0xc0772288  Timer-0 Thread                 |       |          128 |           384 |                                                         |
|     |- name char[7] @ 0xc0772408  Timer-0                                              |       |           32 |            32 |                                                         |
|     |- inheritedAccessControlContext java.security.AccessControlContext @ 0xc0772428   |       |           40 |           104 |                                                         |
|     |- inheritableThreadLocals java.lang.ThreadLocal$ThreadLocalMap @ 0xc0772490       |       |           24 |           104 |                                                         |
|     |- blockerLock java.lang.Object @ 0xc07724f8                                       |       |           16 |            16 |                                                         |
|     |- <Java Local> org.apache.commons.pool.impl.GenericObjectPool$Evictor @ 0xeefe76d0|       |           40 |            40 |                                                         |
|     |- <Java Local> java.lang.Object @ 0xeefe76f8                                      |       |           16 |            16 |                                                         |
|     '- Total: 11 entries                                                               |       |              |               |                                                         |
'- Total: 3 entries                                                                      |       |              |               |                                                         |
--------------------------------------------------------------------------------------------------------------------------------------------


The stacktrace shows only:

Timer-1
  at java.lang.Object.wait(J)V (Native Method)
  at java.util.TimerThread.mainLoop()V (Timer.java:552)
  at java.util.TimerThread.run()V (Timer.java:505)

Thx, Simone



-----Ursprüngliche Nachricht-----
Von: André Warnier (tomcat) [mailto:aw@ice-sa.com] 
Gesendet: Donnerstag, 29. Oktober 2015 09:17
An: users@tomcat.apache.org
Betreff: Re: AW: AW: Tomcat 6, DB2 Driver Problems

On 29.10.2015 09:09, Simone.Rodenbach.ext@devk.de wrote:
> Hi Christopher,
>
> I attachted some pictures of the threads.
>
> Thx,
>   Simone
>

Hi Simone.
Christopher is in the USA, so it will take some time before he responds.
For the sake of gaining some time however : your attachments did not make it to the list, 
which strips most attachments.
Better : use a text editor to cut and paste the stack trace right here :



>
>
> -----Ursprüngliche Nachricht-----
> Von: Christopher Schultz [mailto:chris@christopherschultz.net]
> Gesendet: Mittwoch, 28. Oktober 2015 15:30
> An: Tomcat Users List
> Betreff: Re: AW: Tomcat 6, DB2 Driver Problems
>
> Simone,
>
> On 10/28/15 4:02 AM, Simone.Rodenbach.ext@devk.de wrote:
>> I tried to google for the driver and classloader and found nothing that helped me :-(
>
>> I can only provide you with this information:
>>
>> I configured the datasource in the context.xml
>>
>> <Resource name="jdbc/xxx" auth="Container" type="javax.sql.DataSource"
>> factory="org.apache.commons.dbcp.BasicDataSourceFactory"
>
> Why are you overriding Tomcat's default DataSourceFactory with another one?
>
>> maxActive="10" minIdle="2" maxIdle="10" maxWait="10000"
>> minEvictableIdleTimeMillis="120000" timeBetweenEvictionRunsMillis="60000"
>> username="xxx"
>>          password="xxx"
>> driverClassName="com.ibm.db2.jcc.DB2Driver"
>> url="xxx;"
>> validationQuery="select 1 from sysibm.sysdummy1" />
>>
>>
>> The spring bean
>>
>> <jee:jndi-lookup id="dataSource" jndi-name="java:/comp/env/jdbc/xxx" expected-type="javax.sql.DataSource" />
>>
>> I created a test project. Because oft hat I'm sure that I don't start a thread.
>
> It doesn't have to be *your code* starting the thread directly. JDBC
> drivers have a habit of launching their own cleanup threads and then not
> offering any interface to stop them.
>
>> But the log says:
>>
>> Okt 28, 2015 8:41:15 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
>> SCHWERWIEGEND: The web application [/test] appears to have started a thread named [Timer-0] but has failed to stop it. This is very likely to create a memory leak.
>>
>> I think this thread is started from org.apache.commons.dbcp.BasicDataSourceFactory.
>
> Nope, BasicDataSourceFactory doesn't have the word "thread" anywhere in
> its code:
> http://svn.apache.org/viewvc/commons/proper/dbcp/tags/DBCP_1_4/src/java/org/apache/commons/dbcp/BasicDataSourceFactory.java?view=markup
>
>> I removed the db2cc4.jar to get an exception to inspect from where the driver is loaded and got:
>>
>>   Caused by: java.lang.ClassNotFoundException: com.ibm.db2.jcc.DB2Driver
>> at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1858)
>> at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1709)
>> at org.apache.commons.dbcp.BasicDataSource.createConnectionFactory(BasicDataSource.java:1420)
>
> That only tells you where the driver is loaded. It doesn't tell you when
> the thread was launched.
>
> After shutting-down your web application (and getting the warning about
> the Timer-0 thread), can you take a thread dump and show us the stack
> trace for the Timer-0 thread?
>
> -chris
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
>
> Bitte denken Sie an die Umwelt. Müssen Sie diese E-Mail ausdrucken?
> Wichtiger Hinweis zum Schutz Ihrer Daten!
>
> Der Schutz von Kundendaten ist uns ein wichtiges Anliegen. Aus diesem Grund hat sich die DEVK freiwillig verpflichtet, die "Verhaltensregeln für den Umgang mit personenbezogenen Daten durch die deutsche Versicherungswirtschaft" (Code of Conduct) einzuhalten. Sie regeln die Erhebung, Verarbeitung und Nutzung von personenbezogenen Daten. Den vollen Wortlaut des Code of Conduct finden Sie unter www.devk.de/datenschutz.
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>


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

Wichtiger Hinweis zum Schutz Ihrer Daten!
 
Der Schutz von Kundendaten ist uns ein wichtiges Anliegen. Aus diesem Grund hat sich die DEVK freiwillig verpflichtet, die "Verhaltensregeln für den Umgang mit personenbezogenen Daten durch die deutsche Versicherungswirtschaft" (Code of Conduct) einzuhalten. Sie regeln die Erhebung, Verarbeitung und Nutzung von personenbezogenen Daten. Den vollen Wortlaut des Code of Conduct finden Sie unter www.devk.de/datenschutz.


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


Re: AW: AW: Tomcat 6, DB2 Driver Problems

Posted by "André Warnier (tomcat)" <aw...@ice-sa.com>.
On 29.10.2015 09:09, Simone.Rodenbach.ext@devk.de wrote:
> Hi Christopher,
>
> I attachted some pictures of the threads.
>
> Thx,
>   Simone
>

Hi Simone.
Christopher is in the USA, so it will take some time before he responds.
For the sake of gaining some time however : your attachments did not make it to the list, 
which strips most attachments.
Better : use a text editor to cut and paste the stack trace right here :



>
>
> -----Ursprüngliche Nachricht-----
> Von: Christopher Schultz [mailto:chris@christopherschultz.net]
> Gesendet: Mittwoch, 28. Oktober 2015 15:30
> An: Tomcat Users List
> Betreff: Re: AW: Tomcat 6, DB2 Driver Problems
>
> Simone,
>
> On 10/28/15 4:02 AM, Simone.Rodenbach.ext@devk.de wrote:
>> I tried to google for the driver and classloader and found nothing that helped me :-(
>
>> I can only provide you with this information:
>>
>> I configured the datasource in the context.xml
>>
>> <Resource name="jdbc/xxx" auth="Container" type="javax.sql.DataSource"
>> factory="org.apache.commons.dbcp.BasicDataSourceFactory"
>
> Why are you overriding Tomcat's default DataSourceFactory with another one?
>
>> maxActive="10" minIdle="2" maxIdle="10" maxWait="10000"
>> minEvictableIdleTimeMillis="120000" timeBetweenEvictionRunsMillis="60000"
>> username="xxx"
>>          password="xxx"
>> driverClassName="com.ibm.db2.jcc.DB2Driver"
>> url="xxx;"
>> validationQuery="select 1 from sysibm.sysdummy1" />
>>
>>
>> The spring bean
>>
>> <jee:jndi-lookup id="dataSource" jndi-name="java:/comp/env/jdbc/xxx" expected-type="javax.sql.DataSource" />
>>
>> I created a test project. Because oft hat I'm sure that I don't start a thread.
>
> It doesn't have to be *your code* starting the thread directly. JDBC
> drivers have a habit of launching their own cleanup threads and then not
> offering any interface to stop them.
>
>> But the log says:
>>
>> Okt 28, 2015 8:41:15 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
>> SCHWERWIEGEND: The web application [/test] appears to have started a thread named [Timer-0] but has failed to stop it. This is very likely to create a memory leak.
>>
>> I think this thread is started from org.apache.commons.dbcp.BasicDataSourceFactory.
>
> Nope, BasicDataSourceFactory doesn't have the word "thread" anywhere in
> its code:
> http://svn.apache.org/viewvc/commons/proper/dbcp/tags/DBCP_1_4/src/java/org/apache/commons/dbcp/BasicDataSourceFactory.java?view=markup
>
>> I removed the db2cc4.jar to get an exception to inspect from where the driver is loaded and got:
>>
>>   Caused by: java.lang.ClassNotFoundException: com.ibm.db2.jcc.DB2Driver
>> at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1858)
>> at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1709)
>> at org.apache.commons.dbcp.BasicDataSource.createConnectionFactory(BasicDataSource.java:1420)
>
> That only tells you where the driver is loaded. It doesn't tell you when
> the thread was launched.
>
> After shutting-down your web application (and getting the warning about
> the Timer-0 thread), can you take a thread dump and show us the stack
> trace for the Timer-0 thread?
>
> -chris
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
>
> Bitte denken Sie an die Umwelt. Müssen Sie diese E-Mail ausdrucken?
> Wichtiger Hinweis zum Schutz Ihrer Daten!
>
> Der Schutz von Kundendaten ist uns ein wichtiges Anliegen. Aus diesem Grund hat sich die DEVK freiwillig verpflichtet, die "Verhaltensregeln für den Umgang mit personenbezogenen Daten durch die deutsche Versicherungswirtschaft" (Code of Conduct) einzuhalten. Sie regeln die Erhebung, Verarbeitung und Nutzung von personenbezogenen Daten. Den vollen Wortlaut des Code of Conduct finden Sie unter www.devk.de/datenschutz.
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>


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


AW: AW: Tomcat 6, DB2 Driver Problems

Posted by Si...@devk.de.
Hi Christopher,

I attachted some pictures of the threads.

Thx,
 Simone



-----Ursprüngliche Nachricht-----
Von: Christopher Schultz [mailto:chris@christopherschultz.net]
Gesendet: Mittwoch, 28. Oktober 2015 15:30
An: Tomcat Users List
Betreff: Re: AW: Tomcat 6, DB2 Driver Problems

Simone,

On 10/28/15 4:02 AM, Simone.Rodenbach.ext@devk.de wrote:
> I tried to google for the driver and classloader and found nothing that helped me :-(

> I can only provide you with this information:
>
> I configured the datasource in the context.xml
>
> <Resource name="jdbc/xxx" auth="Container" type="javax.sql.DataSource"
> factory="org.apache.commons.dbcp.BasicDataSourceFactory"

Why are you overriding Tomcat's default DataSourceFactory with another one?

> maxActive="10" minIdle="2" maxIdle="10" maxWait="10000"
> minEvictableIdleTimeMillis="120000" timeBetweenEvictionRunsMillis="60000"
> username="xxx"
>         password="xxx"
> driverClassName="com.ibm.db2.jcc.DB2Driver"
> url="xxx;"
> validationQuery="select 1 from sysibm.sysdummy1" />
>
>
> The spring bean
>
> <jee:jndi-lookup id="dataSource" jndi-name="java:/comp/env/jdbc/xxx" expected-type="javax.sql.DataSource" />
>
> I created a test project. Because oft hat I'm sure that I don't start a thread.

It doesn't have to be *your code* starting the thread directly. JDBC
drivers have a habit of launching their own cleanup threads and then not
offering any interface to stop them.

> But the log says:
>
> Okt 28, 2015 8:41:15 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
> SCHWERWIEGEND: The web application [/test] appears to have started a thread named [Timer-0] but has failed to stop it. This is very likely to create a memory leak.
>
> I think this thread is started from org.apache.commons.dbcp.BasicDataSourceFactory.

Nope, BasicDataSourceFactory doesn't have the word "thread" anywhere in
its code:
http://svn.apache.org/viewvc/commons/proper/dbcp/tags/DBCP_1_4/src/java/org/apache/commons/dbcp/BasicDataSourceFactory.java?view=markup

> I removed the db2cc4.jar to get an exception to inspect from where the driver is loaded and got:
>
>  Caused by: java.lang.ClassNotFoundException: com.ibm.db2.jcc.DB2Driver
> at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1858)
> at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1709)
> at org.apache.commons.dbcp.BasicDataSource.createConnectionFactory(BasicDataSource.java:1420)

That only tells you where the driver is loaded. It doesn't tell you when
the thread was launched.

After shutting-down your web application (and getting the warning about
the Timer-0 thread), can you take a thread dump and show us the stack
trace for the Timer-0 thread?

-chris

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



Bitte denken Sie an die Umwelt. Müssen Sie diese E-Mail ausdrucken?
Wichtiger Hinweis zum Schutz Ihrer Daten!
 
Der Schutz von Kundendaten ist uns ein wichtiges Anliegen. Aus diesem Grund hat sich die DEVK freiwillig verpflichtet, die "Verhaltensregeln für den Umgang mit personenbezogenen Daten durch die deutsche Versicherungswirtschaft" (Code of Conduct) einzuhalten. Sie regeln die Erhebung, Verarbeitung und Nutzung von personenbezogenen Daten. Den vollen Wortlaut des Code of Conduct finden Sie unter www.devk.de/datenschutz.

Re: AW: Tomcat 6, DB2 Driver Problems

Posted by Christopher Schultz <ch...@christopherschultz.net>.
Simone,

On 10/28/15 4:02 AM, Simone.Rodenbach.ext@devk.de wrote:
> I tried to google for the driver and classloader and found nothing that helped me :-(

> I can only provide you with this information:
> 
> I configured the datasource in the context.xml
> 
> <Resource name="jdbc/xxx" auth="Container" type="javax.sql.DataSource"
> factory="org.apache.commons.dbcp.BasicDataSourceFactory"

Why are you overriding Tomcat's default DataSourceFactory with another one?

> maxActive="10" minIdle="2" maxIdle="10" maxWait="10000"
> minEvictableIdleTimeMillis="120000" timeBetweenEvictionRunsMillis="60000"
> username="xxx"
>         password="xxx"
> driverClassName="com.ibm.db2.jcc.DB2Driver"
> url="xxx;"
> validationQuery="select 1 from sysibm.sysdummy1" />
> 
> 
> The spring bean
> 
> <jee:jndi-lookup id="dataSource" jndi-name="java:/comp/env/jdbc/xxx" expected-type="javax.sql.DataSource" />
> 
> I created a test project. Because oft hat I'm sure that I don't start a thread.

It doesn't have to be *your code* starting the thread directly. JDBC
drivers have a habit of launching their own cleanup threads and then not
offering any interface to stop them.

> But the log says:
> 
> Okt 28, 2015 8:41:15 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
> SCHWERWIEGEND: The web application [/test] appears to have started a thread named [Timer-0] but has failed to stop it. This is very likely to create a memory leak.
> 
> I think this thread is started from org.apache.commons.dbcp.BasicDataSourceFactory.

Nope, BasicDataSourceFactory doesn't have the word "thread" anywhere in
its code:
http://svn.apache.org/viewvc/commons/proper/dbcp/tags/DBCP_1_4/src/java/org/apache/commons/dbcp/BasicDataSourceFactory.java?view=markup

> I removed the db2cc4.jar to get an exception to inspect from where the driver is loaded and got:
> 
>  Caused by: java.lang.ClassNotFoundException: com.ibm.db2.jcc.DB2Driver
> at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1858)
> at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1709)
> at org.apache.commons.dbcp.BasicDataSource.createConnectionFactory(BasicDataSource.java:1420)

That only tells you where the driver is loaded. It doesn't tell you when
the thread was launched.

After shutting-down your web application (and getting the warning about
the Timer-0 thread), can you take a thread dump and show us the stack
trace for the Timer-0 thread?

-chris

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


AW: Tomcat 6, DB2 Driver Problems

Posted by Si...@devk.de.
Hi Christopher,

I tried to google for the driver and classloader and found nothing that helped me :-(

I can only provide you with this information:

I configured the datasource in the context.xml

<Resource name="jdbc/xxx" auth="Container" type="javax.sql.DataSource"
factory="org.apache.commons.dbcp.BasicDataSourceFactory"
maxActive="10" minIdle="2" maxIdle="10" maxWait="10000"
minEvictableIdleTimeMillis="120000" timeBetweenEvictionRunsMillis="60000"
username="xxx"
        password="xxx"
driverClassName="com.ibm.db2.jcc.DB2Driver"
url="xxx;"
validationQuery="select 1 from sysibm.sysdummy1" />


The spring bean

<jee:jndi-lookup id="dataSource" jndi-name="java:/comp/env/jdbc/xxx" expected-type="javax.sql.DataSource" />

I created a test project. Because oft hat I'm sure that I don't start a thread.
But the log says:

Okt 28, 2015 8:41:15 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SCHWERWIEGEND: The web application [/test] appears to have started a thread named [Timer-0] but has failed to stop it. This is very likely to create a memory leak.

I think this thread is started from org.apache.commons.dbcp.BasicDataSourceFactory.


I removed the db2cc4.jar to get an exception to inspect from where the driver is loaded and got:

 Caused by: java.lang.ClassNotFoundException: com.ibm.db2.jcc.DB2Driver
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1858)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1709)
at org.apache.commons.dbcp.BasicDataSource.createConnectionFactory(BasicDataSource.java:1420)


Thx for help,
Simone





-----Ursprüngliche Nachricht-----
Von: Christopher Schultz [mailto:chris@christopherschultz.net]
Gesendet: Dienstag, 27. Oktober 2015 15:51
An: Tomcat Users List
Betreff: Re: Tomcat 6, DB2 Driver Problems

Simone,

On 10/27/15 10:39 AM, Simone.Rodenbach.ext@devk.de wrote:
> we are using Apache Tomcat/6.0.41. I added the database driver " db2jcc4.jar" into the tomcat lib folder.
> Our application don't deploy the database driver. We are connecting to  the datasource with a jndi datasource lookup.
>
> But, after a HotDeployment I get every minute the following log-message
>
> org.apache.catalina.loader.WebappClassLoader findResourceInternal
> Information: Illegal access: this web application instance has been
> stopped already.  Could not load DB2JccConfiguration.properties.  The
> eventual following stack trace is caused by an error thrown for
> debugging purposes as well as to attempt to terminate the thread
> which caused the illegal access, and has no functional impact.

Do you have a stack trace or at least a Thread name for this? If so,
please post that.

This usually happens when the "old" application is shutting-down, and
some component tries to load a resource form the ClassLoader. The most
likely thing is that you have a thread in the "old" deployment of the
application that is either still running, or still trying to shut down
when Tomcat has already "stopped" the old deployment and told the
WebappClassLoader not to load anything else.

The solution is to make sure that you stop all application-started
threads before your application stops. Or, equally likely, you need to
make sure that driver-created threads are started using Tomcat's
ClassLoader and not that of the web application.

You might want to check to make sure you have the latest version of your
DB2 JDBC driver. Also maybe do a web search for "drivername +
classloader" will find information on preventing the problem.

Tomcat can be configured to call certain methods to "trick" a class into
binding to the server's ClassLoader instead of the web application's
ClassLoader on startup. I'm not exactly sure how that would need to be
done with your DB2 driver, which is why I suggested the web search.

-chris

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



Bitte denken Sie an die Umwelt. Müssen Sie diese E-Mail ausdrucken?
Wichtiger Hinweis zum Schutz Ihrer Daten!
 
Der Schutz von Kundendaten ist uns ein wichtiges Anliegen. Aus diesem Grund hat sich die DEVK freiwillig verpflichtet, die "Verhaltensregeln für den Umgang mit personenbezogenen Daten durch die deutsche Versicherungswirtschaft" (Code of Conduct) einzuhalten. Sie regeln die Erhebung, Verarbeitung und Nutzung von personenbezogenen Daten. Den vollen Wortlaut des Code of Conduct finden Sie unter www.devk.de/datenschutz.

Re: Tomcat 6, DB2 Driver Problems

Posted by Christopher Schultz <ch...@christopherschultz.net>.
Simone,

On 10/27/15 10:39 AM, Simone.Rodenbach.ext@devk.de wrote:
> we are using Apache Tomcat/6.0.41. I added the database driver " db2jcc4.jar" into the tomcat lib folder.
> Our application don't deploy the database driver. We are connecting to  the datasource with a jndi datasource lookup.
> 
> But, after a HotDeployment I get every minute the following log-message
> 
> org.apache.catalina.loader.WebappClassLoader findResourceInternal
> Information: Illegal access: this web application instance has been
> stopped already.  Could not load DB2JccConfiguration.properties.  The
> eventual following stack trace is caused by an error thrown for
> debugging purposes as well as to attempt to terminate the thread
> which caused the illegal access, and has no functional impact.

Do you have a stack trace or at least a Thread name for this? If so,
please post that.

This usually happens when the "old" application is shutting-down, and
some component tries to load a resource form the ClassLoader. The most
likely thing is that you have a thread in the "old" deployment of the
application that is either still running, or still trying to shut down
when Tomcat has already "stopped" the old deployment and told the
WebappClassLoader not to load anything else.

The solution is to make sure that you stop all application-started
threads before your application stops. Or, equally likely, you need to
make sure that driver-created threads are started using Tomcat's
ClassLoader and not that of the web application.

You might want to check to make sure you have the latest version of your
DB2 JDBC driver. Also maybe do a web search for "drivername +
classloader" will find information on preventing the problem.

Tomcat can be configured to call certain methods to "trick" a class into
binding to the server's ClassLoader instead of the web application's
ClassLoader on startup. I'm not exactly sure how that would need to be
done with your DB2 driver, which is why I suggested the web search.

-chris

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