Hibernate version:
3.2
Mapping documents:
persist.xml (in META-INF which also contains correctly populated services directory containing persistence providers)...
<?xml version="1.0" encoding="UTF-8"?>
<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="sample" transaction-type="RESOURCE_LOCAL">
<class>com.somedomain.adhoc.ejb3.Person</class>
<properties>
<property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver" />
<property name="hibernate.connection.username" value="root" />
<property name="hibernate.connection.password" value="root" />
<property name="hibernate.connection.url" value="jdbc:mysql://localhost/test" />
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect" />
<property name="hibernate.hbm2ddl.auto" value="update" />
</properties>
</persistence-unit>
</persistence>
Code between sessionFactory.openSession() and session.close():
EntityManagerFactory emf = Persistence.createEntityManagerFactory("sample", new HashMap());
EntityManager em = emf.createEntityManager();
EntityTransaction tx = em.getTransaction();
tx.begin();
em.persist(new Person("Ben Franklin"));
tx.commit();
em.close();
Full stack trace of any exception that occurs:
Exception in thread "main" java.lang.IncompatibleClassChangeError
at org.hibernate.ejb.Version.<clinit>(Version.java:15)
at org.hibernate.ejb.Ejb3Configuration.<clinit>(Ejb3Configuration.java:112)
at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:119)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:51)
at com.webfuture.adhoc.ejb3.Runner.run(Runner.java:31)
at com.webfuture.adhoc.ejb3.Runner.main(Runner.java:16)
Name and version of the database you are using:
MySQL 5.0.21
The generated SQL (show_sql=true):
N/A - does not get that far
Debug level Hibernate log excerpt:
N/A
Tried using binaries found
here. After that did not work, tried compiling using source supplied in the above downloads, but to no avail (same issue).
Are the classes in the distribution compatiable with each other?