aspose file tools*
The moose likes Spring and the fly likes Spring Hibernate (JPA) integration Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
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://aspose.com/file-tools
 
subject: Spring Hibernate (JPA) integration