Announcement Announcement Module
Collapse
No announcement yet.
SpringData Neo4j + Gremlin issue Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • SpringData Neo4j + Gremlin issue

    Maybe just a little bit more clarification about dependencies with TinkerPop Gremlin:
    When I try to issue this Gremlin query:

    @Query(value = "g.v(0).out('knows')", type = QueryType.Gremlin)
    Iterable<User> findAllFriendsByName(@Param("fullName") String name);

    I get this error message:
    java.lang.IllegalStateException: Gremlin is not available, please add it to your dependencies to execute: g.v(0).out('knows')
    at org.springframework.data.neo4j.support.DelegatingG raphDatabase$FailingQueryEngine.query(DelegatingGr aphDatabase.java:255)
    at org.springframework.data.neo4j.repository.query.Gr aphRepositoryQuery.dispatchQuery(GraphRepositoryQu ery.java:91)
    at org.springframework.data.neo4j.repository.query.Gr aphRepositoryQuery.execute(GraphRepositoryQuery.ja va:70)
    at org.springframework.data.repository.core.support.R epositoryFactorySupport$QueryExecutorMethodInterce ptor.invoke(RepositoryFactorySupport.java:302)
    at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :172)
    at org.springframework.transaction.interceptor.Transa ctionInterceptor.invoke(TransactionInterceptor.jav a:110)
    at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :172)
    at org.springframework.dao.support.PersistenceExcepti onTranslationInterceptor.invoke(PersistenceExcepti onTranslationInterceptor.java:155)
    at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :172)
    at org.springframework.aop.framework.JdkDynamicAopPro xy.invoke(JdkDynamicAopProxy.java:202)
    at $Proxy32.findAllFriendsByName(Unknown Source)
    at test.Tester.shouldRetrieveAUserKnownFriends(Tester .java:75)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknow n Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Un known Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.junit.runners.model.FrameworkMethod$1.runRefle ctiveCall(FrameworkMethod.java:44)
    at org.junit.internal.runners.model.ReflectiveCallabl e.run(ReflectiveCallable.java:15)
    at org.junit.runners.model.FrameworkMethod.invokeExpl osively(FrameworkMethod.java:41)
    at org.junit.internal.runners.statements.InvokeMethod .evaluate(InvokeMethod.java:20)
    at org.junit.internal.runners.statements.RunBefores.e valuate(RunBefores.java:28)
    at org.springframework.test.context.junit4.statements .RunBeforeTestMethodCallbacks.evaluate(RunBeforeTe stMethodCallbacks.java:74)
    at org.junit.internal.runners.statements.RunAfters.ev aluate(RunAfters.java:31)
    at org.springframework.test.context.junit4.statements .RunAfterTestMethodCallbacks.evaluate(RunAfterTest MethodCallbacks.java:82)
    at org.springframework.test.context.junit4.statements .SpringRepeat.evaluate(SpringRepeat.java:72)
    at org.springframework.test.context.junit4.SpringJUni t4ClassRunner.runChild(SpringJUnit4ClassRunner.jav a:231)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild( BlockJUnit4ClassRunner.java:49)
    at org.junit.runners.ParentRunner$3.run(ParentRunner. java:193)
    at org.junit.runners.ParentRunner$1.schedule(ParentRu nner.java:52)
    at org.junit.runners.ParentRunner.runChildren(ParentR unner.java:191)
    at org.junit.runners.ParentRunner.access$000(ParentRu nner.java:42)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRu nner.java:184)
    at org.springframework.test.context.junit4.statements .RunBeforeTestClassCallbacks.evaluate(RunBeforeTes tClassCallbacks.java:61)
    at org.springframework.test.context.junit4.statements .RunAfterTestClassCallbacks.evaluate(RunAfterTestC lassCallbacks.java:70)
    at org.junit.runners.ParentRunner.run(ParentRunner.ja va:236)
    at org.springframework.test.context.junit4.SpringJUni t4ClassRunner.run(SpringJUnit4ClassRunner.java:174 )
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestR eference.run(JUnit4TestReference.java:50)
    at org.eclipse.jdt.internal.junit.runner.TestExecutio n.run(TestExecution.java:38)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.runTests(RemoteTestRunner.java:467)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.runTests(RemoteTestRunner.java:683)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.run(RemoteTestRunner.java:390)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.main(RemoteTestRunner.java:197)


    This is my (probably messed up) pom.xml:

    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>MyProject</groupId>
    <artifactId>MyProject</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <dependencies>
    <dependency>
    <groupId>org.springframework.data</groupId>
    <artifactId>spring-data-neo4j</artifactId>
    <version>2.0.1.RELEASE</version>
    </dependency>
    <dependency>
    <groupId>org.neo4j</groupId>
    <artifactId>neo4j-cypher</artifactId>
    <version>1.6.M02</version>
    </dependency>
    <dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-test</artifactId>
    <version>3.0.6.RELEASE</version>
    <scope>test</scope>
    </dependency>
    <dependency>
    <groupId>junit</groupId>
    <artifactId>junit</artifactId>
    <version>4.8.2</version>
    <scope>test</scope>
    </dependency>
    <dependency>
    <groupId>org.codehaus.groovy</groupId>
    <artifactId>groovy-all</artifactId>
    <version>2.0.1</version>
    </dependency>
    <dependency>
    <groupId>com.tinkerpop.gremlin</groupId>
    <artifactId>gremlin-groovy</artifactId>
    <version>2.1.0</version>
    </dependency>
    <dependency>
    <groupId>com.tinkerpop.blueprints</groupId>
    <artifactId>blueprints</artifactId>
    <version>2.1.0</version>
    <type>pom</type>
    </dependency>
    <dependency>
    <groupId>com.tinkerpop.blueprints</groupId>
    <artifactId>blueprints-core</artifactId>
    <version>2.1.0</version>
    <type>zip</type>
    </dependency>
    <dependency>
    <groupId>com.tinkerpop.blueprints</groupId>
    <artifactId>blueprints-neo4j-graph</artifactId>
    <version>2.1.0</version>
    </dependency>
    <dependency>
    <groupId>org.springframework.data</groupId>
    <artifactId>spring-data-neo4j-rest</artifactId>
    <version>2.0.1.RELEASE</version>
    </dependency>
    </dependencies>
    <build>
    ...
    </build>
    </project>

  • #2
    Sorry, you need the pre-2.x version of gremlin.

    See: https://github.com/SpringSource/spri...parent/pom.xml

    Comment

    Working...
    X