[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Javahl dll loading/unloading

From: Patrick Mayweg <mayweg_at_qint.de>
Date: 2004-03-21 12:23:27 CET

Hi Chrisstoph,

Christoph Lofi wrote:

>Hello.
>
>I am coding a web based svn repository browser (something like viewCVS) and
>I am using the javahl liberies in their newest version (yesterday).
>
>The applicatition is based on servlets deployed on Apache Tomcat 5. I am
>using one static class with has an instance of the SVNClient.
>
>The problem is, everytime when I redeploy the application, I have to restart
>the server because the access to the svnjavahl.dll is still blocked by the
>undeployed webapp. I'm using SVNClient.dispose() while undeploying, but it
>seems not to do anything.
>
>The exception I get is:
>
>java.lang.UnsatisfiedLinkError: Native Library
>C:\WINDOWS\system32\svnjavahl.dll already loaded in another classloader
>
>
This is a problem of using multiple class loader and native libraries
in java and has nothing specific to do with javahl.

A native library is loaded by a specify class loader and can not used by
a class loaded by any other classloader. The library will only be
unloaded when its classloader is garbage collected. After that it can be
reloaded by another classloader. Each web app is loaded by it own
classloader. When you redeploy your application, a new classloader is
used. That happens before the old classloader is garbage collected.
Possible solutions could be:
1.During undeployment, the old classloader is forcefully garbage collected.
2. Load javahl by the central classloader. It will not be reloaded
during redeployment.
3. I think I have heard, that jdk 1.5 may offer a solution for that
problem, because it is a common problem for app servers with native
libraries.

>What can I do?
>
>Thanks for help.
>
>Regards,
>Christoph
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
>For additional commands, e-mail: dev-help@subversion.tigris.org
>
>
>
Patrick

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sun Mar 21 12:18:59 2004

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.