• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

Error while Proxying DAO Classes

 
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am pasting this after searching the forum and not finding a suitable answer for this. I am using spring-2.5.6 and implementing AOP in my application.

Below is my Spring Config:


On container init the following error is generated:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'employeesService' defined in class path resource [springConfig.xml]: Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type [$Proxy10 implementing org.springframework.beans.factory.InitializingBean,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised] to required type [com.vivek.spring.employee.jdbc.dao.EmployeeDAO] for property 'employeeDAO'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [$Proxy10 implementing org.springframework.beans.factory.InitializingBean,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised] to required type [com.vivek.spring.employee.jdbc.dao.EmployeeDAO] for property 'employeeDAO': no matching editors or conversion strategy found

This error is not generated when i am proxying only the Service classes using "*Service".

Snippet of Service Class


It would be great if spring guru's can point out the mistake in configuration.

Mod's it is a long message i have posted. Please let me know if this need to be split into 2-3 posts.
 
Ranch Hand
Posts: 1936
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You proxy both Dao and Service, and also inject (proxy)Dao to Service so TypeMismatchException happens.
 
Vivek Kr Singh
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the answer. Is there any way AOP can be applied on the DAO classes ?
 
reply
    Bookmark Topic Watch Topic
  • New Topic