Issue in connecting to Neo4j-2.0.0-M05 from java in linux machine

520 views
Skip to first unread message

Ranjith

unread,
Oct 25, 2013, 8:27:24 AM10/25/13
to ne...@googlegroups.com
Hi All,

Trying to connect to Neo4j from java I get the following error:

Exception in thread "main" java.lang.RuntimeException: Error starting org.neo4j.kernel.EmbeddedGraphDatabase, /data/graph.db at org.neo4j.kernel.InternalAbstractGraphDatabase.run(InternalAbstractGraphDatabase.java:323) at org.neo4j.kernel.EmbeddedGraphDatabase.(EmbeddedGraphDatabase.java:100) at org.neo4j.graphdb.factory.GraphDatabaseFactory$1.newDatabase(GraphDatabaseFactory.java:92) at org.neo4j.graphdb.factory.GraphDatabaseBuilder.newGraphDatabase(GraphDatabaseBuilder.java:197) at org.neo4j.graphdb.factory.GraphDatabaseFactory.newEmbeddedDatabase(GraphDatabaseFactory.java:69) at .....

Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.kernel.impl.transaction.XaDataSourceManager@4514ba77' was successfully initialized, but failed to start. Please see attached cause exception. at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:504) at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:115) at org.neo4j.kernel.InternalAbstractGraphDatabase.run(InternalAbstractGraphDatabase.java:300)

    ... 7 more Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component

'org.neo4j.kernel.impl.nioneo.xa.NeoStoreXaDataSource@2c86c977' was successfully initialized, but failed to start. Please see attached cause exception. at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:504) at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:115) at org.neo4j.kernel.impl.transaction.XaDataSourceManager.start(XaDataSourceManager.java:165) at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:498)

    ... 9 more Caused by: java.lang.IllegalArgumentException: No schema index provider org.neo4j.kernel.api.index.SchemaIndexProvider

found. Kernel extensions available on classpath:

Class path entries: /...../java/....xyz.jar at org.neo4j.kernel.api.index.SchemaIndexProvider$2.select(SchemaIndexProvider.java:136) at org.neo4j.kernel.api.index.SchemaIndexProvider$2.select(SchemaIndexProvider.java:128) at org.neo4j.kernel.extension.KernelExtensions.resolveDependency(KernelExtensions.java:207) at org.neo4j.kernel.InternalAbstractGraphDatabase$DependencyResolverImpl.resolveDependency(InternalAbstractGraphDatabase.java:1403) at org.neo4j.kernel.impl.nioneo.xa.NeoStoreXaDataSource.start(NeoStoreXaDataSource.java:311) at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:498) ... 12 more

I am using Ne04j-2.0.0-M05 version, running the java code under Java 7 in a linux machine. The same jar files and java code works good though in a windows machine. The web admin interface works well (hence path to db may not be a issue since I ve given the same path in org.neo4j.server.database.location and org.neo4j.server.webadmin.data.uri),

The java code I used to connect is :

String dbpath = "/NEO4J_HOME/data/graph.db/";
graphdb = new GraphDatabaseFactory().newEmbeddedDatabase(dbpath);

Can you tell what might cause the java.lang.IllegalArgumentException: No schema index provider org.neo4j.kernel.api.index.SchemaIndexProvider found.

Michael Hunger

unread,
Oct 25, 2013, 1:48:24 PM10/25/13
to ne...@googlegroups.com
You are missing the neo4j-lucene-2.0.0-M05.jar on your classpath.

Michael

--
You received this message because you are subscribed to the Google Groups "Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email to neo4j+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ranjith Anantharaman

unread,
Oct 25, 2013, 3:44:31 PM10/25/13
to ne...@googlegroups.com
I have two jars related to Lucene already in the classpath - lucene-core-3.6.2.jar and neo4j-lucene-index-2.0.0-M05.jar . 


--
You received this message because you are subscribed to a topic in the Google Groups "Neo4j" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/neo4j/NAFYfi_6CC4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to neo4j+un...@googlegroups.com.

Michael Hunger

unread,
Oct 25, 2013, 3:46:33 PM10/25/13
to ne...@googlegroups.com
What is listed here:
Class path entries: /...../java/....xyz.jar

Michael

Ranjith Anantharaman

unread,
Oct 25, 2013, 3:54:31 PM10/25/13
to neo4j
Caused by: java.lang.IllegalArgumentException: No schema index provider org.neo4j.kernel.api.index.SchemaIndexProvider found. Kernel extensions available on classpath:

Class path entries:
  /ebs/java/graph.jar
        at org.neo4j.kernel.api.index.SchemaIndexProvider$2.select(SchemaIndexProvider.java:136)
        at org.neo4j.kernel.api.index.SchemaIndexProvider$2.select(SchemaIndexProvider.java:128)
        at org.neo4j.kernel.extension.KernelExtensions.resolveDependency(KernelExtensions.java:207)
        at org.neo4j.kernel.InternalAbstractGraphDatabase$DependencyResolverImpl.resolveDependency(InternalAbstractGraphDatabase.java:1403)
        at org.neo4j.kernel.impl.nioneo.xa.NeoStoreXaDataSource.start(NeoStoreXaDataSource.java:311)
        at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:498)
        ... 12 more

Michael Hunger

unread,
Oct 25, 2013, 5:59:53 PM10/25/13
to ne...@googlegroups.com
Oh, you built your own jar ?

Don't do that. Put the individual jars there.

Otherwise you have to merge the contents all the META-INF/services/org.neo4j.kernel.extension.KernelExtensionFactory from all individual jars 

Michael

Rob McFeely

unread,
Oct 30, 2013, 10:49:50 AM10/30/13
to ne...@googlegroups.com
Michael

What do you mean by don't build your own jar?  Do you mean don't build all my dependencies into my jar as classes using maven or do you mean don't run my application from a jar at all.  Please explain further as this answer confuses me?

Rob

Michael Hunger

unread,
Oct 30, 2013, 10:58:25 AM10/30/13
to ne...@googlegroups.com
Don't put all dependencies into one uber-jar.

Leave them in separate jars or bundle them in  a war or ear.

If you want to merge them you also have to merge the text-files for the java-service loader.

Michael

Ranjith Anantharaman

unread,
Nov 14, 2013, 1:55:14 PM11/14/13
to neo4j
Hi Micheal,

Thanks for your replies, Yes the problem was exactly what you had pointed - I had put the Neo4j related jars into a jar that contains my project's code.. I removed all jars , and just point to Neo4j libraries through classpath (-cp option) and it works fine..Thanks again. 
Reply all
Reply to author
Forward
0 new messages