该开始一直按错误去进行查询 看到网上的主要解决方法:1.注入的数据类型加入注解@Autowired,2.service层添加注解@Service3.在controller层,添加注解@RestController而不是@Controller4.并在JSON数据前加上@RequestBody5.spring-boot包冲突,再pom.xml文件中删除这个包org.springframework.bootspring-boot-starter-webcompile针对后面抛出的异常java.lang.NullPointerException出现的原因就是当一个对象的值为空时,你没有判断为空的情况解