1

Is this expected behaviour? Will the global web.xml not be picked up in the deployment scenario where CATALINA_HOME (tomcat installation) and CATALINA_BASE (webapp home) are not the same?

The relevant log line:

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

The complete startup log. The servlet "default" is not found because it is defined in the global web.xml. <my-app-dir> redacted by me.

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
2
  • Yes, this is expected behaviour if you set -Dcatalina.base and -Dcatalina.home= as command line parameter – Federico Sierra Jul 22 '18 at 21:54
  • Ok, so if I still want the mime types and all that stuff, should I copy and modify the global web.xml? Or is there some other inheritance mechanism available? – Reto Höhener Jul 23 '18 at 11:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.