You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Hubert Felber <Hu...@abacus.ch> on 2015/08/21 20:05:52 UTC

cannot delete bundle jar from load directory (locked)

Hi,

I cannot delete a certain bundle jar from load directory, while I can
do this with others in the same load directory while they are running.
It says that this is open by java --  I do not receive a stop event in
the activator.

This specific bundle has embedded jniWrapper jar and lots of native
libraries (dlls). 
The jniWrapper is active and the native libraries are loaded.

What could cause this lock? Can I do anything to avoid this lock?

Thank you
regards
Hubert

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


Re: cannot delete bundle jar from load directory (locked)

Posted by Hubert Felber <Hu...@abacus.ch>.
Ferry,

many thanks for this info

Regards
Hubert

>>> Ferry Huberts <ma...@hupie.com> 21.08.2015 21:21 >>>
This is an inherent problem of using native code.

AFAIK, once a library is loaded, it can't be unloaded, neither on 
Windows nor on Linux or Mac; the library remains in the address space
of 
the process that loaded it, which in this case is the Java runtime.

The only way to unload the library is to stop the process, which 
obviously kills your use-case.

This is exactly the same problem as the Celix guys have (they're 
building an OSGi framework implementation in C).

On Windows there are file locks on the bundle with the native
libraries, 
on Linux there are no such locks (IIRC).

Still, removing the bundle while its native libraries were loaded is 
kind-of cheating and tricky at best.

Until the C libraries of our OSes provide us with a way to unload a 
library we're stuck with this problem.

On 21/08/15 21:10, Hubert Felber wrote:
> < Did you refresh after uninstalling ?
>
> yes,
>
> stop - uninstall -  refresh
>
> it did not help
>
> Thank you
> Hubert
>
>
>
>>>> "Richard S. Hall" <he...@ungoverned.org> 21.08.2015 20:28 >>>
> On 8/21/15 14:24 , Hubert Felber wrote:
>> <<Windows
>>
>> :-)
>>
>> << 1. stop the bundle before deleting its bundle
>>
>> neither stop nor uninstall the bundle helps. It must have to do
with
>> the native code running -- is still locked.
>
> Did you refresh after uninstalling ?
>
>>
>> <<2. stop using windows, by far the best choice IMHO :-)
>>
>> well, since our customers insist of using windows ....
>>
>> regards
>> Hubert
>>
>>>>> Ferry Huberts <ma...@hupie.com> 21.08.2015 20:08 >>>
>>
>> On 21/08/15 20:05, Hubert Felber wrote:
>>> Hi,
>>>
>>> I cannot delete a certain bundle jar from load directory, while I
>> can
>>> do this with others in the same load directory while they are
>> running.
>>> It says that this is open by java --  I do not receive a stop
event
>> in
>>> the activator.
>>>
>>> This specific bundle has embedded jniWrapper jar and lots of
native
>>> libraries (dlls).
>>> The jniWrapper is active and the native libraries are loaded.
>>>
>>> What could cause this lock?
>> Windows
>>
>>> Can I do anything to avoid this lock?
>> 1. stop the bundle before deleting its bundle
>> 2. stop using windows, by far the best choice IMHO :-)
>>
>>
>>
>
---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org 
>> For additional commands, e-mail: users-help@felix.apache.org 
>>
>>
>>
>
---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org 
>> For additional commands, e-mail: users-help@felix.apache.org 
>>
>
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org 
> For additional commands, e-mail: users-help@felix.apache.org 
>
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org 
> For additional commands, e-mail: users-help@felix.apache.org 
>

-- 
Ferry Huberts

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


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


Re: cannot delete bundle jar from load directory (locked)

Posted by Ferry Huberts <ma...@hupie.com>.
This is an inherent problem of using native code.

AFAIK, once a library is loaded, it can't be unloaded, neither on 
Windows nor on Linux or Mac; the library remains in the address space of 
the process that loaded it, which in this case is the Java runtime.

The only way to unload the library is to stop the process, which 
obviously kills your use-case.

This is exactly the same problem as the Celix guys have (they're 
building an OSGi framework implementation in C).

On Windows there are file locks on the bundle with the native libraries, 
on Linux there are no such locks (IIRC).

Still, removing the bundle while its native libraries were loaded is 
kind-of cheating and tricky at best.

Until the C libraries of our OSes provide us with a way to unload a 
library we're stuck with this problem.

On 21/08/15 21:10, Hubert Felber wrote:
> < Did you refresh after uninstalling ?
>
> yes,
>
> stop - uninstall -  refresh
>
> it did not help
>
> Thank you
> Hubert
>
>
>
>>>> "Richard S. Hall" <he...@ungoverned.org> 21.08.2015 20:28 >>>
> On 8/21/15 14:24 , Hubert Felber wrote:
>> <<Windows
>>
>> :-)
>>
>> << 1. stop the bundle before deleting its bundle
>>
>> neither stop nor uninstall the bundle helps. It must have to do with
>> the native code running -- is still locked.
>
> Did you refresh after uninstalling ?
>
>>
>> <<2. stop using windows, by far the best choice IMHO :-)
>>
>> well, since our customers insist of using windows ....
>>
>> regards
>> Hubert
>>
>>>>> Ferry Huberts <ma...@hupie.com> 21.08.2015 20:08 >>>
>>
>> On 21/08/15 20:05, Hubert Felber wrote:
>>> Hi,
>>>
>>> I cannot delete a certain bundle jar from load directory, while I
>> can
>>> do this with others in the same load directory while they are
>> running.
>>> It says that this is open by java --  I do not receive a stop event
>> in
>>> the activator.
>>>
>>> This specific bundle has embedded jniWrapper jar and lots of native
>>> libraries (dlls).
>>> The jniWrapper is active and the native libraries are loaded.
>>>
>>> What could cause this lock?
>> Windows
>>
>>> Can I do anything to avoid this lock?
>> 1. stop the bundle before deleting its bundle
>> 2. stop using windows, by far the best choice IMHO :-)
>>
>>
>>
> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>>
>>
>>
> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>

