现在的位置: 首页 > 综合 > 正文

Spring: Error Cannot convert value of type [$Proxy...] to required type

2012年12月22日 ⁄ 综合 ⁄ 共 594字 ⁄ 字号 评论关闭

来源: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:

  1. Copy aspectjweaver.jar and aspectjrt.jar to your Web application classpath (you can find these files in the Spring Distribution/lib/aspectj
  2. Add the following in the your app context xml:
    <aop:config proxy-target-class=”true”/>

See also:

抱歉!评论已关闭.