admin管理员组

文章数量:1530059

**

Exception in thread “main” org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean named ‘userService’ is expected to be of type ‘com.zyq.service.impl.UserServiceImpl’ but was actually of type ‘com.sun.proxy.$Proxy2’ at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:378) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1084) at com.zyq.test.UserTest.main(UserTest.java:26)

**
做法在
aop:config
<aop:pointcut expression=“execution(* com.zyq.service..(…))” id=“mypoint”/>
<aop:advisor advice-ref=“before” pointcut-ref=“mypoint”/>
</aop:config>
后添加
<aop:aspectj-autoproxy proxy-target-class=“true”/>

本文标签: 错误提示通知aopSpringtype