详细报错为:
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userController': Unsatisfied dependency expressed through field 'userServiceImpl'; nested exception is org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean named 'userServiceImpl' is expected to be of type 'com.bjsxt.service.impl.UserServiceImpl' but was actually of type 'com.sun.proxy.$Proxy40'
这里是因为controller层中调用业务层的属性应该用service层的接口,如下所示:
@Autowired
private UserServiceImpl userServiceImpl;
改为:
@Autowired private UserService userServiceImpl;
这样就正确了