AOP:Exception in thread “main“ java.lang.ClassCastException: com.sun.proxy.$Prox

  • Post author:
  • Post category:java


Java中自带的动态代理InvocationHandler接口、Proxy类只能针对接口进行动态代理

解决:

1.在main方法里用接口

IColumnService columnSrvlmpl=(IColumnService)context.getBean("columnSrvlmpl");

2.在xml里添加

<aop:config proxy-target-class="true"></aop:config>



版权声明:本文为qq_50616415原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。