Phenomenon:Tomcat is installed and ready to deploy the Web project. I start Tomcat and find that there is no response. Although it shows Tomcat started. However, this started is not the same as success. When we open the browser to access port 8080, we find that our tomcat is not started. Most tutorials on the Internet teach us to check port usage or configure the JDK environment. But in fact, we should analyze the reasons so that we can effectively deduce the results (my initial mistake was that there was an erroneous war package, which caused Tomcat to fail to start. This could not be discovered if we followed the online tutorials) All of tomcat's logs are stored in the tomcat logs directory. The logs when tomcat is started are stored in catalina.***.log. *** represents the date. We can find the catalina.***.log of the current date and locate the problem through the log information. Port usage:At this time, we can first find out the thread occupying the port: lsof -nP -i:8080 Then kill the thread: kill -9 pid Spelling error in file:From the error message, we can see that the cause of this problem is a spelling error in the second line of the file. We open the file and find that there is a space in the first line of the file. Just delete the space in the first line. <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd" version="4.0" metadata-complete="true"> <description> Servlet Example. </description> <display-name> MyServlet Example </display-name> <request-character-encoding>UTF-8</request-character-encoding> <servlet> <servlet-name>myServlet</servlet-name> <servlet-class>MyServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>myServlet</servlet-name> <url-pattern>/myservlet</url-pattern> </servlet-mapping> </web-app> This is the end of this article about why my tomcat cannot be started. For more relevant content about tomcat cannot be started, please search for previous articles on 123WORDPRESS.COM or continue to browse the related articles below. I hope everyone will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Summary of JavaScript's setTimeout() usage
>>: How to use negative margin technology to achieve average layout in CSS
1. Scroll Snap is a must-have skill for front-end...
vmware workstations starts the virtual machine er...
Table of contents A brief overview of the replica...
Table of contents Summary put first: 🌲🌲 Preface: ...
Problem Description After installing the plugin E...
Table of contents Preface 1. Background 2. Simula...
Web design, according to personal preferences and ...
As shown in the figure below, it is a common desi...
Method 1: Use the SET PASSWORD command mysql -u r...
Q: Whether using Outlook or IE, when you right-cl...
This article shares the second article of using j...
1: Install SVN yum install -y subversion 2. Creat...
Remote connection to MySQL fails, there may be th...
Preface In MySQL, we can use the EXPLAIN command ...
All the following codes are between <head>.....