What is jnr-posix and jnr-ffi dependencies for?

瀏覽次數:2,095 次
跳到第一則未讀訊息

Eugene Voytitsky

未讀,
2016年8月16日 上午11:53:472016/8/16
收件者:DataStax Java Driver for Apache Cassandra User Mailing List
Hi all.

Could you please briefly expain or point me to some doc where I can find answer on my subj question?

Recently I updated my cassandra datastax jaav driver from 3.0.0 to 3.0.1 version and see error in logs:

Could not load JNR C Library, native system calls through this library will not be available
java.lang.UnsatisfiedLinkError: could not load FFI provider jnr.ffi.provider.jffi.Provider

Also I see there 2 new direct dependencies here
http://mvnrepository.com/artifact/com.datastax.cassandra/cassandra-driver-core/3.1.0

Thanks!

Andrew Tolbert

未讀,
2016年8月16日 中午12:53:152016/8/16
收件者:DataStax Java Driver for Apache Cassandra User Mailing List
Hi Eugene,

These libraries are both used for higher granularity when generating client-side query timestamps, see: http://datastax.github.io/java-driver/manual/query_timestamps/#accuracy and time uuids (JAVA-1116) and also for including process ids in UUIDs generated by the driver (JAVA-444).  

They are not required dependencies, but we opted to make them non-optional for user convenience of having the libraries pulled in automatically instead of needing to be explicitly specified in a maven pom.  If they cannot be loaded by the driver for whatever reason, the driver will use java.lang.Systems clock as it did before (section from the OSGI FAQ).  You can also add them as excluded dependencies for the driver and it will still work.   I went ahead and opened up JAVA-1265 so we can document what we use JNR for more comprehensively.

Thanks!
Andy

Eugene Voytitsky

未讀,
2016年8月16日 下午1:38:322016/8/16
收件者:java-dri...@lists.datastax.com、andrew....@datastax.com
Thank you, Andrew!

So now I have 2 options:
1. Drop jnr dependencies from my CLASSPATH -> will have old timestamps generation behavior.
2. Fix "Could not load JNR C Library" and will have new accurate timestamps. Could you please provide link to doc how to resolve this error? I don't see solution in already mentioned links.

Thanks!
--
You received this message because you are subscribed to the Google Groups "DataStax Java Driver for Apache Cassandra User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to java-driver-us...@lists.datastax.com.


-- 
Best regards,
Eugene Voytitsky

Andrew Tolbert

未讀,
2016年8月16日 下午5:28:372016/8/16
收件者:DataStax Java Driver for Apache Cassandra User Mailing List、andrew....@datastax.com
Hi Eugene,

Could you please provide link to doc how to resolve this error? I don't see solution in already mentioned links.

Are you using Maven?  If so it should 'just work'.  That is unless you are running in an OSGi container or in an environment where JNR doesn't support the platform you are on.   What is your environment like?

Thanks,
Andy

Eugene Voytitsky

未讀,
2016年8月17日 清晨7:41:262016/8/17
收件者:java-dri...@lists.datastax.com、andrew....@datastax.com
On 17.08.16 00:28, Andrew Tolbert wrote:
Hi Eugene,

Could you please provide link to doc how to resolve this error? I don't see solution in already mentioned links.

Are you using Maven?  If so it should 'just work'.  That is unless you are running in an OSGi container or in an environment where JNR doesn't support the platform you are on.   What is your environment like?

No, we don't use maven nor OSGi.
Here are all jnr libs in our CLASSPATH

$ find lib/runtime -name "*jnr*"
lib/runtime/com.github.jnr-jffi-native-jar-1.2.10.jar
lib/runtime/com.github.jnr-jnr-constants-jar-0.9.0.jar
lib/runtime/com.github.jnr-jnr-ffi-jar-2.0.7.jar
lib/runtime/com.github.jnr-jnr-posix-jar-3.0.27.jar
lib/runtime/com.github.jnr-jnr-x86asm-jar-1.0.2.jar

Our env is Ubuntu boxes.

Alexandre Dutra

未讀,
2016年8月17日 上午10:50:272016/8/17
收件者:java-dri...@lists.datastax.com、andrew....@datastax.com
Hi Eugene,

Under Ubuntu, you need to install the package "libjffi-jni".
Could you check if it's installed?

Hope that helps,

Alexandre
Alexandre Dutra
Driver & Tools Engineer @ DataStax

Eugene Voytitsky

未讀,
2016年8月17日 上午11:21:402016/8/17
收件者:java-dri...@lists.datastax.com、andrew....@datastax.com
Thanks, it helps!
回覆所有人
回覆作者
轉寄
0 則新訊息