neo4jrb / activegraph

An active model wrapper for the Neo4j Graph Database for Ruby.
http://neo4jrb.io
MIT License
1.4k stars 276 forks source link

Cannot use server mode on Jruby. #801

Open vantonio opened 9 years ago

vantonio commented 9 years ago

application.rb:

config.neo4j.session_type = :server_db 
config.neo4j.session_path = 'http://172.17.0.14:7474'
config.neo4j.session_options = { basic_auth: { username: 'neo4j', password: '****'} }
config.generators do |g|
  g.orm             :neo4j
end

with the configs above, I can't start the server. Logs are:

LoadError: no such file to load -- neo4j-community
/usr/local/bundle/gems/neo4j-core-4.0.7/lib/neo4j-embedded.rb:3:in `<top>'
/usr/local/bundle/gems/neo4j-core-4.0.7/lib/neo4j-core.rb:1:in `<top>'
/usr/local/bundle/gems/neo4j-core-4.0.7/lib/neo4j-core.rb:24:in `<top>'
/usr/local/bundle/gems/neo4j-4.1.5/lib/neo4j.rb:1:in `block in (root)'
/usr/local/bundle/gems/neo4j-4.1.5/lib/neo4j.rb:12:in `block in (root)'
/usr/local/bundle/gems/bundler-1.9.8/lib/bundler/runtime.rb:1:in `(root)'
/usr/local/bundle/gems/bundler-1.9.8/lib/bundler/runtime.rb:76:in `require'
/usr/local/bundle/gems/bundler-1.9.8/lib/bundler/runtime.rb:72:in `<top>'
/usr/local/bundle/gems/bundler-1.9.8/lib/bundler/runtime.rb:61:in `<top>'
/usr/local/bundle/gems/bundler-1.9.8/lib/bundler.rb:134:in `require'
cheerfulstoic commented 9 years ago

I think you'll need to (at least for now) put the neo4j-community into your Gemfile / gem environment. This is a good point, though, I don't know that we should always assume that people using JRuby are going to use Neo4j in embedded mode.

vantonio commented 9 years ago

Thank you @cheerfulstoic, after I put gem 'neo4j-community' into Gemfile, rails was able to start. I think we should mention this in the docs, in case someone run into the same situation.

vantonio commented 9 years ago

Should I close this and submit a new issue titled "Document server mode on jruby"?

cheerfulstoic commented 9 years ago

I just updated the wiki here:

https://github.com/neo4jrb/neo4j/wiki/Neo4j-v3-Setup

I'd still like to keep this issue open, though, because we still need to fix is so that you don't need to include either the neo4j-community or neo4j-enterprise gems if you're using JRuby in server mode.

(:+1:s welcome from anybody doing this so that we can know if this is a priority)

purbon commented 9 years ago

@cheerfulstoic I was wishing to update the logstash input and output plugin to use the server api, however I found this issue.

The problem in there is that both elasticsearch and neo4j use conflicting lucene versions. I willing to take this issue, but would love some guide on how to fix it.

Thanks!

cheerfulstoic commented 9 years ago

I don't have much experience with Java, unfortunately (@subvertallchris might be of more help, though he's busy with a new job at the moment).

purbon commented 9 years ago

Hi, well this actually would be more on the side of lot requiring any neo4j dependency jars (neo4j-community or neo4j-enterprise) when using the REST API. Do you know how hard would be to make this happen?

/cheers

On Thu, Sep 17, 2015 at 8:16 AM Brian Underwood notifications@github.com wrote:

I don't have much experience with Java, unfortunately (@subvertallchris https://github.com/subvertallchris might be of more help, though he's busy with a new job at the moment).

— Reply to this email directly or view it on GitHub https://github.com/neo4jrb/neo4j/issues/801#issuecomment-140978669.

cheerfulstoic commented 9 years ago

I just realized that it's actually probably pretty easy. I've just pushed a change up to master. Could you try the following?

Gemfile:

gem 'neo4j-core', github: 'neo4jrb/neo4j-core'

And then set the WITHOUT_NEO4J_EMBEDDED to true when running your app.

cheerfulstoic commented 9 years ago

If that works I'll cherry pick it into the 5.1.x branch and make a release