Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/rust/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
检索Spring数据Neo4j 4.1-SNAPSHOT中的@QueryResult时出现NoSuchMethodError_Neo4j_Spring Data Neo4j 4_Neo4j Ogm - Fatal编程技术网

检索Spring数据Neo4j 4.1-SNAPSHOT中的@QueryResult时出现NoSuchMethodError

检索Spring数据Neo4j 4.1-SNAPSHOT中的@QueryResult时出现NoSuchMethodError,neo4j,spring-data-neo4j-4,neo4j-ogm,Neo4j,Spring Data Neo4j 4,Neo4j Ogm,我最近升级到Spring-Data-Neo4j 4.1.0-BUILD-SNAPSHOT(使用Neo4j ogm 2.0.0-M01),并注意到检索@QueryResult的查询不再工作。我得到以下错误: java.lang.NoSuchMethodError: org.neo4j.ogm.response.model.DefaultRestModel.<init>(Ljava/util/Map;)V at org.neo4j.ogm.drivers.http.response.Re

我最近升级到Spring-Data-Neo4j 4.1.0-BUILD-SNAPSHOT(使用Neo4j ogm 2.0.0-M01),并注意到检索@QueryResult的查询不再工作。我得到以下错误:

java.lang.NoSuchMethodError: org.neo4j.ogm.response.model.DefaultRestModel.<init>(Ljava/util/Map;)V
at org.neo4j.ogm.drivers.http.response.RestModelResponse.next(RestModelResponse.java:39)
at org.neo4j.ogm.drivers.http.response.RestModelResponse.next(RestModelResponse.java:28)
at org.neo4j.ogm.context.RestModelMapper.map(RestModelMapper.java:53)
at org.neo4j.ogm.session.delegates.ExecuteQueriesDelegate.query(ExecuteQueriesDelegate.java:97)
at org.neo4j.ogm.session.delegates.ExecuteQueriesDelegate.query(ExecuteQueriesDelegate.java:76)
at org.neo4j.ogm.session.Neo4jSession.query(Neo4jSession.java:313)
at org.springframework.data.neo4j.repository.query.QueryResultGraphRepositoryQuery$1.apply(QueryResultGraphRepositoryQuery.java:69)
at org.springframework.data.neo4j.repository.query.QueryResultGraphRepositoryQuery$1.apply(QueryResultGraphRepositoryQuery.java:64)
at org.neo4j.ogm.session.delegates.TransactionsDelegate.doInTransaction(TransactionsDelegate.java:46)
at org.neo4j.ogm.session.Neo4jSession.doInTransaction(Neo4jSession.java:386)
at org.springframework.data.neo4j.repository.query.QueryResultGraphRepositoryQuery.mapToConcreteType(QueryResultGraphRepositoryQuery.java:64)
at org.springframework.data.neo4j.repository.query.QueryResultGraphRepositoryQuery.execute(QueryResultGraphRepositoryQuery.java:52)
at org.springframework.data.neo4j.repository.query.GraphRepositoryQuery.execute(GraphRepositoryQuery.java:52)
at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:482)
at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:460)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
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.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)
at com.sun.proxy.$Proxy49.getParticipatingMolecules2(Unknown Source)
at uk.ac.ebi.reactome.service.DatabaseObjectServiceImpl.getParticipatingMolecules2(DatabaseObjectServiceImpl.java:59)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:85)
at uk.ac.ebi.reactome.aop.LoggingAspect.monitorExecutionTimes(LoggingAspect.java:37)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:621)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:610)
at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:68)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)
at com.sun.proxy.$Proxy51.getParticipatingMolecules2(Unknown Source)
at uk.ac.ebi.reactome.service.DatabaseObjectServiceTest.testGetParticipatingMolecules2(DatabaseObjectServiceTest.java:144)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:75)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:86)
at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:84)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:254)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:89)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:193)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:78)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:212)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:68)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)
我是做错了什么,还是这是一个将来会解决的问题


感谢您的帮助

我不确定这是怎么发生的,但它似乎需要neo4j ogm
2.0.0-SNAPSHOT
您是否可以执行一个
mvn clean-U…
并查看它是否解决了问题,或者使用neo4j ogm快照?你需要包括

  <repository>
      <id>neo4j-snapshots</id>
      <url>http://m2.neo4j.org/content/repositories/snapshots</url>
      <snapshots>
      <enabled>true</enabled>
      </snapshots>
  </repository>
它应该有2.0.0-M01或2.0.0-SNAPSHOT,但不能两者都有,因为它们在查询结果时是不兼容的。
也许可以从本地maven存储库(org/neo4j/neo4j ogm)中删除2.0.0-M01和2.0.0-SNAPSHOT,并强制使用mvn-U进行更新?

不确定这是如何发生的,但看起来它需要neo4j ogm
2.0.0-SNAPSHOT
您是否可以执行一个
mvn clean-U…
并查看它是否解决了问题,或者使用neo4j ogm快照?你需要包括

  <repository>
      <id>neo4j-snapshots</id>
      <url>http://m2.neo4j.org/content/repositories/snapshots</url>
      <snapshots>
      <enabled>true</enabled>
      </snapshots>
  </repository>
