org.springframework.dao.InvalidDataAccessResourceUsageException: Error executing statement start `privilege`=node:__types__(className="com.geogrep.persistence.entity.Privilege") where `privilege`.`name`! = {0} return `privilege`; nested exception is org.springframework.dao.InvalidDataAccessResourceUsageException: Error executing statement start `privilege`=node:__types__(className="com.geogrep.persistence.entity.Privilege") where `privilege`.`name`! = {0} return `privilege`; nested exception is org.neo4j.cypher.MissingIndexException: Index `__types__` does not exist

Spring JIRA | Eugen Paraschiv | 5 years ago
  1. 0

    After upgrading to: spring-data-neo4j - 2.1.0.BUILD-SNAPSHOT and neo4j - 1.7, on an DAO with the following method: Privilege findByName(final String name); I'm not getting: org.springframework.dao.InvalidDataAccessResourceUsageException: Error executing statement start `privilege`=node:__types__(className="com.geogrep.persistence.entity.Privilege") where `privilege`.`name`! = {0} return `privilege`; nested exception is org.springframework.dao.InvalidDataAccessResourceUsageException: Error executing statement start `privilege`=node:__types__(className="com.geogrep.persistence.entity.Privilege") where `privilege`.`name`! = {0} return `privilege`; nested exception is org.neo4j.cypher.MissingIndexException: Index `__types__` does not exist at org.springframework.data.neo4j.support.query.CypherQueryEngine.query(CypherQueryEngine.java:56) ~[spring-data-neo4j-2.1.0.BUILD-20120504.181520-147.jar:na] at org.springframework.data.neo4j.repository.query.GraphRepositoryQuery.dispatchQuery(GraphRepositoryQuery.java:96) ~[spring-data-neo4j-2.1.0.BUILD-20120504.181520-147.jar:na] at org.springframework.data.neo4j.repository.query.GraphRepositoryQuery.execute(GraphRepositoryQuery.java:70) ~[spring-data-neo4j-2.1.0.BUILD-20120504.181520-147.jar:na] at org.springframework.data.neo4j.repository.query.DerivedCypherRepositoryQuery.execute(DerivedCypherRepositoryQuery.java:36) ~[spring-data-neo4j-2.1.0.BUILD-20120504.181520-147.jar:na] at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:313) ~[spring-data-commons-core-1.3.0.RC2.jar:na] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) ~[spring-aop-3.1.1.RELEASE.jar:3.1.1.RELEASE] at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110) ~[spring-tx-3.1.1.RELEASE.jar:3.1.1.RELEASE] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) ~[spring-aop-3.1.1.RELEASE.jar:3.1.1.RELEASE] at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:155) ~[spring-tx-3.1.1.RELEASE.jar:3.1.1.RELEASE] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) ~[spring-aop-3.1.1.RELEASE.jar:3.1.1.RELEASE] at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) ~[spring-aop-3.1.1.RELEASE.jar:3.1.1.RELEASE] at $Proxy52.findByName(Unknown Source) ~[na:na] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_04] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[na:1.7.0_04] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_04] at java.lang.reflect.Method.invoke(Method.java:601) ~[na:1.7.0_04] at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:318) ~[spring-aop-3.1.1.RELEASE.jar:3.1.1.RELEASE] at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:196) ~[spring-aop-3.1.1.RELEASE.jar:3.1.1.RELEASE] at $Proxy53.findByName(Unknown Source) ~[na:na] at com.geogrep.persistence.service.privilege.PrivilegeService.findByName(PrivilegeService.java) ~[classes/:na] Being autogenerated, this worked just fine with the stable spring-data-neo4j version. Related to forum post: http://forum.springsource.org/showthread.php?126142-InvalidDataAccessResourceUsageException-on-simple-query-after-upgrade&p=411713#post411713

    Spring JIRA | 5 years ago | Eugen Paraschiv
    org.springframework.dao.InvalidDataAccessResourceUsageException: Error executing statement start `privilege`=node:__types__(className="com.geogrep.persistence.entity.Privilege") where `privilege`.`name`! = {0} return `privilege`; nested exception is org.springframework.dao.InvalidDataAccessResourceUsageException: Error executing statement start `privilege`=node:__types__(className="com.geogrep.persistence.entity.Privilege") where `privilege`.`name`! = {0} return `privilege`; nested exception is org.neo4j.cypher.MissingIndexException: Index `__types__` does not exist
  2. 0

    After upgrading to: spring-data-neo4j - 2.1.0.BUILD-SNAPSHOT and neo4j - 1.7, on an DAO with the following method: Privilege findByName(final String name); I'm not getting: org.springframework.dao.InvalidDataAccessResourceUsageException: Error executing statement start `privilege`=node:__types__(className="com.geogrep.persistence.entity.Privilege") where `privilege`.`name`! = {0} return `privilege`; nested exception is org.springframework.dao.InvalidDataAccessResourceUsageException: Error executing statement start `privilege`=node:__types__(className="com.geogrep.persistence.entity.Privilege") where `privilege`.`name`! = {0} return `privilege`; nested exception is org.neo4j.cypher.MissingIndexException: Index `__types__` does not exist at org.springframework.data.neo4j.support.query.CypherQueryEngine.query(CypherQueryEngine.java:56) ~[spring-data-neo4j-2.1.0.BUILD-20120504.181520-147.jar:na] at org.springframework.data.neo4j.repository.query.GraphRepositoryQuery.dispatchQuery(GraphRepositoryQuery.java:96) ~[spring-data-neo4j-2.1.0.BUILD-20120504.181520-147.jar:na] at org.springframework.data.neo4j.repository.query.GraphRepositoryQuery.execute(GraphRepositoryQuery.java:70) ~[spring-data-neo4j-2.1.0.BUILD-20120504.181520-147.jar:na] at org.springframework.data.neo4j.repository.query.DerivedCypherRepositoryQuery.execute(DerivedCypherRepositoryQuery.java:36) ~[spring-data-neo4j-2.1.0.BUILD-20120504.181520-147.jar:na] at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:313) ~[spring-data-commons-core-1.3.0.RC2.jar:na] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) ~[spring-aop-3.1.1.RELEASE.jar:3.1.1.RELEASE] at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110) ~[spring-tx-3.1.1.RELEASE.jar:3.1.1.RELEASE] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) ~[spring-aop-3.1.1.RELEASE.jar:3.1.1.RELEASE] at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:155) ~[spring-tx-3.1.1.RELEASE.jar:3.1.1.RELEASE] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) ~[spring-aop-3.1.1.RELEASE.jar:3.1.1.RELEASE] at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) ~[spring-aop-3.1.1.RELEASE.jar:3.1.1.RELEASE] at $Proxy52.findByName(Unknown Source) ~[na:na] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_04] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[na:1.7.0_04] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_04] at java.lang.reflect.Method.invoke(Method.java:601) ~[na:1.7.0_04] at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:318) ~[spring-aop-3.1.1.RELEASE.jar:3.1.1.RELEASE] at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:196) ~[spring-aop-3.1.1.RELEASE.jar:3.1.1.RELEASE] at $Proxy53.findByName(Unknown Source) ~[na:na] at com.geogrep.persistence.service.privilege.PrivilegeService.findByName(PrivilegeService.java) ~[classes/:na] Being autogenerated, this worked just fine with the stable spring-data-neo4j version. Related to forum post: http://forum.springsource.org/showthread.php?126142-InvalidDataAccessResourceUsageException-on-simple-query-after-upgrade&p=411713#post411713

    Spring JIRA | 5 years ago | Eugen Paraschiv
    org.springframework.dao.InvalidDataAccessResourceUsageException: Error executing statement start `privilege`=node:__types__(className="com.geogrep.persistence.entity.Privilege") where `privilege`.`name`! = {0} return `privilege`; nested exception is org.springframework.dao.InvalidDataAccessResourceUsageException: Error executing statement start `privilege`=node:__types__(className="com.geogrep.persistence.entity.Privilege") where `privilege`.`name`! = {0} return `privilege`; nested exception is org.neo4j.cypher.MissingIndexException: Index `__types__` does not exist
  3. 0

    problem using @query in spring neo4j

    GitHub | 3 years ago | Amitosh1
    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 " ^
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    I have a repository with method: {code:title="UserGroupRepository.java"} // User extends UserGroup @Query("START a=node({0}), t=node({1}) MATCH path=a -[:PROVIDE_MEMBERS*0..]-> t RETURN count(path) > 0") Boolean checkMembershipInGroups(UserGroup member, Iterable<UserGroup> target); {code} And calling it with HashSet<UserGroup> as the second argument ends up with the following exception: {code:title="call"} userGroupRepository.checkMembershipInGroups(currentUser, d.getOpenFor()); // d.getOpenFor() returns Set<UserGroup> with a single element (NodeId 0). {code} {code:title="exception"} org.springframework.dao.InvalidDataAccessResourceUsageException: Error executing statement START a=node({0}), t=node({1}) MATCH path=a -[:PROVIDE_MEMBERS*0..]-> t RETURN count(path) > 0; nested exception is org.springframework.dao.InvalidDataAccessResourceUsageException: Error executing statement START a=node({0}), t=node({1}) MATCH path=a -[:PROVIDE_MEMBERS*0..]-> t RETURN count(path) > 0; nested exception is scala.MatchError: cz.lkbrno05.entities.User@0 (of class cz.lkbrno05.entities.User) at org.springframework.data.neo4j.support.query.CypherQueryEngineImpl.query(CypherQueryEngineImpl.java:61) at org.springframework.data.neo4j.repository.query.GraphRepositoryQuery.dispatchQuery(GraphRepositoryQuery.java:117) at org.springframework.data.neo4j.repository.query.GraphRepositoryQuery$1.doWithGraph(GraphRepositoryQuery.java:88) at org.springframework.data.neo4j.support.Neo4jTemplate.doExecute(Neo4jTemplate.java:456) at org.springframework.data.neo4j.support.Neo4jTemplate.access$000(Neo4jTemplate.java:86) at org.springframework.data.neo4j.support.Neo4jTemplate$2.doInTransaction(Neo4jTemplate.java:470) at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133) at org.springframework.data.neo4j.support.Neo4jTemplate.exec(Neo4jTemplate.java:467) at org.springframework.data.neo4j.repository.query.GraphRepositoryQuery.execute(GraphRepositoryQuery.java:82) at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:384) at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:344) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:98) at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:262) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:95) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:136) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207) at com.sun.proxy.$Proxy116.checkMembershipInGroups(Unknown Source) 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:606) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:201) at com.sun.proxy.$Proxy117.checkMembershipInGroups(Unknown Source) at cz.lkbrno05.webapp.controllers.DocumentController.getDocument(DocumentController.java:425) {code} I debugged the issue and it lies in *org.springframework.data.neo4j.repository.query.GraphRepositoryQuery.convertGraphEntityToId* which is supposed to convert entities to NodeIds. But it does not know how to process Iterables. Everything worked properly when I converted my method to use Iterable<Long> and passed precomputed Set of NodeIds to it. {code:title="Working call"} List<Long> openFor = new ArrayList<Long>(); for (UserGroup userGroup: d.getOpenFor()) { openFor.add(userGroup.getNodeId()); } // Boolean checkMembershipInGroups(UserGroup member, Iterable<Long> target); userGroupRepository.checkMembershipInGroups(currentUser, openFor); {code}

    Spring JIRA | 2 years ago | Martin Sivák
    org.springframework.dao.InvalidDataAccessResourceUsageException: Error executing statement START a=node({0}), t=node({1}) MATCH path=a -[:PROVIDE_MEMBERS*0..]-> t RETURN count(path) > 0; nested exception is org.springframework.dao.InvalidDataAccessResourceUsageException: Error executing statement START a=node({0}), t=node({1}) MATCH path=a -[:PROVIDE_MEMBERS*0..]-> t RETURN count(path) > 0; nested exception is scala.MatchError: cz.lkbrno05.entities.User@0 (of class cz.lkbrno05.entities.User)
  6. 0

    using In clause in @query spring neo4j (Neo4j forum at Coderanch)

    coderanch.com | 5 months ago
    org.springframework.dao.InvalidDataAccessResourceUsageException: Error executing statement start n=node({0}) match (n)-[r]->(inbox) where r.relation in {%strings} return inbox ; nested exception is org.springframework.dao.InvalidDataAccessResourceUsageException: Error executing statement start n=node({0}) match (n)-[r]->(inbox) where r.relation in {%strings} return inbox ; nested exception is expected return clause "start n=node({0}) match (n)-[r]->(inbox) where r.relation in {%strings} return inbox " ^

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. org.springframework.dao.InvalidDataAccessResourceUsageException

      Error executing statement start `privilege`=node:__types__(className="com.geogrep.persistence.entity.Privilege") where `privilege`.`name`! = {0} return `privilege`; nested exception is org.springframework.dao.InvalidDataAccessResourceUsageException: Error executing statement start `privilege`=node:__types__(className="com.geogrep.persistence.entity.Privilege") where `privilege`.`name`! = {0} return `privilege`; nested exception is org.neo4j.cypher.MissingIndexException: Index `__types__` does not exist

      at org.springframework.data.neo4j.support.query.CypherQueryEngine.query()
    2. Spring Data Neo4j
      DerivedCypherRepositoryQuery.execute
      1. org.springframework.data.neo4j.support.query.CypherQueryEngine.query(CypherQueryEngine.java:56)[spring-data-neo4j-2.1.0.BUILD-20120504.181520-147.jar:na]
      2. org.springframework.data.neo4j.repository.query.GraphRepositoryQuery.dispatchQuery(GraphRepositoryQuery.java:96)[spring-data-neo4j-2.1.0.BUILD-20120504.181520-147.jar:na]
      3. org.springframework.data.neo4j.repository.query.GraphRepositoryQuery.execute(GraphRepositoryQuery.java:70)[spring-data-neo4j-2.1.0.BUILD-20120504.181520-147.jar:na]
      4. org.springframework.data.neo4j.repository.query.DerivedCypherRepositoryQuery.execute(DerivedCypherRepositoryQuery.java:36)[spring-data-neo4j-2.1.0.BUILD-20120504.181520-147.jar:na]
      4 frames
    3. Spring Data Core
      RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke
      1. org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:313)[spring-data-commons-core-1.3.0.RC2.jar:na]
      1 frame
    4. Spring AOP
      ReflectiveMethodInvocation.proceed
      1. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)[spring-aop-3.1.1.RELEASE.jar:3.1.1.RELEASE]
      1 frame
    5. Spring Tx
      TransactionInterceptor.invoke
      1. org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)[spring-tx-3.1.1.RELEASE.jar:3.1.1.RELEASE]
      1 frame
    6. Spring AOP
      ReflectiveMethodInvocation.proceed
      1. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)[spring-aop-3.1.1.RELEASE.jar:3.1.1.RELEASE]
      1 frame
    7. Spring Tx
      PersistenceExceptionTranslationInterceptor.invoke
      1. org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:155)[spring-tx-3.1.1.RELEASE.jar:3.1.1.RELEASE]
      1 frame
    8. Spring AOP
      JdkDynamicAopProxy.invoke
      1. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)[spring-aop-3.1.1.RELEASE.jar:3.1.1.RELEASE]
      2. org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)[spring-aop-3.1.1.RELEASE.jar:3.1.1.RELEASE]
      2 frames
    9. Unknown
      $Proxy52.findByName
      1. $Proxy52.findByName(Unknown Source)[na:na]
      1 frame
    10. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[na:1.7.0_04]
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)[na:1.7.0_04]
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[na:1.7.0_04]
      4. java.lang.reflect.Method.invoke(Method.java:601)[na:1.7.0_04]
      4 frames
    11. Spring AOP
      JdkDynamicAopProxy.invoke
      1. org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:318)[spring-aop-3.1.1.RELEASE.jar:3.1.1.RELEASE]
      2. org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:196)[spring-aop-3.1.1.RELEASE.jar:3.1.1.RELEASE]
      2 frames
    12. Unknown
      $Proxy53.findByName
      1. $Proxy53.findByName(Unknown Source)[na:na]
      1 frame
    13. com.geogrep.persistence
      PrivilegeService.findByName
      1. com.geogrep.persistence.service.privilege.PrivilegeService.findByName(PrivilegeService.java)[classes/:na]
      1 frame