来源:http://www.bitsandpix.com/entry/spring-error-cannot-convert-value-of-type-proxy-to-required-type
In 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: