Spring——aop native implementation method reports error

Error type: java.lang.ClassCastException: com.sun.proxy.$Proxy25 cannot be cast to com.itbaizhan.dao.UserDao

 Solution: UseDao should be an interface type instead of an implementation class type.

Method: Add <aop:aspectj-autoproxy proxy-target-class="true"></aop:aspectj-autoproxy> in the configuration file.xml

 

Guess you like

Origin blog.csdn.net/qq_43241216/article/details/127146402