为什么控制台显示tomcat启动成,但打不开localhost:8080

为什么控制台显示tomcat启动成,但打不开localhost:8080

 单独开启tomcat可以访问localhost:8080,但是用idea开启就显示404http://img1.sycdn.imooc.com//climg/5ea546e309bbcb7e04850196.jpg

E:\apache-tomcat-8.5.51\bin\catalina.bat run

[2020-04-26 04:16:12,537] Artifact sm: Waiting for server connection to start artifact deployment...

Using CATALINA_BASE:   "C:\Users\Administrator\.IntelliJIdea2019.3\system\tomcat\Tomcat_8_5_51_sm"

Using CATALINA_HOME:   "E:\apache-tomcat-8.5.51"

Using CATALINA_TMPDIR: "E:\apache-tomcat-8.5.51\temp"

Using JRE_HOME:        "C:\Program Files\Java\jdk1.8.0_101\jre"

Using CLASSPATH:       "E:\apache-tomcat-8.5.51\bin\bootstrap.jar;E:\apache-tomcat-8.5.51\bin\tomcat-juli.jar"

Connected to the target VM, address: '127.0.0.1:52239', transport: 'socket'

26-Apr-2020 16:16:16.265 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log Server.鏈嶅姟鍣ㄧ増鏈�:     Apache Tomcat/8.5.51

26-Apr-2020 16:16:16.276 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log 鏈嶅姟鍣ㄦ瀯寤�:            Feb 5 2020 22:26:25 UTC

