【问题标题】:Spring Data Neo4j/OGM - java.lang.NoSuchMethodError: org.neo4j.ogm.session.Session.loadSpring Data Neo4j/OGM - java.lang.NoSuchMethodError: org.neo4j.ogm.session.Session.load
【发布时间】:2016-12-03 23:04:08
【问题描述】:

我已经下载了最新版本

    <neo4j.version>3.0.7</neo4j.version>
    <spring-data-neo4j.version>4.2.0.BUILD-SNAPSHOT</spring-data-neo4j.version>
    <neo4j-ogm.version>2.1.0-SNAPSHOT</neo4j-ogm.version>

现在我的构建失败并出现以下异常:

java.lang.NoSuchMethodError: org.neo4j.ogm.session.Session.load(Ljava/lang/Class;Ljava/lang/Object;)Ljava/lang/Object;
    at org.springframework.data.neo4j.repository.support.SimpleGraphRepository.findOne(SimpleGraphRepository.java:86)
    at org.springframework.data.neo4j.repository.support.SimpleGraphRepository.findOne(SimpleGraphRepository.java:42)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.executeMethodOn(RepositoryFactorySupport.java:503)
    at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:488)
    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.data.projection.DefaultMethodInvokingMethodInterceptor.invoke(DefaultMethodInvokingMethodInterceptor.java:61)
    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:213)
    at com.sun.proxy.$Proxy122.findOne(Unknown Source)

更新

添加了导致此异常的代码:

@Repository
public interface CharacteristicRepository extends GraphRepository<Characteristic> {
....
}

characteristicRepository.findOne(id);

如何解决?

【问题讨论】:

  • 你能添加导致这个异常的代码吗?
  • 当然,我已经用代码更新了我的问题

标签: spring-data-neo4j-4 neo4j-ogm


【解决方案1】:

请将 OGM 的 2.1.0-RC1 与当前 SDN 快照一起使用。 SDN 的RC1 已被推迟,因此两个项目的快照有点不同步。最新的 OGM 代码随后领先于 SDN。在RC1 发布后,两者的快照应该会再次起作用。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-07-19
    • 1970-01-01
    • 1970-01-01
    • 2018-03-16
    • 1970-01-01
    • 2017-03-18
    • 2021-03-20
    • 2022-10-14
    相关资源
    最近更新 更多