它应该有2.0.0-M01或2.0.0-SNAPSHOT,但不能两者都有,因为它们在查询结果时是不兼容的。
也许可以从本地maven存储库(org/neo4j/neo4j ogm)中删除2.0.0-M01和2.0.0-SNAPSHOT,并强制使用mvn-U进行更新?

感谢您的快速响应。我已经编辑了显示我的依赖关系的帖子。对于ogm依赖项,我遵循ogm文档()。现在我发现我缺少了neo4j ogm的一个模块,所以当我加入neo4j ogm驱动程序时,一切都恢复正常了。奇怪的是,当我试图包含neo4j ogm时,依赖关系无法解决。neo4j-ogm-api和neo4j ogm核心是ogm 2.x所需的唯一ogm依赖关系。依赖项neo4j ogm仅在ogm 1.x中有效,我从您的链接中看到依赖项片段的标题不正确,对此表示歉意,我们将予以更正。对于ogm 2.x,我仍然需要neo4j ogm api、neo4j ogm core和neo4j ogm驱动程序才能使查询正常工作,这是有意的吗?不,您不需要显式地包含驱动程序。你能分享你的依赖关系树吗(包括所需的api和核心,不包括驱动程序)?我添加了没有neo4j-ogm-drivers的依赖关系树。感谢你的快速响应。我已经编辑了显示我的依赖关系的帖子。对于ogm依赖项,我遵循ogm文档()。现在我发现我缺少了neo4j ogm的一个模块,所以当我加入neo4j ogm驱动程序时,一切都恢复正常了。奇怪的是,当我试图包含neo4j ogm时,依赖关系无法解决。neo4j-ogm-api和neo4j ogm核心是ogm 2.x所需的唯一ogm依赖关系。依赖项neo4j ogm仅在ogm 1.x中有效,我从您的链接中看到依赖项片段的标题不正确,对此表示歉意,我们将予以更正。对于ogm 2.x,我仍然需要neo4j ogm api、neo4j ogm core和neo4j ogm驱动程序才能使查询正常工作,这是有意的吗?不,您不需要显式地包含驱动程序。你能分享你的依赖关系树吗(包括所需的api和核心,不包括驱动程序)?我添加了没有neo4j ogm驱动程序的依赖关系树。
<!--Spring data neo4j-->
<dependency>
    <groupId>org.springframework.data</groupId>
    <artifactId>spring-data-neo4j</artifactId>
    <version>4.1.0.BUILD-SNAPSHOT</version>
</dependency>
<!--Neo4j object graph mapping -->
<dependency>
    <groupId>org.neo4j</groupId>
    <artifactId>neo4j-ogm-api</artifactId>
    <version>2.0.0-M01</version>
</dependency>
<dependency>
    <groupId>org.neo4j</groupId>
    <artifactId>neo4j-ogm-core</artifactId>
    <version>2.0.0-M01</version>
