You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@sling.apache.org by Felix Meschberger <fm...@adobe.com> on 2012/11/03 00:58:14 UTC
Re: native library in bundle
Hi Rob
Sorry for the late response. This question was burried deep down in my dring-PTO-messages.
I am not too familiar with native code in OSGi frameworks. You might want to ask these questions on the Felix Users List.
One point: I think it would be good to isolate the native code in a separate bundle an expose its access through an OSGi service.
Regards
Felix
Am 22.07.2012 um 20:58 schrieb Robert A. Decker:
> Hi,
>
> I have a jar that has a native c++ library as part of it:
>
> <dependency>
> <groupId>org.zeromq</groupId>
> <artifactId>jzmq-bmndev</artifactId>
> <version>1.0.0</version>
> <scope>compile</scope>
> </dependency>
>
> It was working fairly well for awhile. I'd have to restart the app during my builds every now and then because it wouldn't be able to load the native library, but not too often.
>
> However, lately it's just gone to hell. I now have to restart every build. I'm not sure what changed.
>
> Here's the error:
>
> 22.07.2012 18:36:53.323 *ERROR* [FelixPackageAdmin] bmn-core [org.brainsciences.bmn.commons.core.services.impl.DivisiWrapperServiceImpl] The activate method has thrown an exception (java.lang.UnsatisfiedLinkError: Native Library /usr/local/lib/libjzmq.so.0.0.0 already loaded in another classloader) java.lang.UnsatisfiedLinkError: Native Library /usr/local/lib/libjzmq.so.0.0.0 already loaded in another classloader
>
> And then when you try to start the component manually in the sling console:
>
> 22.07.2012 18:48:25.567 *ERROR* [814353636@qtp-575823446-4] bmn-core [org.brainsciences.bmn.commons.core.services.impl.DivisiWrapperServiceImpl] The activate method has thrown an exception (java.lang.NoClassDefFoundError: Could not initialize class org.zeromq.ZMQ) java.lang.NoClassDefFoundError: Could not initialize class org.zeromq.ZMQ at org.brainsciences.bmn.commons.core.services.impl.DivisiWrapperServiceImpl.activate(DivisiWrapperServiceImpl.java:45)
>
>
> Is there something I can do so that the class loaders don't have this problem?
>
> Rob
Re: native library in bundle
Posted by "Robert A. Decker" <de...@robdecker.com>.
Hi Felix,
That's exactly what we did. We now only build the native bundle when necessary.
Rob
On Nov 2, 2012, at 4:58 PM, Felix Meschberger wrote:
> Hi Rob
>
> Sorry for the late response. This question was burried deep down in my dring-PTO-messages.
>
> I am not too familiar with native code in OSGi frameworks. You might want to ask these questions on the Felix Users List.
>
> One point: I think it would be good to isolate the native code in a separate bundle an expose its access through an OSGi service.
>
> Regards
> Felix
>
> Am 22.07.2012 um 20:58 schrieb Robert A. Decker:
>
>> Hi,
>>
>> I have a jar that has a native c++ library as part of it:
>>
>> <dependency>
>> <groupId>org.zeromq</groupId>
>> <artifactId>jzmq-bmndev</artifactId>
>> <version>1.0.0</version>
>> <scope>compile</scope>
>> </dependency>
>>
>> It was working fairly well for awhile. I'd have to restart the app during my builds every now and then because it wouldn't be able to load the native library, but not too often.
>>
>> However, lately it's just gone to hell. I now have to restart every build. I'm not sure what changed.
>>
>> Here's the error:
>>
>> 22.07.2012 18:36:53.323 *ERROR* [FelixPackageAdmin] bmn-core [org.brainsciences.bmn.commons.core.services.impl.DivisiWrapperServiceImpl] The activate method has thrown an exception (java.lang.UnsatisfiedLinkError: Native Library /usr/local/lib/libjzmq.so.0.0.0 already loaded in another classloader) java.lang.UnsatisfiedLinkError: Native Library /usr/local/lib/libjzmq.so.0.0.0 already loaded in another classloader
>>
>> And then when you try to start the component manually in the sling console:
>>
>> 22.07.2012 18:48:25.567 *ERROR* [814353636@qtp-575823446-4] bmn-core [org.brainsciences.bmn.commons.core.services.impl.DivisiWrapperServiceImpl] The activate method has thrown an exception (java.lang.NoClassDefFoundError: Could not initialize class org.zeromq.ZMQ) java.lang.NoClassDefFoundError: Could not initialize class org.zeromq.ZMQ at org.brainsciences.bmn.commons.core.services.impl.DivisiWrapperServiceImpl.activate(DivisiWrapperServiceImpl.java:45)
>>
>>
>> Is there something I can do so that the class loaders don't have this problem?
>>
>> Rob
>
>