小编典典

Tomcat不会在浏览器中加载默认网页

tomcat

我无法显示默认的tomcat网页。该网页显示:

该网页不可用ERR_CONNECTION_REFUSED

我在server.xml中将端口设置为8081

 <Connector port="8081" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />
    <!-- A "Connector" using the shared thread pool-->

我有一个launch.bat文件,当我在cmd中运行时应该启动Tomcat,除非我误解了它的工作方式。我是一个初学者,以前从未使用过Tomcat。这是正在运行的deploy.bat文件。任何帮助表示赞赏。

 Microsoft Windows [Version 10.0.10240]
(c) 2015 Microsoft Corporation. All rights reserved.

C:\Users\Joe>cd workspace/TomcatProject/src/week09/week09

C:\Users\Joe\workspace\TomcatProject\src\week09\week09>launch.bat
'launch.bat' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\Joe\workspace\TomcatProject\src\week09\week09>cd..

C:\Users\Joe\workspace\TomcatProject\src\week09>launch.bat

C:\Users\Joe\workspace\TomcatProject\src\week09>setlocal

C:\Users\Joe\workspace\TomcatProject\src\week09>SET TOOLS_HOME=C:\projects\tools\

C:\Users\Joe\workspace\TomcatProject\src\week09>SET TOMCAT_HOME=tomcat\apache-tomcat-8.0.14-windows-x64\apache-tomcat-8.0.14

C:\Users\Joe\workspace\TomcatProject\src\week09>SET JAVA_HOME=C:\Program Files\Java\jdk1.8.0_45

C:\Users\Joe\workspace\TomcatProject\src\week09>SET CATALINA_HOME=C:\projects\tools\tomcat\apache-tomcat-8.0.14-windows-x64\apache-tomcat-8.0.14

C:\Users\Joe\workspace\TomcatProject\src\week09>C:\projects\tools\tomcat\apache-tomcat-8.0.14-windows-x64\apache-tomcat-8.0.14\bin\startup.bat
Using CATALINA_BASE:   "C:\projects\tools\tomcat\apache-tomcat-8.0.14-windows-x64\apache-tomcat-8.0.14"
Using CATALINA_HOME:   "C:\projects\tools\tomcat\apache-tomcat-8.0.14-windows-x64\apache-tomcat-8.0.14"
Using CATALINA_TMPDIR: "C:\projects\tools\tomcat\apache-tomcat-8.0.14-windows-x64\apache-tomcat-8.0.14\temp"
Using JRE_HOME:        "C:\Program Files\Java\jre1.8.0_65"
Using CLASSPATH:       "C:\projects\tools\tomcat\apache-tomcat-8.0.14-windows-x64\apache-tomcat-8.0.14\bin\bootstrap.jar;C:\projects\tools\tomcat\apache-tomcat-8.0.14-windows-x64\apache-tomcat-8.0.14\bin\tomcat-juli.jar"
C:\Users\Joe\workspace\TomcatProject\src\week09>launch.bat

C:\Users\Joe\workspace\TomcatProject\src\week09>setlocal

C:\Users\Joe\workspace\TomcatProject\src\week09>SET TOOLS_HOME=C:\projects\tools\

C:\Users\Joe\workspace\TomcatProject\src\week09>SET TOMCAT_HOME=tomcat\apache-tomcat-8.0.14-windows-x64\apache-tomcat-8.0.14

C:\Users\Joe\workspace\TomcatProject\src\week09>SET JAVA_HOME=C:\Program Files\Java\jdk1.8.0_45

C:\Users\Joe\workspace\TomcatProject\src\week09>SET CATALINA_HOME=C:\projects\tools\tomcat\apache-tomcat-8.0.14-windows-x64\apache-tomcat-8.0.14

C:\Users\Joe\workspace\TomcatProject\src\week09>C:\projects\tools\tomcat\apache-tomcat-8.0.14-windows-x64\apache-tomcat-8.0.14\bin\startup.bat
Using CATALINA_BASE:   "C:\projects\tools\tomcat\apache-tomcat-8.0.14-windows-x64\apache-tomcat-8.0.14"
Using CATALINA_HOME:   "C:\projects\tools\tomcat\apache-tomcat-8.0.14-windows-x64\apache-tomcat-8.0.14"
Using CATALINA_TMPDIR: "C:\projects\tools\tomcat\apache-tomcat-8.0.14-windows-x64\apache-tomcat-8.0.14\temp"
Using JRE_HOME:        "C:\Program Files\Java\jre1.8.0_65"
Using CLASSPATH:       "C:\projects\tools\tomcat\apache-tomcat-8.0.14-windows-x64\apache-tomcat-8.0.14\bin\bootstrap.jar;C:\projects\tools\tomcat\apache-tomcat-8.0.14-windows-x64\apache-tomcat-8.0.14\bin\tomcat-juli.jar"
C:\Users\Joe\workspace\TomcatProject\src\week09>launch.bat

