Приложение Spring при проблеме конфигурации Tomcat - ошибка 404 - PullRequest
1 голос
/ 03 февраля 2020

Мой репозиторий с проектом: https://github.com/mtpx/khn

Я хочу запустить приложение Spring, настроил веб. xml & dispatcher-serlvet. xml и one '/ hello Контроллер. У меня есть локальный Tomcat, связанный с Intelij, но когда я запускаю приложение, в localhost появляется ошибка 404: 8080 / hello

Знаете ли вы, что не так с этим проектом? Почему я не могу добраться до / привет страницы? Я предполагаю, что есть проблема с сетью. xml или диспетчер-сервлет. xml конфигурация. Большое спасибо за любую помощь

Журналы Tomcat:

"C:\Program Files\Apache Software Foundation\Tomcat 8.5\bin\catalina.bat" run
Using CATALINA_BASE:   "C:\Users\mkrasny\.IntelliJIdea2019.1\system\tomcat\Unnamed_khn"
Using CATALINA_HOME:   "C:\Program Files\Apache Software Foundation\Tomcat 8.5"
Using CATALINA_TMPDIR: "C:\Program Files\Apache Software Foundation\Tomcat 8.5\temp"
Using JRE_HOME:        "C:\Program Files\Java\jdk1.8.0_191"
Using CLASSPATH:       "C:\Program Files\Apache Software Foundation\Tomcat 8.5\bin\bootstrap.jar;C:\Program Files\Apache Software Foundation\Tomcat 8.5\bin\tomcat-juli.jar"
03-Feb-2020 13:23:21.985 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version:        Apache Tomcat/8.5.40
03-Feb-2020 13:23:21.986 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built:          Apr 10 2019 14:31:19 UTC
03-Feb-2020 13:23:21.986 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server number:         8.5.40.0
03-Feb-2020 13:23:21.987 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name:               Windows 7
03-Feb-2020 13:23:21.987 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version:            6.1
03-Feb-2020 13:23:21.987 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture:          amd64
03-Feb-2020 13:23:21.987 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home:             C:\Program Files\Java\jdk1.8.0_191\jre
03-Feb-2020 13:23:21.987 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version:           1.8.0_191-b12
03-Feb-2020 13:23:21.987 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor:            Oracle Corporation
03-Feb-2020 13:23:21.987 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE:         C:\Users\mkrasny\.IntelliJIdea2019.1\system\tomcat\Unnamed_khn
03-Feb-2020 13:23:21.987 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME:         C:\Program Files\Apache Software Foundation\Tomcat 8.5
03-Feb-2020 13:23:21.988 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=C:\Users\mkrasny\.IntelliJIdea2019.1\system\tomcat\Unnamed_khn\conf\logging.properties
03-Feb-2020 13:23:21.988 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
03-Feb-2020 13:23:21.988 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote=
03-Feb-2020 13:23:21.988 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.port=1099
03-Feb-2020 13:23:21.988 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.ssl=false
03-Feb-2020 13:23:21.988 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.password.file=C:\Users\mkrasny\.IntelliJIdea2019.1\system\tomcat\Unnamed_khn\jmxremote.password
03-Feb-2020 13:23:21.988 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.access.file=C:\Users\mkrasny\.IntelliJIdea2019.1\system\tomcat\Unnamed_khn\jmxremote.access
03-Feb-2020 13:23:21.988 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.rmi.server.hostname=127.0.0.1
03-Feb-2020 13:23:21.988 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
03-Feb-2020 13:23:21.988 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
03-Feb-2020 13:23:21.988 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dignore.endorsed.dirs=
03-Feb-2020 13:23:21.988 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=C:\Users\mkrasny\.IntelliJIdea2019.1\system\tomcat\Unnamed_khn
03-Feb-2020 13:23:21.989 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=C:\Program Files\Apache Software Foundation\Tomcat 8.5
03-Feb-2020 13:23:21.989 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=C:\Program Files\Apache Software Foundation\Tomcat 8.5\temp
03-Feb-2020 13:23:21.989 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: [C:\Program Files\Java\jdk1.8.0_191\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Program Files\JetBrains\IntelliJ IDEA 2019.1.3\jre64\\bin;C:\Program Files\JetBrains\IntelliJ IDEA 2019.1.3\jre64\\bin\server;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Intel\UCRT\;C:\Program Files\Intel\UCRT\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\AMD\ATI.ACE\Core-Static;C:\Program Files\Java\jdk1.8.0_191\bin\;C:\Program Files (x86)\apache-maven-3.6.1\bin\;C:\Program Files\Git\bin;C:\Program Files\Git\cmd;c:\Program Files\allure-2.12.1\bin\;C:\Program Files\chromedriver;C:\Program Files\MySQL\MySQL Shell 8.0\bin\;.]
03-Feb-2020 13:23:22.078 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
03-Feb-2020 13:23:22.088 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
03-Feb-2020 13:23:22.103 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-8009"]
03-Feb-2020 13:23:22.106 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
03-Feb-2020 13:23:22.106 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 389 ms
03-Feb-2020 13:23:22.121 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
03-Feb-2020 13:23:22.122 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.5.40
03-Feb-2020 13:23:22.128 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
03-Feb-2020 13:23:22.136 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-8009"]
03-Feb-2020 13:23:22.138 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 31 ms
Connected to server
03-Feb-2020 13:23:32.154 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [C:\Program Files\Apache Software Foundation\Tomcat 8.5\webapps\manager]
03-Feb-2020 13:23:32.335 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [C:\Program Files\Apache Software Foundation\Tomcat 8.5\webapps\manager] has finished in [201] ms

1 Ответ

1 голос
/ 03 февраля 2020

Я пропустил

<packaging>war</packaging> 

в pom. xml и настройку вкладки развертывания на сервере Tomcat. Теперь это работает

...