Spring: Error Cannot convert value of type [$Proxy...] to required type
March 22nd, 2009 by jeremychoneIn Spring, if you get an error like:
Error Cannot convert value of type [$Proxy...] to required type
It might be because you are using Spring AOP (e.g., @transactional annotations) with “interface-proxy” mode (the Default) rather than “class-proxy” mode. To setup “class-proxy” do the following:
- Copy aspectjweaver.jar and aspectjrt.jar to your Web application classpath (you can find these files in the Spring Distribution/lib/aspectj
- Add the following in the your app context xml:
<aop:config proxy-target-class=”true”/>
See also:
November 18th, 2010 at 11:19 am
Thanks a lot for your simple and concise post! A 5 minute Google search and your post solved my problem immediately . . . Thanks for contributing your knowledge to the “Google Coding” community!