felix-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marcel Offermans <marcel.offerm...@luminis.nl>
Subject Re: Classloader exception
Date Wed, 19 Mar 2014 07:59:17 GMT
Hello Frizz,

That is exactly why OSGi has a built-in mechanism to load native code, to deal with such problems.
You say you are loading the DLL yourself, but did you look at the specification and its abilities
to load native code?

If for some reason you really can’t use the spec for this, I suggest you study the implementation
of loading native code in the Felix framework (which shows you what tricks to play) but to
be honest, I would not go there but leverage what is already present.

Greetings, Marcel


On 19 Mar 2014, at 4:32 , Frizz <frizzthecat@googlemail.com> wrote:

> Hi all,
> 
> I load a DLL using JNI. Because I'm still in development phase, I use
> "dev:watch" to automatically update my bundle in the container.
> 
> I understood that this results in an exception: "UnsatisfiedLinkError:
> Native Library xyz already loaded in another classloader" - because the DLL
> is already loaded by the JVM.
> 
> I also understood that only after the classloader that loaded the DLL is
> garbage collected, the DLL is unloaded.
> 
> So I uninstalled the bundle - yet I still get the UnsatisfiedLinkError
> exception. Which means the classloader is still alive.
> 
> Shouldn't the bundles classloader be gone once I uninstalled the bundle?
> 
> cheers,
> Frizz


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


Mime
View raw message