Tomcat server is a free and open source Web application server. It is a lightweight application server and is widely used in small and medium-sized systems and in situations where there are not many concurrent users. It is the first choice for developing and debugging JSP programs. However, some friends will encounter various problems when starting Tomcat, such as garbled characters, port occupation, and flash back after starting Tomcat startup.bat. Here we will solve them one by one. Problem 1: Garbled characters appear after Tomcat's startup.bat is started Find the conf directory under the Tomcat file and modify the value of java.util.logging.ConsoleHandler.encoding in the logging.properties file to GBK Restart Tomcat. If the startup page you see is like this, it means the garbled problem has been solved. Problem 2: Port occupation that disappears suddenly When you start Tomcat, it may flash and quit. In fact, you can still see the log output by the Tomcat terminal. At this time, you need to quickly take a screenshot to capture the exception, which is too difficult. The most correct way is to check the logs and find the log of catalina on that day in the logs directory under the Tomcat directory . I found 17-Oct-2019 11:14:30.521 SEVERE [main] org.apache.catalina.core.StandardService.initInternal Failed to initialize connector [Connector[HTTP/1.1-8080]] org.apache.catalina.LifecycleException: Protocol handler initialization failed at org.apache.catalina.connector.Connector.initInternal(Connector.java:995) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136) at org.apache.catalina.core.StandardService.initInternal(StandardService.java:552) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136) at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:848) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136) at org.apache.catalina.startup.Catalina.load(Catalina.java:639) at org.apache.catalina.startup.Catalina.load(Catalina.java:662) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:309) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:492) Caused by: java.net.BindException: Address already in use: bind at sun.nio.ch.Net.bind0(Native Method) at sun.nio.ch.Net.bind(Net.java:433) at sun.nio.ch.Net.bind(Net.java:425) at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223) at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74) at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:219) at org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:1118) at org.apache.tomcat.util.net.AbstractJsseEndpoint.init(AbstractJsseEndpoint.java:224) at org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:581) at org.apache.coyote.http11.AbstractHttp11Protocol.init(AbstractHttp11Protocol.java:68) at org.apache.catalina.connector.Connector.initInternal(Connector.java:993) ... 13 more Find the server.xml configuration file in the conf directory in the Tomcat directory and modify the Tomcat startup port in the Connector tag. <Connector port="9080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" /> Problem 3: A flash of non-port problem When you start Tomcat, it crashes immediately. No error information is found in the logs in the logs directory. This is probably because the Tomcat and JDK versions do not correspond. It is possible that your Tomcat is Tomcat 9 and your JDK is 1.7. For the correspondence between Tomcat and JDK versions, please refer to this article, Correspondence between Tomcat and JDK Versions, Features of Tomcat Versions The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: Introduction to using MySQL commands to create, delete, and query indexes
>>: JavaScript to achieve dynamic table effect
Preface This article mainly introduces 4 methods ...
Table of contents 1. Background 2. Local custom i...
Demand background The team has the need for integ...
hash mode (default) Working principle: Monitor th...
Preface Sometimes you come across business tables...
In the MySQL database, when we need fuzzy query, ...
Build the image Earlier we used various images fo...
Container is another core concept of Docker. Simp...
Format Encoding 1. Please set the page width with...
background: Tablespace: All INNODB data is stored...
Encapsulate a navigation bar component in Vue3, a...
This post introduces a set of free Photoshop wire...
The effect shows that two browsers simulate each ...
Introduction to the usage of MySQL keyword Distin...
This article shares the specific code for JavaScr...