NoSuchMethodError in QuickStart example under OS X

閲覧: 44 回
最初の未読メッセージにスキップ

Kathy Applebaum

未読、
2016/11/28 11:39:432016/11/28
To: DataStax Java Driver for Apache Cassandra User Mailing List
Running OS X 10.11.6 with Java 8u91 in IntelliJ 2016.3

I've added gradle dependencies for cassandra-driver-core, cassandra-driver-mapping and cassandra-driver-extras, all version 3.1.2. Just trying to execute this statement in a unit test from the QuickStart:
Cluster cluster = Cluster.builder()
.withClusterName("myCluster")
.addContactPoint("127.0.0.1")
.build();

I get the following error when it gets to the build() line:
java.lang.NoSuchMethodError: com.kenai.jffi.CallContextCache.getCallContext(Lcom/kenai/jffi/Type;[Lcom/kenai/jffi/Type;Lcom/kenai/jffi/CallingConvention;Z)Lcom/kenai/jffi/CallContext;
at jnr.ffi.provider.jffi.InvokerUtil.getCallContext(InvokerUtil.java:205)
at jnr.ffi.provider.jffi.AsmLibraryLoader.generateInterfaceImpl(AsmLibraryLoader.java:127)
at jnr.ffi.provider.jffi.AsmLibraryLoader.loadLibrary(AsmLibraryLoader.java:59)
at jnr.ffi.provider.jffi.NativeLibraryLoader.loadLibrary(NativeLibraryLoader.java:43)
at jnr.ffi.LibraryLoader.load(LibraryLoader.java:290)
at jnr.ffi.LibraryLoader.load(LibraryLoader.java:269)
at com.datastax.driver.core.Native$LibCLoader.<clinit>(Native.java:108)
at com.datastax.driver.core.Native.isGettimeofdayAvailable(Native.java:190)
at com.datastax.driver.core.ClockFactory.newInstance(Clock.java:51)
at com.datastax.driver.core.AbstractMonotonicTimestampGenerator.<init>(AbstractMonotonicTimestampGenerator.java:43)
at com.datastax.driver.core.LoggingMonotonicTimestampGenerator.<init>(LoggingMonotonicTimestampGenerator.java:49)
at com.datastax.driver.core.AtomicMonotonicTimestampGenerator.<init>(AtomicMonotonicTimestampGenerator.java:50)
at com.datastax.driver.core.AtomicMonotonicTimestampGenerator.<init>(AtomicMonotonicTimestampGenerator.java:37)
at com.datastax.driver.core.policies.Policies.defaultTimestampGenerator(Policies.java:122)
at com.datastax.driver.core.policies.Policies$Builder.build(Policies.java:287)
at com.datastax.driver.core.Cluster$Builder.getConfiguration(Cluster.java:1271)
at com.datastax.driver.core.Cluster.<init>(Cluster.java:113)
at com.datastax.driver.core.Cluster.buildFrom(Cluster.java:178)
at com.datastax.driver.core.Cluster$Builder.build(Cluster.java:1289)
<more stuff from our code>

A google search isn't helping me with this -- any clues?


Kant Kodali

未読、
2016/11/28 12:02:432016/11/28
To: DataStax Java Driver for Apache Cassandra User Mailing List
NoSuchMethodError is Library versioning problem. you may want to paste your pom.xml or build.gradle

--
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-user+unsubscribe@lists.datastax.com.

Kathy Applebaum

未読、
2016/11/28 12:11:482016/11/28
To: DataStax Java Driver for Apache Cassandra User Mailing List

On Monday, November 28, 2016 at 9:02:43 AM UTC-8, Kant Kodali wrote:
NoSuchMethodError is Library versioning problem. you may want to paste your pom.xml or build.gradle


Here it is, with some calls to our code and servers taken out:
buildscript {
repositories {
mavenLocal()
mavenCentral()
jcenter()

maven {
name 'releases'
// redacted
}
maven {
name 'snapshots'
// redacted
}
}
dependencies {
classpath // redacted
}
}


group = // redacted
version = '2.9.1-SNAPSHOT'

sourceCompatibility = 1.8
targetCompatibility = 1.8

dependencies {
// redacted
compileOnly 'com.google.protobuf:protobuf-java:3.0.0'

compile group: 'com.datastax.cassandra', name: 'cassandra-driver-core', version: '3.1.2'
compile 'com.datastax.cassandra:cassandra-driver-mapping:3.1.2'
compile 'com.datastax.cassandra:cassandra-driver-extras:3.1.2'

testCompileOnly 'com.google.protobuf:protobuf-java:3.0.0'
testCompile group: 'junit', name: 'junit', version:'4.10'
}

repositories {
jcenter()
mavenLocal()
mavenCentral()
// redacted
}

Kant Kodali

未読、
2016/11/28 12:41:142016/11/28
To: DataStax Java Driver for Apache Cassandra User Mailing List
Ok so I added your dependencies under a sample project and it ran fine. so looks like it is a setup issue. Nothing to do with datastax libraries since they seem to work fine (I dont get any errors.). '

I dont a lot about gradle. Take out the buildscript block and run. It would work fine with the code you pasted.

Kathy Applebaum

未読、
2016/11/28 12:46:302016/11/28
To: DataStax Java Driver for Apache Cassandra User Mailing List
Thanks for the help! This gives me a good place to start.
全員に返信
投稿者に返信
転送
新着メール 0 件