This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic