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 caused by duplicate different versioned classes in the runtime classpath coming from both the webapp and the server.

Add <scope>provided</scope> to those dependencies already provided by the target runtime.

See also:

Leave a Comment