"org.apache.jasper.JasperException: Unable to compile class for JSP" exception while accessing the application

Solution Verified - Updated -

Issue

We are using Tomcat 8 component. When we access the application, we are getting below exception:

exception

org.apache.jasper.JasperException: Unable to compile class for JSP: 

An error occurred at line: [63] in the generated java file: [/opt/middleware/tomcat/instances/cloudapp/work/Catalina/localhost/rde-14a-automation/org/apache/jsp/home_jsp.java]
The method getDispatcherType() is undefined for the type HttpServletRequest

Stacktrace:
    org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:102)
    org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:198)
    org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:450)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:361)

We have two Tomcat nodes, on other tomcat node the same war file is working absolutely fine. Therefore it does not look like an issue with application. The Dev team suspect that it is Tomcat issue.

Environment

OS Version: RHEL 7.5, 3.10.0-862.6.3.el7.x86_64

Java Version:
java version "1.8.0_171"
Java(TM) SE Runtime Environment (build 1.8.0_171-b25)
Java HotSpot(TM) 64-Bit Server VM (build 25.171-b25, mixed mode)

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content