What is "java.lang.NoSuchMethodError: org.neo4j.kernel.impl.util.ArrayMap.<init>(BZZ)V" when I call newEmbeddedDatabase ?

73 views
Skip to first unread message

Bill Nicholson

unread,
May 14, 2017, 3:02:31 PM5/14/17
to Neo4j
import java.io.File;  
import org.neo4j.graphdb.GraphDatabaseService;
import org.neo4j.graphdb.factory.GraphDatabaseFactory;   

public class testMain {

    public static void main(String[] args) {
        File x = new File("c:/temp/foo");
        //      GraphDatabaseService graphDb = new GraphDatabaseFactory().newEmbeddedDatabase( "c:/temp/foo" );
        GraphDatabaseService graphDb = new GraphDatabaseFactory().newEmbeddedDatabase( x );

    }
}


Exception in thread "main" java.lang.NoSuchMethodError: org.neo4j.kernel.impl.util.ArrayMap.<init>(BZZ)V
    at org.neo4j.kernel.impl.locking.community.RagManager.<init>(RagManager.java:72)
    at org.neo4j.kernel.impl.locking.community.CommunityLockManger.<init>(CommunityLockManger.java:34)
    at org.neo4j.kernel.impl.factory.CommunityEditionModule.createLockManager(CommunityEditionModule.java:247)
    at org.neo4j.kernel.impl.factory.CommunityEditionModule.<init>(CommunityEditionModule.java:104)
    at org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.initFacade(GraphDatabaseFacadeFactory.java:157)
    at org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.newFacade(GraphDatabaseFacadeFactory.java:124)
    at org.neo4j.graphdb.factory.GraphDatabaseFactory.newDatabase(GraphDatabaseFactory.java:133)
    at org.neo4j.graphdb.factory.GraphDatabaseFactory.newEmbeddedDatabase(GraphDatabaseFactory.java:126)
    at org.neo4j.graphdb.factory.GraphDatabaseFactory$1.newDatabase(GraphDatabaseFactory.java:101)
    at org.neo4j.graphdb.factory.GraphDatabaseBuilder.newGraphDatabase(GraphDatabaseBuilder.java:193)
    at org.neo4j.graphdb.factory.GraphDatabaseFactory.newEmbeddedDatabase(GraphDatabaseFactory.java:70)
    at testMain.main(testMain.java:14)

Chris Vest

unread,
May 14, 2017, 3:49:23 PM5/14/17
to ne...@googlegroups.com
Make sure all your Neo4j dependencies are using the same version.

--
Chris Vest
System Engineer, Neo Technology
> --
> 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/d/optout.

Bill Nicholson

unread,
May 14, 2017, 4:16:58 PM5/14/17
to Neo4j
How, exactly?

Bill Nicholson

unread,
May 14, 2017, 4:23:33 PM5/14/17
to Neo4j
This is what I have:



On Sunday, May 14, 2017 at 3:49:23 PM UTC-4, Chris Vest wrote:
Auto Generated Inline Image 1

Michael Hunger

unread,
May 15, 2017, 2:10:54 AM5/15/17
to ne...@googlegroups.com
Best use a build too like maven / gradle and add org.neo4j:neo4j:3.2.0 as a dependency.
It will pull all required dependencies for you.


> Am 14.05.2017 um 22:23 schrieb Bill Nicholson <delmerwilli...@gmail.com>:
>
> This is what I have:
>
> <Auto Generated Inline Image 1.png>
> <Auto Generated Inline Image 1.png>

T L Andrews

unread,
Aug 23, 2017, 3:05:11 PM8/23/17
to Neo4j
Hi - I am having a very similar problem, for which StackOverflow has no answer, after upgrading from version 2.2.10 in my project.

java.lang.NoSuchMethodError: org.neo4j.helpers.collection.Iterables.toList(Ljava/lang/Iterable;)Ljava/util/List;
 at org
.neo4j.graphdb.factory.GraphDatabaseFactoryState.<init>(GraphDatabaseFactoryState.java:51)
 at org
.neo4j.graphdb.factory.GraphDatabaseFactory.<init>(GraphDatabaseFactory.java:47)
 at net
.stemmaweb.services.GraphDatabaseServiceProvider.<init>(GraphDatabaseServiceProvider.java:27)


I'm managing dependencies with Maven so it's difficult to see where version conflict could be arising. Just to be sure I cleared out the local repository and had maven re-download everything.
Relevant part of POM: 

        <!--  The following is used for the database Neo4J, including tests Neo4J -->
       
<dependency>
           
<groupId>org.neo4j</groupId>
           
<artifactId>neo4j</artifactId>
           
<version>${neo4j-version}</version>
       
</dependency>
       
<dependency>
           
<groupId>org.neo4j</groupId>
           
<artifactId>neo4j-kernel</artifactId>
           
<version>${neo4j-version}</version>
           
<type>test-jar</type>
           
<scope>test</scope>
       
</dependency>
       
<dependency>
           
<groupId>org.neo4j</groupId>
           
<artifactId>neo4j-io</artifactId>
           
<version>${neo4j-version}</version>
           
<type>test-jar</type>
           
<scope>test</scope>
       
</dependency>
       
<dependency>
           
<groupId>org.neo4j</groupId>
           
<artifactId>neo4j-shell</artifactId>
           
<version>${neo4j-version}</version>
       
</dependency>
<!-- ... -->
       
<neo4j-version>3.2.3</neo4j-version>


Any further clues would be *greatly* appreciated.

Michael Hunger

unread,
Aug 23, 2017, 7:36:12 PM8/23/17
to ne...@googlegroups.com
Can you share "mvn dependency:tree"
to see where you have a version conflict?

To unsubscribe from this group and stop receiving emails from it, send an email to neo4j+unsubscribe@googlegroups.com.

Tara Andrews

unread,
Aug 24, 2017, 1:31:25 AM8/24/17
to ne...@googlegroups.com
Sure - here you are. https://pastebin.com/kh7tuRh9

For what it's worth, I was able to get the application running without error on another (Mac) computer yesterday evening, identical in environment except that the version of Tomcat in use is slightly older.

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/_okGrOSqYDo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to neo4j+un...@googlegroups.com.

Michael Hunger

unread,
Aug 24, 2017, 2:32:14 AM8/24/17
to ne...@googlegroups.com
This looks almost ok to me (this one is a bit weird: neo4j-graph-matching)

Perhaps some other /old libs remaining somewhere on the classpath?

You can set the JVM parameter: -verbose:class to see where classes are loaded from written to the logs.

To unsubscribe from this group and stop receiving emails from it, send an email to neo4j+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
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/_okGrOSqYDo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to neo4j+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
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+unsubscribe@googlegroups.com.

T L Andrews

unread,
Aug 24, 2017, 3:18:53 AM8/24/17
to Neo4j, michael...@neo4j.com
Aha - it turns out that when IntelliJ rebuilds .war files and their exploded counterparts, it doesn't clear out the previous target. There were indeed a lot of older .jar files lurking there. Thanks for pointing me in the right direction!
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/_okGrOSqYDo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to neo4j+un...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages