I've tried to configure pom.xml
file for my Spring 3
and Hibernate 3.6
application.
The relevant part of pom.xml
looks like this:
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.9</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>3.6.3.Final</version>
</dependency>
<dependency>
<groupId>org.javassist</groupId>
<artifactId>javassist</artifactId>
<version>3.17.1-GA</version>
</dependency>
<dependency>
<groupId>asm</groupId>
<artifactId>asm-all</artifactId>
<version>2.2</version>
</dependency>
<dependency>
<groupId>antlr</groupId>
<artifactId>antlr</artifactId>
<version>2.7.7</version>
</dependency>
Nevertheless, if I don't include javassist.jar
library directly to my buildpath as an External jar
, I keep getting java.lang.ClassNotFoundException
. Is there anything wrong in my pom.xml
, due it doesn't download this dependency when building the project?
Try hibernate-entitymanager
instead of hibernate-core
.
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>3.6.3.Final</version>
</dependency>
This will include all necessary dependencies transitively. Check maven dependency hierarchy after you make this change.
BTW the lastest available version of hibernate in maven central is 4.1.18
java.lang.ClassNotFoundException should also mention the name of class which was not found.
First you verify the jar you are trying to copy is getting copied into the build path or not.
If 1 is yes, then expand the javassist-3.17.1-GA.jar to check if the missing class file for which you got exception is present or not.
The external jar which resolves the issues, try to find out its version, maybe you can get it from MANIFEST.MF file of that jar.
May be something was refactored which is causing the problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With