Exception in thread "main" org.springframework.aop.AopInvocationException: Null return value from advice does not match primitive return type for: public int com.fanling.xmlaop.UserDaoImpl.addUser(com.fanling.xmlaop.User)
at org.springframework.aop.framework.CglibAopProxy.processReturnType(CglibAopProxy.java:391)
at org.springframework.aop.framework.CglibAopProxy.access$000(CglibAopProxy.java:84)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:690)
这个错就是返回的类型不匹配。
造成的原因:
目标类的方法有返回值,而around环绕方法没有返回值