SDN4:最近的快照构建已损坏

时间:2015-07-14 14:42:35

标签: 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

哪些更改可能导致此异常?

感谢。

2 个答案:

答案 0 :(得分:5)

我正在使用Gradle并遇到了完全相同的问题。

http://domain%5Cuser:password@proxy_ip:port 似乎已在InvalidPersistentPropertyPath(1.11.0.BUILD-SNAPSHOT)的最新SNAPSHOT版本中引入。我的项目还包括Spring Data JPA,它依赖于更稳定的版本(1.11.0.M1)。 Gradle做了一些冲突解决,并选择了没有新类的M1库,导致了spring-data-commons

现在,我正在解决这个问题,告诉Gradle忽略NoClassDefFoundError作为JPA的传递依赖,以便使用SNAPSHOT构建作为SDN的传递依赖项:

spring-data-commons

如果您正在使用Gradle,则可以使用以下方法检查冲突:

compile("org.springframework.data:spring-data-jpa:$springDataJpaVersion") {
  exclude group: "org.springframework.data", module: "spring-data-commons"
}

我认为检查每个项目的发布时间表是值得的,但不是这种解决方法是允许我们的构建继续。

答案 1 :(得分:0)

我使用Maven,Spring Boot 1.3.0.M1,spring-data-neo4j 4.0.0.BUILD-SNAPSHOT和neo4j 2.2.2。

正如simonl建议覆盖spring-data-commons 1.11.0.M1和1.11.0.BUILD-SNAPSHOT修复了这个问题。

<!-- Fix ClassNotFoundException: org.springframework.data.mapping.PersistentPropertyAccessor -->
<dependency>
    <groupId>org.springframework.data</groupId>
    <artifactId>spring-data-commons</artifactId>
    <version>1.11.0.BUILD-SNAPSHOT</version>
</dependency>

我记得在使用新版本的Neo4j和SDN 3时过去必须这样做,但是到现在为止还没有需要使用SDN 4的spring-data-commons覆盖。