Note that there are some explanatory texts on larger screens.

plurals
  1. POMaven / Hibernate -- why NoClassDefFoundError on ConstraintViolationException?
    primarykey
    data
    text
    <p>I'm building this Hibernate application using Maven. It runs the way I expect in Eclipse (using a Maven plugin.) But when I "mvn clean install" the jar file from the command line, and then try to run the program in the jar with java -jar target/JarFileName.jar, the application eventually dies with:</p> <pre><code>Exception in thread "main" java.lang.NoClassDefFoundError: org/hibernate/exception/ConstraintViolationException </code></pre> <p>I see the class in the hibernate jar in the .m2 directory.</p> <p>Here's the latest hibernate-related dependencies I've got in my POM file. (I've been through a few iterations on this while trying to get it to work.)</p> <pre><code>&lt;dependency&gt; &lt;groupId&gt;org.hibernate&lt;/groupId&gt; &lt;artifactId&gt;hibernate-core&lt;/artifactId&gt; &lt;version&gt;3.3.2.GA&lt;/version&gt; &lt;/dependency&gt; &lt;dependency&gt; &lt;groupId&gt;org.hibernate&lt;/groupId&gt; &lt;artifactId&gt;hibernate-annotations&lt;/artifactId&gt; &lt;version&gt;3.4.0.GA&lt;/version&gt; &lt;/dependency&gt; &lt;dependency&gt; &lt;groupId&gt;org.hibernate&lt;/groupId&gt; &lt;artifactId&gt;hibernate-commons-annotations&lt;/artifactId&gt; &lt;version&gt;3.3.0.ga&lt;/version&gt; &lt;/dependency&gt; &lt;dependency&gt; &lt;groupId&gt;org.hibernate&lt;/groupId&gt; &lt;artifactId&gt;hibernate-entitymanager&lt;/artifactId&gt; &lt;version&gt;3.4.0.GA&lt;/version&gt; &lt;/dependency&gt; &lt;dependency&gt; &lt;groupId&gt;org.hibernate&lt;/groupId&gt; &lt;artifactId&gt;hibernate-tools&lt;/artifactId&gt; &lt;version&gt;3.2.3.GA&lt;/version&gt; &lt;scope&gt;test&lt;/scope&gt; &lt;/dependency&gt; </code></pre> <p>What am I leaving out?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload