gpt4 book ai didi

java - 无法访问部署到 Tomcat 的应用程序

转载 作者:行者123 更新时间:2023-11-28 23:12:27 24 4
gpt4 key购买 nike

我已将 java 应用程序部署到 Tomcat 8.5(它显示在 tomcat 应用程序管理器中)。如果我点击应该打开应用程序的网址,我会出现 404 错误(在该网址下找不到任何内容)。

不同机器上的相同设置(确切的 tomcat 目录)中的相同 .war 可以工作。

所有在本地主机上进行。可能有什么问题,我应该寻找什么?

编辑:

卡特琳娜日志:

18-Apr-2019 11:23:42.830 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version:        Apache Tomcat/8.5.39
18-Apr-2019 11:23:42.833 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built: Mar 14 2019 11:24:26 UTC
18-Apr-2019 11:23:42.833 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server number: 8.5.39.0
18-Apr-2019 11:23:42.833 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name: Windows 10
18-Apr-2019 11:23:42.833 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version: 10.0
18-Apr-2019 11:23:42.833 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture: amd64
18-Apr-2019 11:23:42.834 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home: C:\Program Files\Java\jdk1.8.0_201\jre
18-Apr-2019 11:23:42.834 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version: 1.8.0_201-b09
18-Apr-2019 11:23:42.834 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor: Oracle Corporation
18-Apr-2019 11:23:42.834 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE: C:\apache-tomcat-8.5.39
18-Apr-2019 11:23:42.834 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME: C:\apache-tomcat-8.5.39
18-Apr-2019 11:23:42.836 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=C:\apache-tomcat-8.5.39\conf\logging.properties
18-Apr-2019 11:23:42.836 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
18-Apr-2019 11:23:42.836 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
18-Apr-2019 11:23:42.836 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
18-Apr-2019 11:23:42.836 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dignore.endorsed.dirs=
18-Apr-2019 11:23:42.836 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=C:\apache-tomcat-8.5.39
18-Apr-2019 11:23:42.837 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=C:\apache-tomcat-8.5.39
18-Apr-2019 11:23:42.837 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=C:\apache-tomcat-8.5.39\temp
18-Apr-2019 11:23:42.838 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_201\bin;C:\windows\Sun\Java\bin;C:\windows\system32;C:\windows;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\;C:\windows\System32\OpenSSH\;C:\Program Files\PuTTY\;C:\Program Files\dotnet\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\ManagementStudio\;C:\Program Files\nodejs\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn\;C:\Program Files\Microsoft SQL Server\140\Tools\Binn\;C:\Program Files\Microsoft SQL Server\140\DTS\Binn\;C:\apache-maven-3.6.1-bin\apache-maven-3.6.1\bin;C:\Users\admin\AppData\Local\Microsoft\WindowsApps;.]
18-Apr-2019 11:23:42.941 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
18-Apr-2019 11:23:43.056 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
18-Apr-2019 11:23:43.070 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-8009"]
18-Apr-2019 11:23:43.072 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
18-Apr-2019 11:23:43.073 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 500 ms
18-Apr-2019 11:23:43.096 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
18-Apr-2019 11:23:43.096 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.5.39
18-Apr-2019 11:23:43.111 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive [C:\apache-tomcat-8.5.39\webapps\ProductResearch.war]
18-Apr-2019 11:23:46.783 INFO [localhost-startStop-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.
18-Apr-2019 11:23:47.070 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive [C:\apache-tomcat-8.5.39\webapps\ProductResearch.war] has finished in [3,959] ms
18-Apr-2019 11:23:47.072 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [C:\apache-tomcat-8.5.39\webapps\docs]
18-Apr-2019 11:23:47.096 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [C:\apache-tomcat-8.5.39\webapps\docs] has finished in [24] ms
18-Apr-2019 11:23:47.096 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [C:\apache-tomcat-8.5.39\webapps\examples]
18-Apr-2019 11:23:47.432 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [C:\apache-tomcat-8.5.39\webapps\examples] has finished in [336] ms
18-Apr-2019 11:23:47.433 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [C:\apache-tomcat-8.5.39\webapps\host-manager]
18-Apr-2019 11:23:47.463 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [C:\apache-tomcat-8.5.39\webapps\host-manager] has finished in [30] ms
18-Apr-2019 11:23:47.463 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [C:\apache-tomcat-8.5.39\webapps\manager]
18-Apr-2019 11:23:47.491 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [C:\apache-tomcat-8.5.39\webapps\manager] has finished in [27] ms
18-Apr-2019 11:23:47.491 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [C:\apache-tomcat-8.5.39\webapps\ROOT]
18-Apr-2019 11:23:47.512 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [C:\apache-tomcat-8.5.39\webapps\ROOT] has finished in [21] ms
18-Apr-2019 11:23:47.517 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
18-Apr-2019 11:23:47.525 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-8009"]
18-Apr-2019 11:23:47.528 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 4455 ms

最佳答案

感谢大家的意见。我们弄清楚发生了什么:

应用程序是前端+后端。在创建 war 期间,前端没有正确构建。在不同的机器上,它必须被缓存。当我们单独构建前端时,站点开始工作。

所以这毕竟不是 Tomcat 的问题。我们没有任何文档,所以这是一种反复试验的事情。

关于java - 无法访问部署到 Tomcat 的应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55743313/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com