• 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
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

ProxyFactoryBean create AOP proxies causes error Can not set processService to com.sun.proxy.$Proxy

 
Ranch Hand
Posts: 681
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a service call it ProcessServiceImpl implements a interface ProcessServiceClient

in my junit I use


Now I have introduced AOP crosscutting that calls a Advice to run before and after a method within ProcessServiceImpl is called.

in my spring context I now have


I have missed out the pointcut an other code as its not the problem. Now i want autowire to pick up my proxy not processServiceClient so i modified my code to the followibg


But now this causes the error
Could not autowire field: protected ProcessServiceImpl
Can not set ProcessServiceImpl field service to com.sun.proxy.$Proxy46

When dealing with proxies I guess there is a different way to autowire them in ??

Thanks for any help

Tony

 
Tony Evans
Ranch Hand
Posts: 681
1
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Fixed I in my test replace class with the inteface

 
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tony Evans wrote:Fixed I in my test replace class with the inteface


Glad to hear you have fixed your own issue! And thanks for coming back and sharing your solution. It might be useful for other ranchers. Have a cow!
 
You’ll find me in my office. I’ll probably be drinking. And reading this tiny ad.
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic