解决方法:在pom.xml文件中配置依赖 我之前用maven-install运行时,一直报错javax.servlet不存在,我找了很多方法都不起作用,后来我突发奇想,配置了一下pom.xml,问题解决了 javax.servlet javax.servlet-api 3.1.0 provided