Joined: Thu Oct 13, 2011 2:12 am Posts: 3
|
I am trying to integrate Hibernate with JBoss and MS SQL Server. I am using JPA APIs for the same. I am getting the following exception:
java.lang.IllegalArgumentException: Unknown entity: com.savvion.test.Department at org.hibernate.ejb.AbstractEntityManagerImpl.find(AbstractEntityManagerImpl.java:193) at com.savvion.commons.bps.jpa.JPAService.getByPK(JPAService.java:275) at com.savvion.commons.bps.jpa.JPAService.get(JPAService.java:174) at com.savvion.test.JPAClient.insert(JPAClient.java:18)
Caused by: org.hibernate.MappingException: Unknown entity: com.savvion.test.Department at org.hibernate.impl.SessionFactoryImpl.getEntityPersister(SessionFactoryImpl.java:580) at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:91) at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:905) at org.hibernate.impl.SessionImpl.get(SessionImpl.java:842) at org.hibernate.impl.SessionImpl.get(SessionImpl.java:835) at org.hibernate.ejb.AbstractEntityManagerImpl.find(AbstractEntityManagerImpl.java:182)
The persistence unit that I am using is:
<persistence-unit name="DefaultJTA" transaction-type="JTA"> <provider>org.hibernate.ejb.HibernatePersistence</provider> <jta-data-source>jdbc/SBMCommonDBXA</jta-data-source> <properties> <property name="hibernate.archive.autodetection" value="class, hbm"/> <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup"/> <property name="hibernate.show_sql" value="true"/> <property name="hibernate.connection.datasource" value="jdbc/SBMCommonDBXA"/> <property name="hibernate.dialect" value="org.hibernate.dialect.SQLServerDialect" /> <property name="hibernate.connection.driver_class" value="com.savvion.jdbc.sqlserver.SQLServerDriver" /> <property name="hibernate.current_session_context_class" value="jta"/> </properties> </persistence-unit>
A couple of things I have verified / tried: 1. The entities that are used (present at the same level as the META-INF folder containing persistence.xml) do not have any hibernate specific annotations. 2. Tried listing the entity classes in persistence unit using <class> 3. Database connectivity using the same driver is successful - tested with another java client. 4. The persistence unit itself gets loaded without any issues.
Appreciate any help on this issue...
Thanks!
Devan.
|
|