-1

Although tomcat hava started, locahost:8080 can't be connected enter image description here enter image description here

I hava tried some ways, such as: 1、close port 8080,But 8080 port is not used. enter image description here 2、Configure the path in the .zshrc file,but it's no use.

Frant
  • 5,382
  • 1
  • 16
  • 22
biao zhu
  • 11
  • 3
  • Can you add the startup logs to the question (edit the question)? They are in `logs/catalina..log` of the Tomcat installation. Please add those as text, not an image. – Piotr P. Karwasz Jun 06 '21 at 02:44
  • Can I how to do this , I hava found catalina.out in logs file. I am not understand your meaning , please speak careful again. – biao zhu Jun 06 '21 at 04:05
  • I hava solved this problem , thanks . It's jdk version problem . – biao zhu Jun 06 '21 at 05:12

2 Answers2

0

First use ps -ef | grep java command to see whether the Tomcat process exists. If it doesn't exist, check the logs logs/catalina.out to find out error messages.
Then make sure whether your Tomcat uses port 8080 to deal with HTTP requests. You can find similar text in the log file:

06-Jun-2021 12:58:12.264 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8081"]

I changed the HTTP port to 8081, so the log shows http-nio-8081. You can view/change the port in file conf/server.xml:

    <!-- A "Connector" represents an endpoint by which requests are received
         and responses are returned. Documentation at :
         Java HTTP Connector: /docs/config/http.html
         Java AJP  Connector: /docs/config/ajp.html
         APR (HTTP/AJP) Connector: /docs/apr.html
         Define a non-SSL/TLS HTTP/1.1 Connector on port 8080
    -->
    <Connector port="8081" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />
Jayce Cao
  • 1
  • 1
  • 4
  • OK,thanks , after 3 minutes , I hava finished this problem , jdk is much too new, I finsh jdk 1.8 , it's successful , amazing. That's all , the least jdk is not suitable to tomcat . – biao zhu Jun 06 '21 at 05:11
  • @biaozhu Are you sure it's caused by the JDK version? I can run Tomcat 10.0.6 successfully with latest AdoptOpenJDK-16.0.1+9 (build 16.0.1+9). – Jayce Cao Jun 06 '21 at 05:27
  • Yes,I am sure that , I have tried almost wat on the Internet , which is no power , however, I change my jdk version , localhost:8080 can connect right now. I am also amazing to this . – biao zhu Jun 06 '21 at 23:21
0

The least jdk is not suitable tomcat , we need install jdk1.8 by whitch can solve this problem . It's a amazing day .

biao zhu
  • 11
  • 3