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

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 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

The method getDispatcherType() is undefined for the type HttpServletRequest

You’re not supposed to provide Servlet API along with the web application archive if the target runtime already provides the API out the box. Tomcat as being a JSP/Servletcontainer already provides JSP, Servlet and EL APIs out the box. When you provide them along with your webapp anyway, then you may run into classloading conflicts … Read more