Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Spring Hibernate (JPA) integration

 
Anup Om
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Everybody,

I am running a webapp on Jboss 6. I have a UserDAO class that perists User objects annotated with JPA annotations.
Everything works fine when I use
<jee:jndi-lookup id="entityManagerFactory" jndi-name="java:/MyABookFactory" />

But, when I use below, I am getting a "java.lang.IllegalArgumentException: Unknown entity: com.mypackage.User", when I am trying to save the User object using entitymanager's persist.

<bean id="entityManagerFactory"
class="org.springframework.orm.jpa.LocalEntityManagerFactoryBean">
<property name="persistenceUnitName" value="MyABook" />
</bean>


Can some one please point out where I am going wrong.

Here is my applicationContext.xml


persistence.xml


Thanks for help in advance.
 
Anup Om
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can someone please point out what else is need to configure the JPA entity manager?


<bean id="entityManagerFactory"
class="org.springframework.orm.jpa.LocalEntityManagerFactoryBean">
<property name="persistenceUnitName" value="MyABook" />
</bean>


Thanks for you help.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic