Hi, I am trying out Hibernate EJB3. I have no clue what the error I have is. I would thank a million for anyone who can shed any light. This is the error I have.
1) testUserSave(com.test.persistence.TuserTest)java.lang.VerifyError: (class: org/hibernate/ejb/AbstractEntityManagerImpl, method: throwPersistenceException signature: (Lorg/hibernate/HibernateException;)V) Incompatible argument to function
at org.hibernate.ejb.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:37)
at org.hibernate.ejb.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:32)
at com.test.persistence.TuserTest.testUserSave(TuserTest.java:65)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
TuserTest.java:65 is this line
entityManager = entityManagerFactory.createEntityManager();
When I do this
entityManager = entityManagerFactory.createEntityManager(null);
This is what I got
There was 1 error:
1) testUserSave(com.test.persistence.TuserTest)java.lang.AbstractMethodError: org.hibernate.ejb.EntityManagerFactoryImpl.createEntityManager(Ljavax/persistence/PersistenceContextType;)Ljavax/persistence/EntityManager;
at com.test.persistence.TuserTest.testUserSave(TuserTest.java:65)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
I am new to Hibernate EJB3. So it very much possible on the way I use Hinernate, I guess. I have heard from other developers that it is solid. So I would appreciate if anyone can point out what I should do to get over this. The version I use is
Hibernate Core 3.2.CR1
Hibernate Annotations 3.1 beta 9
Hibernate EntityManager 3.1 beta 7
This is the persistence.xml I used.
<?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="test" transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<class>com.test.persistence.Tuser</class>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>
<property name="jdbc.url" value="jdbc:mysql://localhost:3306/test"/>
<property name="jdbc.driver" value="com.mysql.jdbc.Driver"/>
<property name="jdbc.user" value="user"/>
<property name="jdbc.password" value="password"/>
</properties>
</persistence-unit>
</persistence>
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:
Mapping documents:
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
Name and version of the database you are using:
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt: