-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Hibernate / JPA With JBoss And MS SQL Server 2008
PostPosted: Thu Jan 05, 2012 9:04 am 
Newbie

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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.