use*_*830 2 neo4j spring-data-neo4j-4
刚启动服务器时刚刚开始出现以下异常:
Error creating bean with name 'myRepository': Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/springframework/data/mapping/context/InvalidPersistentPropertyPath: org.springframework.data.mapping.context.InvalidPersistentPropertyPath
Run Code Online (Sandbox Code Playgroud)
哪些更改可能导致此异常?
谢谢.
我正在使用Gradle并遇到了完全相同的问题.
InvalidPersistentPropertyPath似乎已经在最新的SNAPSHOT版本spring-data-commons(1.11.0.BUILD-SNAPSHOT)中引入.我的项目还包括Spring Data JPA,它依赖于更稳定的版本(1.11.0.M1).Gradle做了一些冲突解决,然后选择了M1库,这个库没有新的类,导致了NoClassDefFoundError.
现在,我正在解决这个问题,告诉Gradle忽略spring-data-commons作为JPA的传递依赖,以便使用SNAPSHOT构建作为SDN的传递依赖项:
compile("org.springframework.data:spring-data-jpa:$springDataJpaVersion") {
exclude group: "org.springframework.data", module: "spring-data-commons"
}
Run Code Online (Sandbox Code Playgroud)
如果您正在使用Gradle,则可以使用以下方法检查冲突:
./gradlew <project>:dependencies
Run Code Online (Sandbox Code Playgroud)
我认为检查每个项目的发布时间表是值得的,但不是这种解决方法是允许我们的构建继续.