java.lang.NoSuchMethodError: com.sun.jna.LastErrorException.getErrorCode()I

180 views
Skip to first unread message

Timothy Perrett

unread,
Sep 16, 2012, 7:50:20 AM9/16/12
to project-voldemort
Hey guys,

So I was playing around with voldemort and tried to embed it using the
code on the site as a basis, and when I do:

val config =
VoldemortConfig.loadFromVoldemortHome(where.getAbsolutePath)
val server = new VoldemortServer(config)
server.start()

The following occurs when trying to startup:

[2012-09-16 12:32:56,238 voldemort.store.metadata.MetadataStore] INFO
metadata init().
[2012-09-16 12:32:56,408 voldemort.store.metadata.MetadataStore] INFO
Updating routing strategy for all stores
[2012-09-16 12:32:56,526 voldemort.server.VoldemortServer] INFO Using
NIO Connector.
[2012-09-16 12:32:56,544 voldemort.server.VoldemortServer] INFO Using
NIO Connector for Admin Service.
[2012-09-16 12:32:56,545 voldemort.server.VoldemortService] INFO
Starting voldemort-server
java.lang.NoSuchMethodError:
com.sun.jna.LastErrorException.getErrorCode()I
at voldemort.utils.JNAUtils.tryMlockall(JNAUtils.java:58)
at voldemort.server.VoldemortServer.startInner(VoldemortServer.java:
253)
at voldemort.server.AbstractService.start(AbstractService.java:62)

I'm running on OSX with the following JRE:

λ java -version
java version "1.6.0_35"
Java(TM) SE Runtime Environment (build 1.6.0_35-b10-428-11M3811)
Java HotSpot(TM) 64-Bit Server VM (build 20.10-b01-428, mixed mode)

Thanks for any advice

Timothy

ctasada

unread,
Sep 16, 2012, 12:10:49 PM9/16/12
to project-...@googlegroups.com
Hi Timothy,

Welcome to the Voldemort community!

I imagine you're trying Voldermot 0.96. Do you have the jna.jar library in your classpath?

Regards,

Vinoth Chandar

unread,
Sep 17, 2012, 6:48:06 PM9/17/12
to project-...@googlegroups.com
Hi Timothy,

The jna jar is required. The server attempts to mlock the jvm heap on startup

Timothy Perrett

unread,
Sep 19, 2012, 10:43:07 AM9/19/12
to project-...@googlegroups.com
Hey!

Thanks for the welcome :-) Apologies for the late reply, I didn't have my group settings to send me replies so I thought not one got back! Sorry.

Anyway, I've been using voldemort in non-embedded mode locally for development so far, and it worked out alright except one really odd issue... In my app as voldemort is not packaged into released binaries and its just a huge lib directory, I didn't know what jars i needed for just the client and what I could ditch, so I just included them all to start with. This resulted in a very odd occurrence where when trying to exit the app would stall and had a blocked thread. I fired up YourKit to take a closer look and could see that there was a really strange thing occurring where a thread was not exiting... anyway, long story short, this only occurs when jna.jar was on the classpath. This is my classpath *without* the jna.jar:

google-collect-1.0.jar
jdom-1.1.jar
log4j-over-slf4j-1.6.6.jar
slf4j-api-1.6.6.jar
voldemort-0.96.jar
xercesImpl-2.9.1.jar
scala-library.jar
org.clapper/grizzled-slf4j_2.9.2/jars/grizzled-slf4j_2.9.2-0.6.9.jar
org.slf4j/slf4j-api/jars/slf4j-api-1.6.4.jar
ch.qos.logback/logback-classic/jars/logback-classic-1.0.0.jar
ch.qos.logback/logback-core/jars/logback-core-1.0.0.jar
com.twitter/ostrich/jars/ostrich-8.2.1.jar
com.twitter/scala-json/jars/scala-json-3.0.0.jar
com.twitter/util-core/jars/util-core-5.3.1.jar
com.twitter/util-eval/jars/util-eval-5.3.1.jar
scala-compiler.jar
com.twitter/util-logging/jars/util-logging-5.3.1.jar
com.twitter/util-jvm/jars/util-jvm-5.3.1.jar
com.typesafe.akka/akka-actor/jars/akka-actor-2.0.3.jar
com.typesafe/config/bundles/config-0.3.1.jar
com.typesafe.akka/akka-slf4j/jars/akka-slf4j-2.0.3.jar
net.databinder.dispatch/core_2.9.2/jars/core_2.9.2-0.9.1.jar
com.ning/async-http-client/jars/async-http-client-1.7.5.jar
com.typesafe.akka/akka-agent/jars/akka-agent-2.0.3.jar
org.scala-tools/scala-stm_2.9.1/jars/scala-stm_2.9.1-0.5.jar
com.typesafe.akka/akka-remote/jars/akka-remote-2.0.3.jar
io.netty/netty/bundles/netty-3.5.3.Final.jar
com.google.protobuf/protobuf-java/jars/protobuf-java-2.4.1.jar
net.debasishg/sjson_2.9.1/jars/sjson_2.9.1-0.15.jar
net.databinder/dispatch-json_2.9.1/jars/dispatch-json_2.9.1-0.8.5.jar
org.apache.httpcomponents/httpclient/jars/httpclient-4.1.jar
org.apache.httpcomponents/httpcore/jars/httpcore-4.1.jar
commons-logging/commons-logging/jars/commons-logging-1.1.1.jar
commons-codec/commons-codec/jars/commons-codec-1.4.jar
org.objenesis/objenesis/jars/objenesis-1.2.jar
commons-io/commons-io/jars/commons-io-1.4.jar
voldemort.store.compress/h2-lzf/jars/h2-lzf-1.0.jar
cc.spray/spray-can/1.0-M3-SNAPSHOT/jars/spray-can.jar
cc.spray/spray-io/1.0-M3-SNAPSHOT/jars/spray-io.jar
cc.spray/spray-util/1.0-M3-SNAPSHOT/jars/spray-util.jar
cc.spray/spray-http/1.0-M3-SNAPSHOT/jars/spray-http.jar
org.parboiled/parboiled-scala/jars/parboiled-scala-1.0.2.jar
org.parboiled/parboiled-core/jars/parboiled-core-1.0.2.jar
cc.spray/spray-routing/1.0-M3-SNAPSHOT/jars/spray-routing.jar
cc.spray/spray-httpx/1.0-M3-SNAPSHOT/jars/spray-httpx.jar
org.jvnet.mimepull/mimepull/jars/mimepull-1.8.jar
com.chuusai/shapeless_2.9.2/jars/shapeless_2.9.2-1.2.2.jar
net.liftweb/lift-json_2.9.2/jars/lift-json_2.9.2-2.5-M1.jar
org.scala-lang/scalap/jars/scalap-2.9.2.jar
com.thoughtworks.paranamer/paranamer/jars/paranamer-2.4.1.jar

However, i'd still like to embed it, but im not sure what dependencies I need for that? How far away is maven'izing the project? Manual dependency management is a frustration :-( 

Thanks, Tim

Maarten Koopmans

unread,
Sep 20, 2012, 2:42:38 PM9/20/12
to project-...@googlegroups.com
Hi Tim,

I use sbt and simply put the voldemort jar, libs+contrib in the sbt project lib directory (so non-managed) for the client usage. 

Then sbt assembly ... does the trick. Given that V doesn't update that frequently it's a pretty managable way. Sbt can still manage other dependencies. Note that I did this for both Lift and mixed "plain" scala/jave sbt projects.

Hth,

Maarten
--
 
 
Reply all
Reply to author
Forward
0 new messages