</dependency>
... 
[INFO] +- org.reactome.base:reactome-base:jar:1.2.1:compile
[INFO] |  \- mysql:mysql-connector-java:jar:5.1.28:compile
[INFO] +- org.springframework.data:spring-data-neo4j:jar:4.1.0.BUILD-SNAPSHOT:compile
[INFO] |  +- org.springframework.data:spring-data-commons:jar:1.12.0.BUILD-SNAPSHOT:compile
[INFO] |  |  \- org.springframework:spring-beans:jar:4.1.9.RELEASE:compile
[INFO] |  +- org.springframework:spring-context:jar:4.1.9.RELEASE:compile
[INFO] |  |  +- org.springframework:spring-aop:jar:4.1.9.RELEASE:compile
[INFO] |  |  |  \- aopalliance:aopalliance:jar:1.0:compile
[INFO] |  |  \- org.springframework:spring-expression:jar:4.1.9.RELEASE:compile
[INFO] |  +- org.springframework:spring-tx:jar:4.1.9.RELEASE:compile
[INFO] |  +- org.slf4j:slf4j-api:jar:1.7.13:compile
[INFO] |  \- org.slf4j:jcl-over-slf4j:jar:1.7.13:runtime
[INFO] +- org.springframework:spring-test:jar:4.2.4.RELEASE:test
[INFO] |  \- org.springframework:spring-core:jar:4.2.4.RELEASE:compile
[INFO] |     \- commons-logging:commons-logging:jar:1.2:compile
[INFO] +- org.neo4j:neo4j-ogm-api:jar:2.0.0-M01:compile
[INFO] |  +- com.fasterxml.jackson.core:jackson-databind:jar:2.5.1:compile
[INFO] |  |  +- com.fasterxml.jackson.core:jackson-annotations:jar:2.5.0:compile
[INFO] |  |  \- com.fasterxml.jackson.core:jackson-core:jar:2.5.1:compile
[INFO] |  +- ch.qos.logback:logback-classic:jar:1.1.3:compile
[INFO] |  +- ch.qos.logback:logback-core:jar:1.1.3:compile
[INFO] |  \- commons-codec:commons-codec:jar:1.10:compile
[INFO] +- org.neo4j:neo4j-ogm-core:jar:2.0.0-M01:compile
[INFO] |  +- org.neo4j:neo4j-ogm-compiler:jar:2.0.0-SNAPSHOT:compile
[INFO] |  +- org.neo4j:neo4j-ogm-drivers:jar:2.0.0-SNAPSHOT:compile
[INFO] |  |  +- org.neo4j:neo4j:jar:2.3.2:compile
[INFO] |  |  |  +- org.neo4j:neo4j-kernel:jar:2.3.2:compile
[INFO] |  |  |  |  +- org.neo4j:neo4j-primitive-collections:jar:2.3.2:compile
[INFO] |  |  |  |  |  +- org.neo4j:neo4j-unsafe:jar:2.3.2:compile
[INFO] |  |  |  |  |  \- org.neo4j:neo4j-function:jar:2.3.2:compile
[INFO] |  |  |  |  +- org.neo4j:neo4j-io:jar:2.3.2:compile
[INFO] |  |  |  |  |  \- org.apache.commons:commons-lang3:jar:3.3.2:compile
[INFO] |  |  |  |  +- org.neo4j:neo4j-csv:jar:2.3.2:compile
[INFO] |  |  |  |  \- org.neo4j:neo4j-logging:jar:2.3.2:compile
[INFO] |  |  |  +- org.neo4j:neo4j-lucene-index:jar:2.3.2:compile
[INFO] |  |  |  |  \- org.apache.lucene:lucene-core:jar:3.6.2:compile
[INFO] |  |  |  +- org.neo4j:neo4j-graph-algo:jar:2.3.2:compile
[INFO] |  |  |  +- org.neo4j:neo4j-udc:jar:2.3.2:compile
[INFO] |  |  |  +- org.neo4j:neo4j-graph-matching:jar:2.3.2:compile
[INFO] |  |  |  +- org.neo4j:neo4j-cypher:jar:2.3.2:compile
[INFO] |  |  |  |  +- org.scala-lang:scala-library:jar:2.11.7:compile
[INFO] |  |  |  |  +- org.scala-lang:scala-reflect:jar:2.11.7:compile
[INFO] |  |  |  |  +- org.scala-lang.modules:scala-parser-combinators_2.11:jar:1.0.4:compile
[INFO] |  |  |  |  +- org.neo4j:neo4j-codegen:jar:2.3.2:compile
[INFO] |  |  |  |  |  \- org.ow2.asm:asm:jar:5.0.2:compile
[INFO] |  |  |  |  +- org.neo4j:neo4j-cypher-compiler-1.9_2.11:jar:2.0.5:compile
[INFO] |  |  |  |  +- org.neo4j:neo4j-cypher-compiler-2.2_2.11:jar:2.2.6:compile
[INFO] |  |  |  |  +- org.neo4j:neo4j-cypher-compiler-2.3:jar:2.3.2:compile
[INFO] |  |  |  |  |  \- org.neo4j:neo4j-cypher-frontend-2.3:jar:2.3.2:compile
[INFO] |  |  |  |  +- org.parboiled:parboiled-scala_2.11:jar:1.1.7:compile
[INFO] |  |  |  |  |  \- org.parboiled:parboiled-core:jar:1.1.7:compile
[INFO] |  |  |  |  +- net.sf.opencsv:opencsv:jar:2.3:compile
[INFO] |  |  |  |  \- com.googlecode.concurrentlinkedhashmap:concurrentlinkedhashmap-lru:jar:1.4.2:compile
[INFO] |  |  |  +- org.neo4j:neo4j-jmx:jar:2.3.2:compile
[INFO] |  |  |  \- org.neo4j:neo4j-consistency-check:jar:2.3.2:compile
[INFO] |  |  |     \- org.neo4j:neo4j-consistency-check-legacy:jar:2.3.2:compile
[INFO] |  |  +- org.neo4j.driver:neo4j-java-driver:jar:1.0.0-M01:compile
[INFO] |  |  +- org.apache.httpcomponents:httpclient:jar:4.3.6:compile
[INFO] |  |  |  \- org.apache.httpcomponents:httpcore:jar:4.3.3:compile
[INFO] |  |  \- commons-io:commons-io:jar:2.4:compile
[INFO] |  \- commons-lang:commons-lang:jar:2.6:compile
[INFO] +- org.aspectj:aspectjweaver:jar:1.8.8:compile
[INFO] +- junit:junit:jar:4.12:test 
[INFO] |  \- org.hamcrest:hamcrest-core:jar:1.3:test
[INFO] \- com.martiansoftware:jsap:jar:2.1:compile
  <repository>
      <id>neo4j-snapshots</id>
      <url>http://m2.neo4j.org/content/repositories/snapshots</url>
      <snapshots>
      <enabled>true</enabled>
      </snapshots>
  </repository>
+- org.neo4j:neo4j-ogm-core:jar:2.0.0-M01:compile
[INFO] |  +- org.neo4j:neo4j-ogm-compiler:jar:2.0.0-SNAPSHOT:compile
[INFO] |  +- org.neo4j:neo4j-ogm-drivers:jar:2.0.0-SNAPSHOT:compile