When starting up Tomcat, it fails with the following exception: [...] Caused by: java.lang.NoSuchMethodError: 'java.lang.String javax.servlet.ServletContext.getVirtualServerName()' at org.apache.catalina.authenticator.AuthenticatorBase.startInternal(Unknown Source) ... 48 more [...] When looking at the classpath, I found this: $ java-config --with-dependencies --classpath tomcat-9 //usr/share/tomcat-9/bin/bootstrap.jar://usr/share/tomcat-9/bin/tomcat-juli.jar://usr/share/tomcat-9/lib/annotations-api.jar://usr/share/tomcat-9/lib/catalina-ant.jar://usr/share/tomcat-9/lib/catalina-ha.jar://usr/share/tomcat-9/lib/catalina-ssi.jar://usr/share/tomcat-9/lib/catalina-storeconfig.jar://usr/share/tomcat-9/lib/catalina-tribes.jar://usr/share/tomcat-9/lib/catalina.jar://usr/share/tomcat-9/lib/jasper-el.jar://usr/share/tomcat-9/lib/jasper.jar://usr/share/tomcat-9/lib/jaspic-api.jar://usr/share/tomcat-9/lib/tomcat-api.jar://usr/share/tomcat-9/lib/tomcat-coyote.jar://usr/share/tomcat-9/lib/tomcat-i18n-cs.jar://usr/share/tomcat-9/lib/tomcat-i18n-de.jar://usr/share/tomcat-9/lib/tomcat-i18n-es.jar://usr/share/tomcat-9/lib/tomcat-i18n-fr.jar://usr/share/tomcat-9/lib/tomcat-i18n-ja.jar://usr/share/tomcat-9/lib/tomcat-i18n-ko.jar://usr/share/tomcat-9/lib/tomcat-i18n-pt-BR.jar://usr/share/tomcat-9/lib/tomcat-i18n-ru.jar://usr/share/tomcat-9/lib/tomcat-i18n-zh-CN.jar://usr/share/tomcat-9/lib/tomcat-jni.jar://usr/share/tomcat-9/lib/tomcat-util-scan.jar://usr/share/tomcat-9/lib/tomcat-util.jar://usr/share/tomcat-9/lib/tomcat-websocket.jar://usr/share/tomcat-9/lib/websocket-api.jar://usr/share/eclipse-ecj-4.13/lib/ecj.jar://usr/share/glassfish-xmlrpc-api/lib/glassfish-xmlrpc-api.jar://usr/share/tomcat-servlet-api-4.0/lib/el-api.jar://usr/share/tomcat-servlet-api-4.0/lib/jsp-api.jar://usr/share/tomcat-servlet-api-4.0/lib/servlet-api.jar://usr/share/wsdl4j/lib/qname.jar://usr/share/wsdl4j/lib/wsdl4j.jar://usr/share/tomcat-servlet-api-3.0/lib/el-api.jar://usr/share/tomcat-servlet-api-3.0/lib/jsp-api.jar://usr/share/tomcat-servlet-api-3.0/lib/servlet-api.jar://usr/share/ant-core/lib/ant.jar://usr/share/ant-core/lib/ant-bootstrap.jar://usr/share/ant-core/lib/ant-launcher.jar Please notice that it's got both servlet-api-3.0 and servlet-api-4.0 in the classpath. servlet-api-3.0 is too old and lacks the method the exception from the beginning complained about. After removing glassish-xmlrpc-api from /usr/share/tomcat-9/package.env's DEPEND, Tomcat starts fine. Reproducible: Always
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f522301ac5f180ffb2a30b4c4009bc246f8f207c commit f522301ac5f180ffb2a30b4c4009bc246f8f207c Author: Robert Siebeck <gentoo.2019@r123.de> AuthorDate: 2020-11-19 17:19:16 +0000 Commit: Patrice Clement <monsieurp@gentoo.org> CommitDate: 2020-11-23 21:32:33 +0000 www-servers/tomcat: move glassfish-xmlrpc-api from DEPEND into BUILD_DEPEND in package.env. Closes: https://bugs.gentoo.org/755584 Signed-off-by: Robert Siebeck <gentoo.2019@r123.de> Closes: https://github.com/gentoo/gentoo/pull/18325 Signed-off-by: Patrice Clement <monsieurp@gentoo.org> www-servers/tomcat/tomcat-9.0.38-r1.ebuild | 187 +++++++++++++++++++++++++++++ 1 file changed, 187 insertions(+)