Eclipse修改web.xml文件配置servlet后出现Server Tomcat v9.0 Server at localhost failed to start.

在这里插入图片描述

原因是在web.xml配置代码servlet里引入的/servlet/CheckParamServlet.java文件里已经有了一个注解,即@WebServlet("/servlet/CheckParamServlet")
在这里插入图片描述
这与web.xml里的配置起了冲突,会报错
在这里插入图片描述
可以选择删除其中一个,我选择删除了注解,运行成功了(删除web.xml里的servlet配置也可以)
在这里插入图片描述
参考链接:在web.xml中加了servlet配置之后出现Server Tomcat v7.0 Server at localhost failed to start.

猜你喜欢

转载自blog.csdn.net/m0_55887872/article/details/120983559
今日推荐