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:ch...@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....@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-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@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.

Reply via email to