aspose file tools
The moose likes Spring and the fly likes Spring Hibernate (JPA) integration Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Frameworks » Spring
Reply Bookmark "Spring Hibernate (JPA) integration" Watch "Spring Hibernate (JPA) integration" New topic
Author

Spring Hibernate (JPA) integration

Anup Om
Ranch Hand

Joined: Dec 30, 2009
Posts: 62
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.


SCJP6
Anup Om
Ranch Hand

Joined: Dec 30, 2009
Posts: 62
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.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Spring Hibernate (JPA) integration
 
Similar Threads
XML name space error in Spring data JPA hibernate applicationContext.xml
org.springframework.beans.factory.BeanCreationException
configuring jndi lookup
Caching with Spring + Hibernate JPA + JBoss Cache
No unique bean of type [javax.persistence.EntityManagerFactory] is defined: expected single bean but