C:\Users\Joe\workspace\TomcatProject\src\week09>setlocal

C:\Users\Joe\workspace\TomcatProject\src\week09>SET TOOLS_HOME=C:\projects\tools\

C:\Users\Joe\workspace\TomcatProject\src\week09>SET TOMCAT_HOME=tomcat\apache-tomcat-8.0.14-windows-x64\apache-tomcat-8.0.14

C:\Users\Joe\workspace\TomcatProject\src\week09>SET JAVA_HOME=C:\Program Files\Java\jdk1.8.0_45

C:\Users\Joe\workspace\TomcatProject\src\week09>SET CATALINA_HOME=C:\projects\tools\tomcat\apache-tomcat-8.0.14-windows-x64\apache-tomcat-8.0.14

C:\Users\Joe\workspace\TomcatProject\src\week09>C:\projects\tools\tomcat\apache-tomcat-8.0.14-windows-x64\apache-tomcat-8.0.14\bin\startup.bat
Using CATALINA_BASE:   "C:\projects\tools\tomcat\apache-tomcat-8.0.14-windows-x64\apache-tomcat-8.0.14"
Using CATALINA_HOME:   "C:\projects\tools\tomcat\apache-tomcat-8.0.14-windows-x64\apache-tomcat-8.0.14"
Using CATALINA_TMPDIR: "C:\projects\tools\tomcat\apache-tomcat-8.0.14-windows-x64\apache-tomcat-8.0.14\temp"
Using JRE_HOME:        "C:\Program Files\Java\jre1.8.0_65"
Using CLASSPATH:       "C:\projects\tools\tomcat\apache-tomcat-8.0.14-windows-x64\apache-tomcat-8.0.14\bin\bootstrap.jar;C:\projects\tools\tomcat\apache-tomcat-8.0.14-windows-x64\apache-tomcat-8.0.14\bin\tomcat-juli.jar"
C:\Users\Joe\workspace\TomcatProject\src\week09>launch.bat

C:\Users\Joe\workspace\TomcatProject\src\week09>setlocal

C:\Users\Joe\workspace\TomcatProject\src\week09>SET TOOLS_HOME=C:\projects\tools\

C:\Users\Joe\workspace\TomcatProject\src\week09>SET TOMCAT_HOME=tomcat\apache-tomcat-8.0.14-windows-x64\apache-tomcat-8.0.14

C:\Users\Joe\workspace\TomcatProject\src\week09>SET JAVA_HOME=C:\Program Files\Java\jdk1.8.0_45

C:\Users\Joe\workspace\TomcatProject\src\week09>SET CATALINA_HOME=C:\projects\tools\tomcat\apache-tomcat-8.0.14-windows-x64\apache-tomcat-8.0.14

C:\Users\Joe\workspace\TomcatProject\src\week09>C:\projects\tools\tomcat\apache-tomcat-8.0.14-windows-x64\apache-tomcat-8.0.14\bin\startup.bat
Using CATALINA_BASE:   "C:\projects\tools\tomcat\apache-tomcat-8.0.14-windows-x64\apache-tomcat-8.0.14"
Using CATALINA_HOME:   "C:\projects\tools\tomcat\apache-tomcat-8.0.14-windows-x64\apache-tomcat-8.0.14"
Using CATALINA_TMPDIR: "C:\projects\tools\tomcat\apache-tomcat-8.0.14-windows-x64\apache-tomcat-8.0.14\temp"
Using JRE_HOME:        "C:\Program Files\Java\jre1.8.0_65"
Using CLASSPATH:       "C:\projects\tools\tomcat\apache-tomcat-8.0.14-windows-x64\apache-tomcat-8.0.14\bin\bootstrap.jar;C:\projects\tools\tomcat\apache-tomcat-8.0.14-windows-x64\apache-tomcat-8.0.14\bin\tomcat-juli.jar"
C:\Users\Joe\workspace\TomcatProject\src\week09>

阅读 319

收藏
2020-06-16

共1个答案

小编典典

自从修改server.xml配置以来,您可能没有停止过Tomcat
。日志文件最初包含成功启动的tomcat,然后由于“绑定失败”而导致几次失败的启动,通常表示tomcat仍在运行。因此,停止它,然后重新启动它,它应该可以工作。

2020-06-16