Joe
Joe

Reputation: 146

Neo4j and Gremlin from Java

I am trying to use gremlin to interact with my Neo4j community database. I am working in eclipse using maven.

Following the documentation in http://tinkerpop.apache.org/docs/3.1.0-incubating/#neo4j-gremlin i set up my dependencies to:

<dependencies>
    <dependency>
        <groupId>org.neo4j</groupId>
        <artifactId>neo4j-cypher</artifactId>
        <version>2.2.0</version>
    </dependency>
    <dependency>
        <groupId>org.neo4j</groupId>
        <artifactId>neo4j-ha</artifactId>
        <version>2.2.0</version>
    </dependency>
    <dependency>
        <groupId>org.apache.tinkerpop</groupId>
        <artifactId>gremlin-core</artifactId>
        <version>3.1.0-incubating</version>
    </dependency>
    <dependency>
        <groupId>org.apache.tinkerpop</groupId>
        <artifactId>neo4j-gremlin</artifactId>
        <version>3.1.0-incubating</version>
    </dependency>
    <dependency>
        <groupId>org.neo4j</groupId>
        <artifactId>neo4j-tinkerpop-api-impl</artifactId>
        <version>0.1-2.2</version>
    </dependency>
    <dependency>
        <groupId>org.neo4j</groupId>
        <artifactId>neo4j-tinkerpop-api</artifactId>
        <version>0.1</version>
    </dependency>
</dependencies>

After executing:

package test.gremlin.maven;

import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph;
import org.apache.tinkerpop.gremlin.structure.Graph;


public class TestGremlin {

public static void main(String[] args) {
    Graph graph = Neo4jGraph.open("/tmp/gremlintest");
    }
}

i get the following error:

Exception in thread "main" java.lang.ClassCastException: org.neo4j.function.Functions$$Lambda$24/252651381 cannot be cast to org.neo4j.helpers.Function
at org.neo4j.helpers.Settings$DefaultSetting.apply(Settings.java:846)
at org.neo4j.kernel.configuration.ConfigurationValidator.validate(ConfigurationValidator.java:50)
at org.neo4j.kernel.configuration.Config.replaceSettings(Config.java:204)
at org.neo4j.kernel.configuration.Config.<init>(Config.java:92)
at org.neo4j.kernel.impl.factory.PlatformModule.<init>(PlatformModule.java:124)
at org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.createPlatform(GraphDatabaseFacadeFactory.java:177)
at org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.newFacade(GraphDatabaseFacadeFactory.java:124)
at org.neo4j.kernel.impl.factory.CommunityFacadeFactory.newFacade(CommunityFacadeFactory.java:40)
at org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.newFacade(GraphDatabaseFacadeFactory.java:108)
at org.neo4j.graphdb.factory.GraphDatabaseFactory.newDatabase(GraphDatabaseFactory.java:130)
at org.neo4j.graphdb.factory.GraphDatabaseFactory$1.newDatabase(GraphDatabaseFactory.java:118)
at org.neo4j.graphdb.factory.GraphDatabaseBuilder.newGraphDatabase(GraphDatabaseBuilder.java:185)
at org.neo4j.tinkerpop.api.impl.Neo4jFactoryImpl.newGraphDatabase(Neo4jFactoryImpl.java:44)
at org.neo4j.tinkerpop.api.Neo4jFactory$Builder.open(Neo4jFactory.java:32)
at org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph.<init>(Neo4jGraph.java:131)
at org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph.open(Neo4jGraph.java:145)
at org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph.open(Neo4jGraph.java:154)
at test.gremlin.maven.TestGremlin.main(TestGremlin.java:10)

Upvotes: 2

Views: 1133

Answers (1)

Michael Hunger
Michael Hunger

Reputation: 41706

Can you try to use the latest release: which is 0.3-2.3.3

see: https://github.com/neo4j-contrib/neo4j-tinkerpop-api-impl/tree/0.3-2.3.3

Upvotes: 2

Related Questions