Назад | Перейти на главную страницу

Tomcat 8.5: глобальный web.xml не найден (CATALINA_BASE не совпадает с CATALINA_HOME)

Это ожидаемое поведение? Не будет ли глобальный web.xml выбран в сценарии развертывания, где CATALINA_HOME (установка tomcat) и CATALINA_BASE (главная страница webapp) не совпадают?

Соответствующая строка журнала:

22-Jul-2018 20:36:29.504 INFORMATION [localhost-startStop-1] org.apache.catalina.startup.ContextConfig.getDefaultWebXmlFragment No global web.xml found

Полный журнал запуска. Сервлет default не найден, поскольку он определен в глобальном файле web.xml. <my-app-dir> отредактировано мной.

22-Jul-2018 20:36:28.103 INFORMATION [main] org.apache.catalina.startup.VersionLoggerListener.log Server version:        Apache Tomcat/8.5.27
22-Jul-2018 20:36:28.106 INFORMATION [main] org.apache.catalina.startup.VersionLoggerListener.log Server built:          Jan 18 2018 20:12:40 UTC
22-Jul-2018 20:36:28.106 INFORMATION [main] org.apache.catalina.startup.VersionLoggerListener.log Server number:         8.5.27.0
22-Jul-2018 20:36:28.106 INFORMATION [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name:               Linux
22-Jul-2018 20:36:28.106 INFORMATION [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version:            4.4.0-1062-aws
22-Jul-2018 20:36:28.106 INFORMATION [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture:          amd64
22-Jul-2018 20:36:28.106 INFORMATION [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home:             /a/java/jdk1.8_lin64/jre
22-Jul-2018 20:36:28.106 INFORMATION [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version:           1.8.0_162-b12
22-Jul-2018 20:36:28.107 INFORMATION [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor:            Oracle Corporation
22-Jul-2018 20:36:28.107 INFORMATION [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE:         /0/<my-app-dir>/tomcat
22-Jul-2018 20:36:28.107 INFORMATION [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME:         /a/servers/Tomcat8_lin64
22-Jul-2018 20:36:28.110 INFORMATION [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=/0/<my-app-dir>/tomcat/conf/logging.properties
22-Jul-2018 20:36:28.111 INFORMATION [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
22-Jul-2018 20:36:28.111 INFORMATION [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.awt.headless=true
22-Jul-2018 20:36:28.111 INFORMATION [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
22-Jul-2018 20:36:28.111 INFORMATION [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
22-Jul-2018 20:36:28.112 INFORMATION [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xms256m
22-Jul-2018 20:36:28.112 INFORMATION [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xmx256m
22-Jul-2018 20:36:28.112 INFORMATION [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dignore.endorsed.dirs=
22-Jul-2018 20:36:28.112 INFORMATION [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=/0/<my-app-dir>/tomcat
22-Jul-2018 20:36:28.112 INFORMATION [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=/a/servers/Tomcat8_lin64
22-Jul-2018 20:36:28.113 INFORMATION [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=/0/<my-app-dir>/tomcat/temp
22-Jul-2018 20:36:28.619 INFORMATION [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8780"]
22-Jul-2018 20:36:28.654 INFORMATION [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
22-Jul-2018 20:36:28.671 INFORMATION [main] org.apache.catalina.startup.Catalina.load Initialization processed in 839 ms
22-Jul-2018 20:36:28.687 INFORMATION [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
22-Jul-2018 20:36:28.687 INFORMATION [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.5.27
22-Jul-2018 20:36:28.769 INFORMATION [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive [/0/<my-app-dir>/tomcat/webapps/ROOT.war]
22-Jul-2018 20:36:29.504 INFORMATION [localhost-startStop-1] org.apache.catalina.startup.ContextConfig.getDefaultWebXmlFragment No global web.xml found
22-Jul-2018 20:36:29.806 SCHWERWIEGEND [localhost-startStop-1] org.apache.catalina.core.ContainerBase.addChildInternal ContainerBase.addChild: start: 
 org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[]]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:752)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:728)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734)
    at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:986)
    at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1857)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalArgumentException: Servlet mapping specifies an unknown servlet name [default]
    at org.apache.catalina.core.StandardContext.addServletMappingDecoded(StandardContext.java:3155)
    at org.apache.catalina.core.StandardContext.addServletMappingDecoded(StandardContext.java:3145)
    at org.apache.catalina.startup.ContextConfig.configureContext(ContextConfig.java:1376)
    at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1190)
    at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:775)
    at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:299)
    at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:94)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5105)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    ... 10 more