org.springframework.aop.AopInvocationException



org.springframework.aop.AopInvocationException:

Null return value from advice does not match primitive return type for:

public int com.uplooking.club.vip.service.impl.VipServiceImpl.insert(com.uplooking.club.vip.entity.Vip)

原因:在调用aop around方法时,原方法的返回值与通知的返回值不一致,可以将void改成object

  public void payExprice(ProceedingJoinPoint point) throws Throwable {

System.out.println(“充值前”);

Object proceed = point.proceed();

System.out.println(“充值后”);

// return proceed;

    }

原方法是service层中的service实现类中的insert方法,返回值是

@Override

public int insert(Vip record) {

vipMapper.insert(record);

return 0;

}