26-Apr-2020 16:16:16.276 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log 鏈嶅姟鍣ㄧ増鏈彿(锛�8.5.51.0

26-Apr-2020 16:16:16.277 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name:               Windows 10

26-Apr-2020 16:16:16.277 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log OS.鐗堟湰:               10.0

26-Apr-2020 16:16:16.277 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log 鏋舵瀯:                  amd64

26-Apr-2020 16:16:16.278 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log Java 鐜鍙橀噺:         C:\Program Files\Java\jdk1.8.0_101\jre

26-Apr-2020 16:16:16.278 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log JVM 鐗堟湰:              1.8.0_101-b13

26-Apr-2020 16:16:16.278 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log JVM.渚涘簲鍟�:            Oracle Corporation

26-Apr-2020 16:16:16.278 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE:         C:\Users\Administrator\.IntelliJIdea2019.3\system\tomcat\Tomcat_8_5_51_sm

26-Apr-2020 16:16:16.278 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME:         E:\apache-tomcat-8.5.51

26-Apr-2020 16:16:16.280 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=C:\Users\Administrator\.IntelliJIdea2019.3\system\tomcat\Tomcat_8_5_51_sm\conf\logging.properties

26-Apr-2020 16:16:16.280 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager

26-Apr-2020 16:16:16.281 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:52239,suspend=y,server=n

26-Apr-2020 16:16:16.281 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -javaagent:C:\Users\Administrator\.IntelliJIdea2019.3\system\captureAgent\debugger-agent.jar

26-Apr-2020 16:16:16.281 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dfile.encoding=UTF-8

26-Apr-2020 16:16:16.281 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote=

26-Apr-2020 16:16:16.284 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.port=1099

26-Apr-2020 16:16:16.284 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.ssl=false

26-Apr-2020 16:16:16.285 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.password.file=C:\Users\Administrator\.IntelliJIdea2019.3\system\tomcat\Tomcat_8_5_51_sm\jmxremote.password

26-Apr-2020 16:16:16.285 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.access.file=C:\Users\Administrator\.IntelliJIdea2019.3\system\tomcat\Tomcat_8_5_51_sm\jmxremote.access

26-Apr-2020 16:16:16.285 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.rmi.server.hostname=127.0.0.1

26-Apr-2020 16:16:16.289 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048

26-Apr-2020 16:16:16.291 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources

26-Apr-2020 16:16:16.291 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dignore.endorsed.dirs=

26-Apr-2020 16:16:16.292 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=C:\Users\Administrator\.IntelliJIdea2019.3\system\tomcat\Tomcat_8_5_51_sm

26-Apr-2020 16:16:16.292 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=E:\apache-tomcat-8.5.51

26-Apr-2020 16:16:16.293 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=E:\apache-tomcat-8.5.51\temp

26-Apr-2020 16:16:16.295 淇℃伅 [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Loaded APR based Apache Tomcat Native library [1.2.23] using APR version [1.7.0].

26-Apr-2020 16:16:16.296 淇℃伅 [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].

26-Apr-2020 16:16:16.296 淇℃伅 [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR/OpenSSL閰嶇疆锛歶seAprConnector[false]锛寀seOpenSSL[true]

26-Apr-2020 16:16:16.308 淇℃伅 [main] org.apache.catalina.core.AprLifecycleListener.initializeSSL OpenSSL successfully initialized [OpenSSL 1.1.1c  28 May 2019]

26-Apr-2020 16:16:16.642 淇℃伅 [main] org.apache.coyote.AbstractProtocol.init 鍒濆鍖栧崗璁鐞嗗櫒 ["http-nio-8080"]

26-Apr-2020 16:16:16.689 淇℃伅 [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read

26-Apr-2020 16:16:16.715 淇℃伅 [main] org.apache.catalina.startup.Catalina.load Initialization processed in 1505 ms

26-Apr-2020 16:16:16.793 淇℃伅 [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]

26-Apr-2020 16:16:16.793 淇℃伅 [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.5.51

26-Apr-2020 16:16:18.708 淇℃伅 [localhost-startStop-1] org.apache.jasper.servlet.TldScanner.scanJars 鑷冲皯鏈変竴涓狫AR琚壂鎻忕敤浜嶵LD浣嗗皻鏈寘鍚玊LD銆� 涓烘璁板綍鍣ㄥ惎鐢ㄨ皟璇曟棩蹇楄褰曪紝浠ヨ幏鍙栧凡鎵弿浣嗘湭鍦ㄥ叾涓壘鍒癟LD鐨勫畬鏁碕AR鍒楄〃銆� 鍦ㄦ壂鎻忔湡闂磋烦杩囦笉闇�瑕佺殑JAR鍙互缂╃煭鍚姩鏃堕棿鍜孞SP缂栬瘧鏃堕棿銆�

26-Apr-2020 16:16:18.846 淇℃伅 [main] org.apache.coyote.AbstractProtocol.start 寮�濮嬪崗璁鐞嗗彞鏌刐"http-nio-8080"]

26-Apr-2020 16:16:18.869 淇℃伅 [main] org.apache.catalina.startup.Catalina.start Server startup in 2153 ms

Connected to server

[2020-04-26 04:16:19,135] Artifact sm: Artifact is being deployed, please wait...

26-Apr-2020 16:16:19.462 淇℃伅 [RMI TCP Connection(3)-127.0.0.1] org.apache.jasper.servlet.TldScanner.scanJars 鑷冲皯鏈変竴涓狫AR琚壂鎻忕敤浜嶵LD浣嗗皻鏈寘鍚玊LD銆� 涓烘璁板綍鍣ㄥ惎鐢ㄨ皟璇曟棩蹇楄褰曪紝浠ヨ幏鍙栧凡鎵弿浣嗘湭鍦ㄥ叾涓壘鍒癟LD鐨勫畬鏁碕AR鍒楄〃銆� 鍦ㄦ壂鎻忔湡闂磋烦杩囦笉闇�瑕佺殑JAR鍙互缂╃煭鍚姩鏃堕棿鍜孞SP缂栬瘧鏃堕棿銆�

[2020-04-26 04:16:19,492] Artifact sm: Artifact is deployed successfully

[2020-04-26 04:16:19,492] Artifact sm: Deploy took 357 milliseconds

26-Apr-2020 16:16:28.867 淇℃伅 [localhost-startStop-2] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive [E:\apache-tomcat-8.5.51\webapps\homework6_3.war]

26-Apr-2020 16:16:29.030 淇℃伅 [localhost-startStop-2] org.apache.jasper.servlet.TldScanner.scanJars 鑷冲皯鏈変竴涓狫AR琚壂鎻忕敤浜嶵LD浣嗗皻鏈寘鍚玊LD銆� 涓烘璁板綍鍣ㄥ惎鐢ㄨ皟璇曟棩蹇楄褰曪紝浠ヨ幏鍙栧凡鎵弿浣嗘湭鍦ㄥ叾涓壘鍒癟LD鐨勫畬鏁碕AR鍒楄〃銆� 鍦ㄦ壂鎻忔湡闂磋烦杩囦笉闇�瑕佺殑JAR鍙互缂╃煭鍚姩鏃堕棿鍜孞SP缂栬瘧鏃堕棿銆�

26-Apr-2020 16:16:29.038 淇℃伅 [localhost-startStop-2] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive [E:\apache-tomcat-8.5.51\webapps\homework6_3.war] has finished in [169] ms

26-Apr-2020 16:16:29.039 淇℃伅 [localhost-startStop-2] org.apache.catalina.startup.HostConfig.deployDirectory 鎶妛eb 搴旂敤绋嬪簭閮ㄧ讲鍒扮洰褰� [E:\apache-tomcat-8.5.51\webapps\docs]

26-Apr-2020 16:16:29.196 淇℃伅 [localhost-startStop-2] org.apache.jasper.servlet.TldScanner.scanJars 鑷冲皯鏈変竴涓狫AR琚壂鎻忕敤浜嶵LD浣嗗皻鏈寘鍚玊LD銆� 涓烘璁板綍鍣ㄥ惎鐢ㄨ皟璇曟棩蹇楄褰曪紝浠ヨ幏鍙栧凡鎵弿浣嗘湭鍦ㄥ叾涓壘鍒癟LD鐨勫畬鏁碕AR鍒楄〃銆� 鍦ㄦ壂鎻忔湡闂磋烦杩囦笉闇�瑕佺殑JAR鍙互缂╃煭鍚姩鏃堕棿鍜孞SP缂栬瘧鏃堕棿銆�

26-Apr-2020 16:16:29.200 淇℃伅 [localhost-startStop-2] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [E:\apache-tomcat-8.5.51\webapps\docs] has finished in [160] ms

26-Apr-2020 16:16:29.200 淇℃伅 [localhost-startStop-2] org.apache.catalina.startup.HostConfig.deployDirectory 鎶妛eb 搴旂敤绋嬪簭閮ㄧ讲鍒扮洰褰� [E:\apache-tomcat-8.5.51\webapps\examples]

26-Apr-2020 16:16:29.684 淇℃伅 [localhost-startStop-2] org.apache.jasper.servlet.TldScanner.scanJars 鑷冲皯鏈変竴涓狫AR琚壂鎻忕敤浜嶵LD浣嗗皻鏈寘鍚玊LD銆� 涓烘璁板綍鍣ㄥ惎鐢ㄨ皟璇曟棩蹇楄褰曪紝浠ヨ幏鍙栧凡鎵弿浣嗘湭鍦ㄥ叾涓壘鍒癟LD鐨勫畬鏁碕AR鍒楄〃銆� 鍦ㄦ壂鎻忔湡闂磋烦杩囦笉闇�瑕佺殑JAR鍙互缂╃煭鍚姩鏃堕棿鍜孞SP缂栬瘧鏃堕棿銆�

26-Apr-2020 16:16:29.855 淇℃伅 [localhost-startStop-2] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [E:\apache-tomcat-8.5.51\webapps\examples] has finished in [655] ms

26-Apr-2020 16:16:29.856 淇℃伅 [localhost-startStop-2] org.apache.catalina.startup.HostConfig.deployDirectory 鎶妛eb 搴旂敤绋嬪簭閮ㄧ讲鍒扮洰褰� [E:\apache-tomcat-8.5.51\webapps\host-manager]

26-Apr-2020 16:16:30.011 淇℃伅 [localhost-startStop-2] org.apache.jasper.servlet.TldScanner.scanJars 鑷冲皯鏈変竴涓狫AR琚壂鎻忕敤浜嶵LD浣嗗皻鏈寘鍚玊LD銆� 涓烘璁板綍鍣ㄥ惎鐢ㄨ皟璇曟棩蹇楄褰曪紝浠ヨ幏鍙栧凡鎵弿浣嗘湭鍦ㄥ叾涓壘鍒癟LD鐨勫畬鏁碕AR鍒楄〃銆� 鍦ㄦ壂鎻忔湡闂磋烦杩囦笉闇�瑕佺殑JAR鍙互缂╃煭鍚姩鏃堕棿鍜孞SP缂栬瘧鏃堕棿銆�

26-Apr-2020 16:16:30.021 淇℃伅 [localhost-startStop-2] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [E:\apache-tomcat-8.5.51\webapps\host-manager] has finished in [165] ms

26-Apr-2020 16:16:30.021 淇℃伅 [localhost-startStop-2] org.apache.catalina.startup.HostConfig.deployDirectory 鎶妛eb 搴旂敤绋嬪簭閮ㄧ讲鍒扮洰褰� [E:\apache-tomcat-8.5.51\webapps\manager]

26-Apr-2020 16:16:30.179 淇℃伅 [localhost-startStop-2] org.apache.jasper.servlet.TldScanner.scanJars 鑷冲皯鏈変竴涓狫AR琚壂鎻忕敤浜嶵LD浣嗗皻鏈寘鍚玊LD銆� 涓烘璁板綍鍣ㄥ惎鐢ㄨ皟璇曟棩蹇楄褰曪紝浠ヨ幏鍙栧凡鎵弿浣嗘湭鍦ㄥ叾涓壘鍒癟LD鐨勫畬鏁碕AR鍒楄〃銆� 鍦ㄦ壂鎻忔湡闂磋烦杩囦笉闇�瑕佺殑JAR鍙互缂╃煭鍚姩鏃堕棿鍜孞SP缂栬瘧鏃堕棿銆�

26-Apr-2020 16:16:30.185 淇℃伅 [localhost-startStop-2] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [E:\apache-tomcat-8.5.51\webapps\manager] has finished in [163] ms


正在回答 回答被采纳积分+1

登陆购买课程后可参与讨论,去登陆

1回答
提问者 weixin_慕少0536252 2020-04-26 16:51:21

我把tomcat webapp下的ROOT加入deployment,就行了。但是为什么以前没有这样做,也能访问localhost:8080?

  • 同学你好,可能是idea并没有自动将你的项目打包完整。你可以重新给项目打一下war包测试一下。著学习愉快~
    2020-04-26 19:05:52
问题已解决,确定采纳
还有疑问,暂不采纳

恭喜解决一个难题,获得1积分~

来为老师/同学的回答评分吧

0 星
请稍等 ...
意见反馈 帮助中心 APP下载
官方微信

在线咨询

领取优惠

免费试听

领取大纲

扫描二维码,添加
你的专属老师