Hi,
I'm using JBOSS as my JEE application server, which uses Hibernate as the JPA implementation. I'm also using a MYSQL DB, I'm getting ClassNotFoundException after ClassNotFoundException after including almost any jar I could find, but not getting anywhere, can anyone help as to what Jars I do need?
Hibernate version: 3.0
Mapping documents:
persistence.xml:
<persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/ ... ce_1_0.xsd" version="1.0">
<persistence-unit name="DBMSInfo">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<properties>
<property name="hibernate.show_sql" value="false" />
<property name="hibernate.format_sql" value="false" />
<property name="hibernate.archive.autodetection" value="class" />
<property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver" />
<property name="hibernate.connection.url" value="jdbc:mysql://localhost:3306/DBMSInfo" />
<property name="hibernate.connection.username" value="root" />
<property name="hibernate.connection.password" value="root" />
<property name="hibernate.c3p0.min_size" value="5" />
<property name="hibernate.c3p0.max_size" value="20" />
<property name="hibernate.c3p0.timeout" value="3000" />
<property name="hibernate.c3p0.max_statements" value="50" />
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect" />
<property name="hibernate.hbm2ddl.auto" value="create-drop" />
</properties>
</persistence-unit>
</persistence>
hibernate.cg.xml:
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="connection.url">jdbc:mysql://localhost:3306/DBMSInfo</property>
<property name="connection.username">ecolcar</property>
<property name="connection.password">ecolcar</property>
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="transaction.factory_class">org.hibernate.transaction.JDBCTransactionFactory</property>
<property name="current_session_context_class">thread</property>
<!-- this will show us all sql statements -->
<property name="hibernate.show_sql">true</property>
<!-- mapping files NOTICE WE HAVE NONE-->
</session-factory>
</hibernate-configuration>
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
08:13:08,806 INFO Version:15 - Hibernate Annotations 3.2.1.GA
08:13:08,821 INFO Environment:514 - Hibernate 3.2.6
08:13:08,821 INFO Environment:547 - hibernate.properties not found
08:13:08,821 INFO Environment:681 - Bytecode provider name : cglib
08:13:08,837 INFO Environment:598 - using JDK 1.4 java.sql.Timestamp handling
08:13:08,931 INFO Version:286 - Hibernate EntityManager 3.4.0.GA
Exception in thread "main" java.lang.NoSuchMethodError: org.hibernate.cfg.AnnotationConfiguration.addProperties(Ljava/util/Properties;)Lorg/hibernate/cfg/AnnotationConfiguration;
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:756)
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:191)
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:253)
at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:125)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:51)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:33)
at sware.dbms.businesstier.DbmsBean.<init>(DbmsBean.java:50)
at sware.dbms.clienttier.Driver.main(Driver.java:21)
Name and version of the database you are using: MySQL 5.0
The generated SQL (show_sql=true): None
Debug level Hibernate log excerpt: ??
Regards
Col