Intellij Tomcat启动时显示404

时间:2019-02-25 04:35:01

标签: intellij-idea tomcat8

我正在使用Intellij Ultimate启动简单的服务。该项目的结构如下: enter image description here

我的tomcat配置如下: enter image description here enter image description here

启动时,控制台不会显示任何错误:

        /tmp/apache-tomcat-8.5.38/bin/catalina.sh run
    [2019-02-24 11:24:53,412] Artifact InsbotTomcat:war: Waiting for server connection to start artifact deployment...
    [2019-02-24 11:24:53,412] Artifact web:war exploded: Waiting for server connection to start artifact deployment...
    24-Feb-2019 23:24:54.294 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version:        Apache Tomcat/8.5.38
    24-Feb-2019 23:24:54.296 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built:          Feb 5 2019 11:42:42 UTC
    24-Feb-2019 23:24:54.296 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server number:         8.5.38.0
    24-Feb-2019 23:24:54.296 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name:               Mac OS X
    24-Feb-2019 23:24:54.296 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version:            10.12.6
    24-Feb-2019 23:24:54.296 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture:          x86_64
    24-Feb-2019 23:24:54.296 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home:             /Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home/jre
    24-Feb-2019 23:24:54.296 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version:           1.8.0_201-b09
    24-Feb-2019 23:24:54.296 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor:            Oracle Corporation
    24-Feb-2019 23:24:54.297 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE:         /Users/diyu/Library/Caches/IntelliJIdea2018.3/tomcat/Tomcat_8_5_38_InsbotTomcat
    24-Feb-2019 23:24:54.297 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME:         /private/tmp/apache-tomcat-8.5.38
    24-Feb-2019 23:24:54.297 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=/Users/diyu/Library/Caches/IntelliJIdea2018.3/tomcat/Tomcat_8_5_38_InsbotTomcat/conf/logging.properties
    24-Feb-2019 23:24:54.297 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
    24-Feb-2019 23:24:54.298 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote=
    24-Feb-2019 23:24:54.298 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.port=1099
    24-Feb-2019 23:24:54.300 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.ssl=false
    24-Feb-2019 23:24:54.300 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.password.file=/Users/diyu/Library/Caches/IntelliJIdea2018.3/tomcat/Tomcat_8_5_38_InsbotTomcat/jmxremote.password
    24-Feb-2019 23:24:54.300 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.access.file=/Users/diyu/Library/Caches/IntelliJIdea2018.3/tomcat/Tomcat_8_5_38_InsbotTomcat/jmxremote.access
    24-Feb-2019 23:24:54.300 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.rmi.server.hostname=127.0.0.1
    24-Feb-2019 23:24:54.300 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
    24-Feb-2019 23:24:54.300 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
    24-Feb-2019 23:24:54.300 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dorg.apache.catalina.security.SecurityListener.UMASK=0027
    24-Feb-2019 23:24:54.300 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dignore.endorsed.dirs=
    24-Feb-2019 23:24:54.301 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=/Users/diyu/Library/Caches/IntelliJIdea2018.3/tomcat/Tomcat_8_5_38_InsbotTomcat
    24-Feb-2019 23:24:54.301 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=/tmp/apache-tomcat-8.5.38
    24-Feb-2019 23:24:54.301 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=/tmp/apache-tomcat-8.5.38/temp
    24-Feb-2019 23:24:54.301 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [/Users/diyu/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.]
    24-Feb-2019 23:24:54.457 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
    24-Feb-2019 23:24:54.477 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
    24-Feb-2019 23:24:54.494 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-8009"]
    24-Feb-2019 23:24:54.496 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
    24-Feb-2019 23:24:54.497 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 591 ms
    24-Feb-2019 23:24:54.527 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
    24-Feb-2019 23:24:54.527 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.5.38
    24-Feb-2019 23:24:54.537 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
    24-Feb-2019 23:24:54.548 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-8009"]
    24-Feb-2019 23:24:54.549 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 52 ms
    Connected to server
    [2019-02-24 11:24:55,011] Artifact InsbotTomcat:war: Artifact is being deployed, please wait...
    [2019-02-24 11:24:55,012] Artifact web:war exploded: Artifact is being deployed, please wait...
    24-Feb-2019 23:24:58.220 INFO [RMI TCP Connection(2)-127.0.0.1] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
    [2019-02-24 11:24:58,277] Artifact InsbotTomcat:war: Artifact is deployed successfully
    [2019-02-24 11:24:58,277] Artifact InsbotTomcat:war: Deploy took 3,266 milliseconds
    [2019-02-24 11:24:58,342] Artifact web:war exploded: Artifact is deployed successfully
    [2019-02-24 11:24:58,342] Artifact web:war exploded: Deploy took 3,330 milliseconds
    24-Feb-2019 23:25:04.541 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/private/tmp/apache-tomcat-8.5.38/webapps/manager]
    24-Feb-2019 23:25:04.573 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/private/tmp/apache-tomcat-8.5.38/webapps/manager] has finished in [32] ms

自动打开的页面显示如下:

enter image description here

我还尝试了http://localhost:8080/web_war_exploded/index.html,显示了相同的输出。

Open Module Settings之后,我将配置更改为: enter image description here

它有效。

1 个答案:

答案 0 :(得分:0)

问题可能是部署目录是“ webapps / manager”(/private/tmp/apache-tomcat-8.5.38/webapps/manager)而不是“ webapps”。