-- 
Ferry Huberts

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


Re: cannot delete bundle jar from load directory (locked)

Posted by Hubert Felber <Hu...@abacus.ch>.
< Did you refresh after uninstalling ?

yes, 

stop - uninstall -  refresh

it did not help

Thank you
Hubert



>>> "Richard S. Hall" <he...@ungoverned.org> 21.08.2015 20:28 >>>
On 8/21/15 14:24 , Hubert Felber wrote:
> <<Windows
>
> :-)
>
> << 1. stop the bundle before deleting its bundle
>
> neither stop nor uninstall the bundle helps. It must have to do with
> the native code running -- is still locked.

Did you refresh after uninstalling ?

>
> <<2. stop using windows, by far the best choice IMHO :-)
>
> well, since our customers insist of using windows ....
>
> regards
> Hubert
>
>>>> Ferry Huberts <ma...@hupie.com> 21.08.2015 20:08 >>>
>
> On 21/08/15 20:05, Hubert Felber wrote:
>> Hi,
>>
>> I cannot delete a certain bundle jar from load directory, while I
> can
>> do this with others in the same load directory while they are
> running.
>> It says that this is open by java --  I do not receive a stop event
> in
>> the activator.
>>
>> This specific bundle has embedded jniWrapper jar and lots of native
>> libraries (dlls).
>> The jniWrapper is active and the native libraries are loaded.
>>
>> What could cause this lock?
> Windows
>
>> Can I do anything to avoid this lock?
> 1. stop the bundle before deleting its bundle
> 2. stop using windows, by far the best choice IMHO :-)
>
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org 
> For additional commands, e-mail: users-help@felix.apache.org 
>
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org 
> For additional commands, e-mail: users-help@felix.apache.org 
>


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


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


Re: cannot delete bundle jar from load directory (locked)

Posted by "Richard S. Hall" <he...@ungoverned.org>.
On 8/21/15 14:24 , Hubert Felber wrote:
> <<Windows
>
> :-)
>
> << 1. stop the bundle before deleting its bundle
>
> neither stop nor uninstall the bundle helps. It must have to do with
> the native code running -- is still locked.

Did you refresh after uninstalling ?

>
> <<2. stop using windows, by far the best choice IMHO :-)
>
> well, since our customers insist of using windows ....
>
> regards
> Hubert
>
>>>> Ferry Huberts <ma...@hupie.com> 21.08.2015 20:08 >>>
>
> On 21/08/15 20:05, Hubert Felber wrote:
>> Hi,
>>
>> I cannot delete a certain bundle jar from load directory, while I
> can
>> do this with others in the same load directory while they are
> running.
>> It says that this is open by java --  I do not receive a stop event
> in
>> the activator.
>>
>> This specific bundle has embedded jniWrapper jar and lots of native
>> libraries (dlls).
>> The jniWrapper is active and the native libraries are loaded.
>>
>> What could cause this lock?
> Windows
>
>> Can I do anything to avoid this lock?
> 1. stop the bundle before deleting its bundle
> 2. stop using windows, by far the best choice IMHO :-)
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>


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


Re: cannot delete bundle jar from load directory (locked)

Posted by Hubert Felber <Hu...@abacus.ch>.
<<Windows

:-)

<< 1. stop the bundle before deleting its bundle

neither stop nor uninstall the bundle helps. It must have to do with
the native code running -- is still locked.

<<2. stop using windows, by far the best choice IMHO :-)

well, since our customers insist of using windows ....

regards
Hubert

>>> Ferry Huberts <ma...@hupie.com> 21.08.2015 20:08 >>>


On 21/08/15 20:05, Hubert Felber wrote:
> Hi,
>
> I cannot delete a certain bundle jar from load directory, while I
can
> do this with others in the same load directory while they are
running.
> It says that this is open by java --  I do not receive a stop event
in
> the activator.
>
> This specific bundle has embedded jniWrapper jar and lots of native
> libraries (dlls).
> The jniWrapper is active and the native libraries are loaded.
>
> What could cause this lock?

Windows

> Can I do anything to avoid this lock?

1. stop the bundle before deleting its bundle
2. stop using windows, by far the best choice IMHO :-)


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


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


Re: cannot delete bundle jar from load directory (locked)

Posted by Ferry Huberts <ma...@hupie.com>.

On 21/08/15 20:05, Hubert Felber wrote:
> Hi,
>
> I cannot delete a certain bundle jar from load directory, while I can
> do this with others in the same load directory while they are running.
> It says that this is open by java --  I do not receive a stop event in
> the activator.
>
> This specific bundle has embedded jniWrapper jar and lots of native
> libraries (dlls).
> The jniWrapper is active and the native libraries are loaded.
>
> What could cause this lock?

Windows

> Can I do anything to avoid this lock?

1. stop the bundle before deleting its bundle
2. stop using windows, by far the best choice IMHO :-)


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