Getting NoSuchMethodError:javax.servlet.ServletContext.getVirtualServerName()

Check all your Maven (or equivalent) dependencies and make sure that you – or most likely another dependency – are not pulling in a pre-3.1 version of the javax.servlet / servlet-api that may be taking precedence over what’s in your Tomcat 8. If you’ve manually deployed, make sure you haven’t manually copied any servlet-api JARs … Read more

Tomcat support for HTTP/2.0?

I’m the HTTP/2 implementer in Jetty, and I watch out other projects implementing HTTP/2. Tomcat’s Mark Thomas has outlined support for HTTP/2 for Tomcat 9. Update Jan 2017: Tomcat 8.5 supports HTTP/2 see @joe-aldrich answer https://stackoverflow.com/a/37889873/2027465 Considering that Servlet 4.0 is going to have as a target HTTP/2 support, and that HTTP/2 support requires ALPN … Read more

403 Access Denied on Tomcat 8 Manager App without prompting for user/password

This may be work. Find the CATALINA_HOME/webapps/manager/META-INF/context.xml file and add the comment markers around the Valve. <Context antiResourceLocking=”false” privileged=”true” > <!– <Valve className=”org.apache.catalina.valves.RemoteAddrValve” allow=”127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1″ /> –> </Context> You can find more details at this page.

Tomcat 8 is not able to handle get request with ‘|’ in query parameters?

This behavior is introduced in all major Tomcat releases: Tomcat 7.0.73, 8.0.39, 8.5.7 To fix, do one of the following: set relaxedQueryChars to allow this character (recommended, see Lincoln’s answer) set requestTargetAllow option (deprecated in Tomcat 8.5) (see Jérémie’s answer). you can downgrade to one of older versions (not recommended – security) Based on changelog, … Read more

Tomcat 8 Maven Plugin for Java 8

Yes you can, In your pom.xml, add the tomcat plugin. (You can use this for both Tomcat 7 and 8): pom.xml <!– Tomcat plugin –> <plugin> <groupId>org.apache.tomcat.maven</groupId> <artifactId>tomcat7-maven-plugin</artifactId> <version>2.2</version> <configuration> <url>http:// localhost:8080/manager/text</url> <server>TomcatServer</server> *(From maven > settings.xml)* <username>*yourtomcatusername*</username> <password>*yourtomcatpassword*</password> </configuration> </plugin> tomcat-users.xml <tomcat-users> <role rolename=”manager-gui”/> <role rolename=”manager-script”/> <user username=”admin” password=”password” roles=”manager-gui,manager-script” /> </tomcat-users> settings.xml (maven … Read more

Tomcat 8 throwing – org.apache.catalina.webresources.Cache.getResource Unable to add the resource

I had the same issue when upgrading from Tomcat 7 to 8: a continuous large flood of log warnings about cache. 1. Short Answer Add this within the Context xml element of your $CATALINA_BASE/conf/context.xml: <!– The default value is 10240 kbytes, even when not added to context.xml. So increase it high enough, until the problem … Read more