错误记录:严重 [RMI TCP Connection(3)-127.0.0.1]
作者:互联网
错误记录:严重 [RMI TCP Connection(3)-127.0.0.1]
启动Tomcat的时候报错:
Connected to server
[2017-01-08 04:40:33,100] Artifact jspRun:war exploded: Artifact is being deployed, please wait...
08-Jan-2017 16:40:33.570 严重 [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[/Servlet]]
at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:441)
代码问题:
代码中的路径忘记加上/,导致报错!!!
修改后就可以运行了!!!
package com.liang.controller;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
/**
* @author liang
* @date 编写日期: 2022/3/11 17:35
*/
@WebServlet("/queryInfoServlet")
public class QueryProvince extends HttpServlet {
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
System.out.println("接收到了你的请求!");
}
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
doGet(req, resp);
}
}
更多请了解:
https://blog.csdn.net/x_iya/article/details/54234665
或者:
https://www.cnblogs.com/fangjian0423/p/servletContainer-tomcat-urlPattern.html
标签:127.0,ServletException,0.1,resp,TCP,catalina,import,servlet,javax 来源: https://blog.csdn.net/weixin_51276056/article/details/123596407