有可能是spring容器不能自动生成service对象,导致空指针异常,常见的情况可能是在service前面加@Service注释 转载于:https://www.cnblogs.com/yzml/p/11265081.html