New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problem using @query in spring neo4j #1771

Open
Amitosh1 opened this Issue Dec 31, 2013 · 2 comments

Comments

Projects
None yet
2 participants
@Amitosh1

Amitosh1 commented Dec 31, 2013

Hi all,
i am experimenting with neo4j spring to create a message dash board.
this is more like a email box view.
to get a person inbox view i was trying to execute below query

@query(value = "start n=node({0}) match (n)-[r]->(inbox) where r.relation in {1} return inbox ")
Set getFolderMails(Person person,Set strings);
where the Set of strings contains->("To","cc","bcc").
but this query always fail with below exception

[DEBUG] http-bio-8080-exec-10 11:21:31 Exception thrown in method 'getPersonInBox' of class [org.test.spring.neo.controller.PersonController]
org.springframework.dao.InvalidDataAccessResourceUsageException: Error executing statement start n=node({0}) match (n)-[r]->(inbox) where r.relation in {1} return inbox ; nested exception is org.springframework.dao.InvalidDataAccessResourceUsageException: Error executing statement start n=node({0}) match (n)-[r]->(inbox) where r.relation in {1} return inbox ; nested exception is expected return clause
"start n=node({0}) match (n)-[r]->(inbox) where r.relation in {1} return inbox "
^
at org.springframework.data.neo4j.support.query.CypherQueryEngine.query(CypherQueryEngine.java:56)
at org.springframework.data.neo4j.repository.query.GraphRepositoryQuery.dispatchQuery(GraphRepositoryQuery.java:91)
at org.springframework.data.neo4j.repository.query.GraphRepositoryQuery.execute(GraphRepositoryQuery.java:70)
at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:302)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:155)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at com.sun.proxy.$Proxy21.getFolderMails(Unknown Source)
at org.test.spring.neo.controller.PersonController.getPersonInBox(PersonController.java:80)
at org.test.spring.neo.controller.PersonController$$FastClassByCGLIB$$8631769e.invoke()
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:698)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.springframework.aop.interceptor.CustomizableTraceInterceptor.invokeUnderTrace(CustomizableTraceInterceptor.java:257)
at org.springframework.aop.interceptor.AbstractTraceInterceptor.invoke(AbstractTraceInterceptor.java:111)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:91)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:631)
at org.test.spring.neo.controller.PersonController$$EnhancerByCGLIB$$c4ac7aea.getPersonInBox()
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:219)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:745)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:686)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:925)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:920)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:816)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:801)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)
Caused by: org.springframework.dao.InvalidDataAccessResourceUsageException: Error executing statement start n=node({0}) match (n)-[r]->(inbox) where r.relation in {1} return inbox ; nested exception is expected return clause
"start n=node({0}) match (n)-[r]->(inbox) where r.relation in {1} return inbox "
^
at org.springframework.data.neo4j.support.query.CypherQueryEngine.parseAndExecuteQuery(CypherQueryEngine.java:67)
at org.springframework.data.neo4j.support.query.CypherQueryEngine.query(CypherQueryEngine.java:53)
... 55 more
Caused by: expected return clause
"start n=node({0}) match (n)-[r]->(inbox) where r.relation in {1} return inbox "
^
at org.neo4j.cypher.internal.parser.v1_6.CypherParserImpl.parse(CypherParserImpl.scala:65)
at org.neo4j.cypher.CypherParser.parse(CypherParser.scala:42)
at org.neo4j.cypher.ExecutionEngine$$anonfun$prepare$1.apply(ExecutionEngine.scala:60)
at org.neo4j.cypher.ExecutionEngine$$anonfun$prepare$1.apply(ExecutionEngine.scala:60)
at org.neo4j.cypher.internal.LRUCache.getOrElseUpdate(LRUCache.scala:31)
at org.neo4j.cypher.ExecutionEngine.prepare(ExecutionEngine.scala:60)
at org.neo4j.cypher.ExecutionEngine.execute(ExecutionEngine.scala:54)
at org.neo4j.cypher.ExecutionEngine.execute(ExecutionEngine.scala:57)
at org.neo4j.cypher.javacompat.ExecutionEngine.execute(ExecutionEngine.java:86)
at org.springframework.data.neo4j.support.query.CypherQueryEngine.parseAndExecuteQuery(CypherQueryEngine.java:65)
... 56 more

please help me to resolve this issue.

@Amitosh1 Amitosh1 closed this Dec 31, 2013

@Amitosh1 Amitosh1 reopened this Dec 31, 2013

@jexp

This comment has been minimized.

Show comment
Hide comment
@jexp

jexp Jan 2, 2014

Member

What version of Neo4j and Spring Data Neo4j / setup are you using?

Member

jexp commented Jan 2, 2014

What version of Neo4j and Spring Data Neo4j / setup are you using?

@ghost ghost assigned jexp Jan 2, 2014

@Amitosh1

This comment has been minimized.

Show comment
Hide comment
@Amitosh1

Amitosh1 Jan 2, 2014

Hi Michael
below are the version detail of different components .

    <spring.data.neo4j.version>2.1.0.M1</spring.data.neo4j.version>
    <neo4j.kernel.version>1.6</neo4j.kernel.version>
    <neo4j.cypher.version>1.6</neo4j.cypher.version>
    <neo4j.cypher.dsl.version>1.6</neo4j.cypher.dsl.version>
    <hibernate.validator.version>4.1.0.Final</hibernate.validator.version>
    <scala.library.version>2.9.0-1</scala.library.version>

Amitosh1 commented Jan 2, 2014

Hi Michael
below are the version detail of different components .

    <spring.data.neo4j.version>2.1.0.M1</spring.data.neo4j.version>
    <neo4j.kernel.version>1.6</neo4j.kernel.version>
    <neo4j.cypher.version>1.6</neo4j.cypher.version>
    <neo4j.cypher.dsl.version>1.6</neo4j.cypher.dsl.version>
    <hibernate.validator.version>4.1.0.Final</hibernate.validator.version>
    <scala.library.version>2.9.0-1</scala.library.version>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment