wisdom-framework / wisdom-orientdb

Wisdom OrientDB integration
Apache License 2.0
2 stars 3 forks source link

SnappyJava error (Mac OSX ) #22

Closed remi-parain closed 9 years ago

remi-parain commented 9 years ago

I don't know what happened, I recently got an exception at startup about snappyjava lib not boing loaded on my project. All my invalid bundles relies on OrientDB to work.

I got the same error when I compile the wisdom-orient-db sample project from this repo ( compilation with java 8 sdk and java 7sdk )

[INFO]   o.o.c.c.a.DirectoryMonitor {main} - Opening deployer org.ow2.chameleon.core.activators.BundleDeployer@4ac3c60d for directory /Users/ubidev/Downloads/wisdom-orientdb-master/wisdom-orientdb-sample/target/wisdom/application. 
[ERROR]  o.o.c.c.a.BundleDeployer {main} - Error during the starting of org.xerial.snappy.snappy-java 
org.osgi.framework.BundleException: Activator start error in bundle org.xerial.snappy.snappy-java [64].
    at org.apache.felix.framework.Felix.activateBundle(Felix.java:2204) [chameleon-core-1.10.3.jar:na]
    at org.apache.felix.framework.Felix.startBundle(Felix.java:2072) [chameleon-core-1.10.3.jar:na]
    at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:976) ~[org.apache.felix.framework-4.4.1.jar:na]
    at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:963) ~[org.apache.felix.framework-4.4.1.jar:na]
    at org.ow2.chameleon.core.activators.BundleDeployer.open(BundleDeployer.java:192) [chameleon-core-1.10.3.jar:na]
    at org.ow2.chameleon.core.activators.DirectoryMonitor.addingService(DirectoryMonitor.java:238) [chameleon-core-1.10.3.jar:na]
    at org.ow2.chameleon.core.activators.DirectoryMonitor.addingService(DirectoryMonitor.java:52) [chameleon-core-1.10.3.jar:na]
    at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:932) [org.apache.felix.framework-4.4.1.jar:na]
    at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:864) [org.apache.felix.framework-4.4.1.jar:na]
    at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256) [org.apache.felix.framework-4.4.1.jar:na]
    at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:229) [org.apache.felix.framework-4.4.1.jar:na]
    at org.osgi.util.tracker.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:894) [org.apache.felix.framework-4.4.1.jar:na]
    at org.apache.felix.framework.util.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:943) [chameleon-core-1.10.3.jar:na]
    at org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:794) [chameleon-core-1.10.3.jar:na]
    at org.apache.felix.framework.util.EventDispatcher.fireServiceEvent(EventDispatcher.java:544) [chameleon-core-1.10.3.jar:na]
    at org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:4445) [chameleon-core-1.10.3.jar:na]
    at org.apache.felix.framework.Felix.registerService(Felix.java:3431) [chameleon-core-1.10.3.jar:na]
    at org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:346) [chameleon-core-1.10.3.jar:na]
    at org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:353) [chameleon-core-1.10.3.jar:na]
    at org.ow2.chameleon.core.activators.BundleDeployer.start(BundleDeployer.java:80) [chameleon-core-1.10.3.jar:na]
    at org.ow2.chameleon.core.utils.FrameworkManager.start(FrameworkManager.java:117) [chameleon-core-1.10.3.jar:na]
    at org.ow2.chameleon.core.Chameleon.start(Chameleon.java:252) [chameleon-core-1.10.3.jar:na]
    at org.ow2.chameleon.core.Main.main(Main.java:70) [chameleon-core-1.10.3.jar:na]
Caused by: java.lang.UnsatisfiedLinkError: no libsnappyjava.dylib in java.library.path
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1857) ~[na:1.8.0_11]
    at java.lang.Runtime.loadLibrary0(Runtime.java:870) ~[na:1.8.0_11]
    at java.lang.System.loadLibrary(System.java:1119) ~[na:1.8.0_11]
    at org.xerial.snappy.SnappyBundleActivator.start(SnappyBundleActivator.java:52) ~[na:na]
    at org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:645) ~[org.apache.felix.framework-4.4.1.jar:na]
    at org.apache.felix.framework.Felix.activateBundle(Felix.java:2154) [chameleon-core-1.10.3.jar:na]
    ... 22 common frames omitted

any idea ?

cescoffier commented 9 years ago

No idea, but @barjo probably know the answer...

barjo commented 9 years ago

Hi, I am not sure from where it could come from. I will have a look a orient recent change.

barjo commented 9 years ago

@remi-parain I just update the snapshot version to orient 2.0.4. Let me know if it solves the problem. I can also cut a release if needed. Since the current snapshot is based on wisdom 0.7.0, if your project use 0.7.1-SNAPSHOT, it may have an impact too?

cescoffier commented 9 years ago

Would it be possible that the dependency became a bundle without the right native directives in its manifest ?

Sent from my iPhone

On 4 mars 2015, at 05:02, Jonathan Bardin notifications@github.com wrote:

@remi-parain https://github.com/remi-parain I just update the snapshot version to orient 2.0.4. Let me know if it solves the problem. I can also cut a release if needed. Since the current snapshot is based on wisdom 0.7.0, if your project use 0.7.1-SNAPSHOT, it may have an impact too?

— Reply to this email directly or view it on GitHub https://github.com/wisdom-framework/wisdom-orientdb/issues/22#issuecomment-77093547 .

barjo commented 9 years ago

@cescoffier All orient dep. are bundles, it was already the case with previous versions. It doesn't seems that they have any embedded native actually. The orient core depends on org.xerial.snappy 1.1.0.1 that has the following native instruction: http://central.maven.org/maven2/org/xerial/snappy/snappy-java/1.1.0.1/snappy-java-1.1.0.1.pom

