Hibernate 3.6.0 with Maven
I'm having issues upgrading a pom file from Hibernate 3.3.2 to 3.6.0. I can compile f开发者_如何学编程ine, the jar file is being pulled down, but I get the following error: java.lang.NoClassDefFoundError: Could not initialize class org.hibernate.cfg.Configuration
when running Surefire tests. This class is in the referenced JAR, so I'm not quite sure what's going on here unless the classpath maven is using is somehow referencing the wrong jar. I did a purge of my local repository cache to no avail.
A snip of my pom is below. Any thoughts?
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>3.6.0.Final</version>
</dependency>
<repository>
<id>JBoss</id>
<name>JBoss repository</name>
<url>https://repository.jboss.org/nexus/content/groups/public-jboss</url>
</repository>
NoClassDefFoundError
indicates that the class could not be instantiated. One possibility is that some of the required dependencies for hibnernate are missing. This thread discussed your problem and suggests solution as well.
I ended purging my repository and redownloading everything and it worked. Ugh, best kind of error...
精彩评论