If you are developing hibernate application, you would encounter the following exception if you have not added the jta-1.1.jar in your libraries. This JAR file is used in the hibernate transaction development. However, when you run the configuration itself will throw the exception if the JAR file is not found. Lets see how you can get this JAR file.
Maven POM Entry
<dependencies> <dependency> <groupId>javax.transaction</groupId> <artifactId>jta</artifactId> <version>1.1</version> </dependency> </dependencies>
JBoss Repository
<repositories> <repository> <id>JBoss repository</id> <url>http://repository.jboss.com/maven2/</url> </repository> </repositories> <dependencies> <dependency> <groupId>javax.transaction</groupId> <artifactId>jta</artifactId> <version>1.1</version> </dependency> </dependencies>
Exception Trace
Exception in thread "main" java.lang.NoClassDefFoundError: javax/transaction/SystemException at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Unknown Source) at org.jboss.logging.Logger$1.run(Logger.java:2252) at java.security.AccessController.doPrivileged(Native Method) at org.jboss.logging.Logger.getMessageLogger(Logger.java:2227) at org.jboss.logging.Logger.getMessageLogger(Logger.java:2214) at org.hibernate.cfg.Configuration.<clinit>(Configuration.java:192) at javabeat.net.hibernate.HibernateUtil.main(HibernateUtil.java:12) Caused by: java.lang.ClassNotFoundException: javax.transaction.SystemException at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source)