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
Recently, when I was drawing an interface, I enco...
Find the problem I recently encountered a problem...
When inserting data, I found that I had never con...
When you feel that there is a problem with MySQL ...
Table of contents 1. Technology Selection 2. Tech...
Introduction Describes the use cases and solution...
At present, most people who use Linux either use ...
First go to the official website to download and ...
Table of contents 1. What does shallow copy mean?...
1. CSS Navigation Bar (1) Function of the navigat...
Server Information Management server: m01 172.16....
The table caption can be placed above or below th...
Table of contents 1. Demand 2. Database Design 3....
Imagine a scenario where, when designing a user t...
MySQL 8.0.12 download and installation tutorial f...