Announcement Announcement Module
Collapse
No announcement yet.
Error While using JPA Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Error While using JPA

    i am getting the following error
    what could be the issue?

    Code:
    Caused by: 
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'accountDao' defined in ServletContext resource [/WEB-INF/applicationContext-jpa.xml]: Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:
    PropertyAccessException 1: org.springframework.beans.TypeMismatchException: Failed to convert property value of type [$Proxy0] to required type [javax.persistence.EntityManager] for property 'entityManagerFactory'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [$Proxy0] to required type [javax.persistence.EntityManager] for property 'entityManagerFactory': no matching editors or conversion strategy found
    Caused by: 
    org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessException details (1) are:
    PropertyAccessException 1:
    org.springframework.beans.TypeMismatchException: Failed to convert property value of type [$Proxy0] to required type [javax.persistence.EntityManager] for property 'entityManagerFactory'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [$Proxy0] to required type [javax.persistence.EntityManager] for property 'entityManagerFactory': no matching editors or conversion strategy found
    Caused by: 
    java.lang.IllegalArgumentException: Cannot convert value of type [$Proxy0] to required type [javax.persistence.EntityManager] for property 'entityManagerFactory': no matching editors or conversion strategy found
    	at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:225)
    	at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:139)
    	at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:771)
    	at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:604)
    	at org.springframework.beans.AbstractPropertyAccessor.setPropertyValue(AbstractPropertyAccessor.java:49)
    	at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:74)
    	at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:57)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.applyPropertyValues(AbstractBeanFactory.java:852)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1054)

  • #2
    You have a setEntityManagerFactory(EntityManager em).
    It should be setEntityManagerFactory(EntityManagerFactory emf).

    Comment

    Working...
    X