所以我遇到了前面提到的public class QANorthController : QAControllerBase
{
public QANorthController(NorthBusinessLayer businessLayer) : base(businessLayer)
{
}
}
public class QASouthController : QAControllerBase
{
public QASouthController(SouthBusinessLayer businessLayer) : base(businessLayer)
{
}
}
。显然,在较新版本的hibernate中ClassNotFoundException
依赖于org.hibernate.cfg.AnnotationBinder
。如果您使用JPA 2.1,这是正确的行为。但是,当您需要JPA 2.0时,情况并非如此。
javax.persistence.NamedStoredProcedureQuery
答案 0 :(得分:0)
您必须将hibernate-entitymanager添加到类路径中。这是一个空罐子但由于某种原因它使核心jar jpa 2.0兼容。
<dependency>
<groupId>org.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.0-api</artifactId>
<version>1.0.1.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>5.2.10.Final</version>
<exclusions>
<exclusion>
<groupId>org.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.1-api</artifactId>
</exclusion>
</exclusions>
</dependency>