I\'m getting the following stack trace...
java.lang.ClassNotFoundException: org.hibernate.service.jndi.JndiException
java.net.URLClassLoader$1.run(Unknow
I would try to resolve the ClassNotFoundException first. The error message should give you a better idea about what's wrong.
In order to do that check the version numbers of your hibernate-core lib and your hibernate-entitymanager lib. Also make sure your hibernate version is not conflicting with the jboss hibernate version.
İf you are using hibernate-core & hibernate-entitymanager in your pom.xml, They must mu same version. I tried this and solved.
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>4.1.9.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>4.1.9.Final</version>
</dependency>
I overwrote the version of hibernate-entitymanager to be the same as hibernate-core. fixed.
There could be 2 reasons:
1: an appropriate hibernate lib which contains the JNDIException
is missing within the classpath
2: There is a version conflict between duplicate hibernate.jars. This can happen if one tries to deploy an application within a JEEContainer (server) which already provides the same library but with a different version.
When the JNDIException
class can be resolved than your main problem becomes apparent within the error message.