<Bundle-NativeCode>
org/xerial/snappy/native/Windows/x86_64/snappyjava.dll;osname=win32;processor=x86-64,
org/xerial/snappy/native/Windows/x86/snappyjava.dll;osname=win32;processor=x86,
org/xerial/snappy/native/Mac/x86/libsnappyjava.jnilib;osname=macosx;processor=x86,
org/xerial/snappy/native/Mac/x86_64/libsnappyjava.jnilib;osname=macosx;processor=x86-64,
org/xerial/snappy/native/Linux/x86_64/libsnappyjava.so;osname=linux;processor=x86-64,
org/xerial/snappy/native/Linux/x86/libsnappyjava.so;osname=linux;processor=x86,
org/xerial/snappy/native/SunOS/x86/libsnappyjava.so;osname=sunos;processor=x86,
org/xerial/snappy/native/SunOS/sparc/libsnappyjava.so;osname=sunos;processor=sparc,
org/xerial/snappy/native/SunOS/x86_64/libsnappyjava.so;osname=sunos;processor=x86-64,
org/xerial/snappy/native/Linux/arm/libsnappyjava.so;osname=linux;processor=arm
</Bundle-NativeCode>

If that's the culprit we can exclude it and require version > 1.1.1; but am not sure if the api has change.

cescoffier commented 9 years ago

Do you know why orientdb need this bundle ?

barjo commented 9 years ago

They do some compression with snappy, but I think it's disabled by default :-?

barjo commented 9 years ago

I find some possible problem with the snappy dep. of the wisdom orient-core. I think it should be alright now. I should also contact Orient to know if they could put the snappy package as optional. ( By default the snappy compression is disabled)

barjo commented 9 years ago

Apparently they move from org.iq80.snappy (pure java) to org.xerial.snappy :(

remi-parain commented 9 years ago

thanks @barjo, the sample is now working well at runtime ( with the current wisdom 0.7.1-SNAPSHOT, compiled 2 days ago)

The issue occurs only on mac and is related to the snappy library as we can find trace of this specific issue since 2012 https://github.com/xerial/snappy-java/issues/6 https://github.com/thinkaurelius/titan/issues/62 https://groups.google.com/a/lists.datastax.com/forum/#!topic/java-driver-user/bqvT83TwZTc

I found this workaround (jvm parameters) but it didn't worked for me : "-Dorg.xerial.snappy.tempdir=~/tmp -Dorg.xerial.snappy.lib.name=libsnappyjava.jnilib"

maybe orient should update their version of snappy

btw : thanks !

barjo commented 9 years ago

Thanks, I open an issue in Orient, and snappy will be optional for the bundle in the next release.


Jonathan

On Wed, Mar 4, 2015 at 4:19 PM, PARAIN Rémi notifications@github.com wrote:

thanks @barjo https://github.com/barjo, the sample is now working well at runtime ( with the current wisdom 0.7.1-SNAPSHOT, compiled 2 days ago)

The issue occurs only on mac and is related to the snappy library as we can find trace of this specific issue since 2012 xerial/snappy-java#6 https://github.com/xerial/snappy-java/issues/6 thinkaurelius/titan#62 https://github.com/thinkaurelius/titan/issues/62

https://groups.google.com/a/lists.datastax.com/forum/#!topic/java-driver-user/bqvT83TwZTc

I found this workaround (jvm parameters) but it didn't worked for me : "-Dorg.xerial.snappy.tempdir=~/tmp -Dorg.xerial.snappy.lib.name =libsnappyjava.jnilib"

maybe orient should update their version of snappy

btw : thanks !

— Reply to this email directly or view it on GitHub https://github.com/wisdom-framework/wisdom-orientdb/issues/22#issuecomment-77121862 .

cescoffier commented 9 years ago

Could you post the ticket link ?

2015-03-04 10:55 GMT+01:00 Jonathan Bardin notifications@github.com:

Thanks, I open an issue in Orient, and snappy will be optional for the bundle in the next release.


Jonathan

On Wed, Mar 4, 2015 at 4:19 PM, PARAIN Rémi notifications@github.com wrote:

thanks @barjo https://github.com/barjo, the sample is now working well at runtime ( with the current wisdom 0.7.1-SNAPSHOT, compiled 2 days ago)

The issue occurs only on mac and is related to the snappy library as we can find trace of this specific issue since 2012 xerial/snappy-java#6 https://github.com/xerial/snappy-java/issues/6 thinkaurelius/titan#62 <https://github.com/thinkaurelius/titan/issues/62

https://groups.google.com/a/lists.datastax.com/forum/#!topic/java-driver-user/bqvT83TwZTc

I found this workaround (jvm parameters) but it didn't worked for me : "-Dorg.xerial.snappy.tempdir=~/tmp -Dorg.xerial.snappy.lib.name =libsnappyjava.jnilib"

maybe orient should update their version of snappy

btw : thanks !

— Reply to this email directly or view it on GitHub < https://github.com/wisdom-framework/wisdom-orientdb/issues/22#issuecomment-77121862

.

— Reply to this email directly or view it on GitHub https://github.com/wisdom-framework/wisdom-orientdb/issues/22#issuecomment-77126747 .

barjo commented 9 years ago

Here is the OrientDB ticket: https://github.com/orientechnologies/orientdb/issues/3693

barjo commented 9 years ago

The pull request has been accepted on their develop branch, It will be release with the orientdb 2.1 milestone.

barjo commented 9 years ago

It's gonna be solved in orientdb 2.1 rc1