I am trying to use the Voldemort http://project-voldemort.com/ Java
client
from JRuby by wrapping the
voldemort.clienthttp://github.com/voldemort/voldemort/tree/master/src/java/voldemort/client/
Java
class in a JRuby module VoldemortClient. This is on OS X with the JRuby
downloaded from jruby.org.
See:
http://project-voldemort.com/quickstart.php
http://project-voldemort.com/javadoc/client/
The code is here: voldemort_client.rb · GitHub
@calavera on Twitter was able to run this code, but no matter what I do
I
get this error when I require the voldemort_client lib:
/Users/rjurney//jruby-1.5.1/lib/ruby/site_ruby/shared/builtin/javasupport/core_ext/module.rb:53:in
import': cannot link Java class voldemort.client.SocketStoreClientFactory, probable missing dependency: org/jdom/Content (NameError) from ./lib/voldemort_client.rb:10 from ./lib/voldemort_client.rb:2:in
require’
from ./test.rb:2
This also happens in jirb. I have tried manually importing the class
‘org.jdom.Content’ and it has no effect. It seems that
voldemort’s dependencies are not actually being imported. I have tried
requiring each of them manually, to their absolute path - but it has no
effect.
Help! Thanks,
Russ
Source to lib/voldemort_client.rb:
require ‘java’
PATH_TO_VOLDEMORT = ‘/Users/rjurney/voldemort/’
require File.expand_path(‘dist/voldemort-0.81.jar’, PATH_TO_VOLDEMORT)
Dir[File.expand_path(‘lib/*.jar’, PATH_TO_VOLDEMORT)].each {|jar|
require
jar}
module VoldemortClient
import ‘org.jdom.Content’
import ‘voldemort.client.ClientConfig’;
import ‘voldemort.client.SocketStoreClientFactory’;
import ‘voldemort.client.StoreClient’;
import ‘voldemort.client.StoreClientFactory’;
import ‘voldemort.versioning.Versioned’;
alternately, use the #import method
import “voldemort.client”
end