Tomcat项目报错:严重 [RMI TCP Connection(3)-127.0.0.1] org.apache.catalina.core.ContainerBase.addChildInter

严重 [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]]

报错截图

Tomcat项目报错:严重 [RMI TCP Connection(3)-127.0.0.1] org.apache.catalina.core.ContainerBase.addChildInter_第1张图片

探究原因

在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>

你可能感兴趣的:(apache,tomcat,servlet)