严重 [RMI TCP Connection(3)-127.0.0.1] org.apache.catalina.core.ContainerBase.addChildInternal ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/1_demo_war]]
报错代码
严重 [RMI TCP Connection(3)-127.0.0.1] org.apache.catalina.core.ContainerBase.addChildInternal ContainerBase.addChild: start:
org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/1_demo_war]]
报错截图
探究原因
在src/main/webapp/WEB-INF/web.xml文件中配置Servlet时,映射地址中没有/
解决方法
正确示范
<servlet> <servlet-name>test1servlet-name> <servlet-class>com.example.demo.TestServlet1servlet-class> servlet> <servlet-mapping> <servlet-name>test1servlet-name> <url-pattern>/test1url-pattern> servlet-mapping>
来源地址:https://blog.csdn.net/weixin_45721835/article/details/128921202