neo4j-core icon indicating copy to clipboard operation
neo4j-core copied to clipboard

NameError: missing class name (`org.neo4j.graphdb.factory.GraphDatabaseFactory')

Open l7x opened this issue 4 years ago • 2 comments

I'm getting this error with basic embedded example:

NameError: missing class name (`org.neo4j.graphdb.factory.GraphDatabaseFactory')
from org/jruby/javasupport/JavaPackage.java:124:in `const_missing'

I followed the documentation, but I'm not sure if I need to install anything else manually or everything should be already bundled.

Code example:

require 'neo4j/core/cypher_session/adaptors/embedded'
neo4j_adaptor = Neo4j::Core::CypherSession::Adaptors::Embedded.new('/tmp/graph.db')
neo4j_session = Neo4j::Core::CypherSession.new(neo4j_adaptor)

Runtime information:

jruby 9.2.9.0 on linux Neo4j database version: embedded neo4j gem version: neo4j-9.6.1.gem neo4j-core gem version: neo4j-core-9.0.0

l7x avatar Jan 15 '20 21:01 l7x

@l7x since you are running embedded you must be including neo4j jar files. There is the neo4j-community gem, but it is hopelessly outdated. If you must run in embedded mode you are on your own and must find a way to add the entire set of neo4j server jar files to your ruby project. Have a look at jar-dependencies and ruby-maven gems. Let me know if you succeed. Otherwise run in server mode as nearly everyone does nowadays.

klobuczek avatar Jan 15 '20 21:01 klobuczek

Thank you for the quick response. Documentation (and wiki) on embedded mode is very confusing. Unfortunately, I can't run server mode due to some requirements.

I'll check ruby-maven and jar-dependencies. If I get this working, are there any additional problems I can expect with neo4jrb and embedded mode in the long run?

l7x avatar Jan 15 '20 22:01 l7x