Project start times wrong:
The method Getjspapplicationcontext (ServletContext) is undefined for the type jspfactory
Stacktrace:] with root cause
Org.apache.jasper.JasperException:Unable to compile class for JSP:
An error occurred on line: [+] In the generated Java file: [E:\digdeep2\.metadata\.plugins\org.eclipse.wst.server.core\t Mp0\work\catalina\localhost\minisns\org\apache\jsp\index_jsp.java]
The method Getjspapplicationcontext (ServletContext) is undefined for the type jspfactory
Stacktrace:
At Org.apache.jasper.compiler.DefaultErrorHandler.javacError (defaulterrorhandler.java:103)
At Org.apache.jasper.compiler.ErrorDispatcher.javacError (errordispatcher.java:366)
At Org.apache.jasper.compiler.JDTCompiler.generateClass (jdtcompiler.java:468)
At Org.apache.jasper.compiler.Compiler.compile (compiler.java:378)
At Org.apache.jasper.compiler.Compiler.compile (compiler.java:353)
At Org.apache.jasper.compiler.Compiler.compile (compiler.java:340)
At Org.apache.jasper.JspCompilationContext.compile (jspcompilationcontext.java:657)
At Org.apache.jasper.servlet.JspServletWrapper.service (jspservletwrapper.java:357)
At Org.apache.jasper.servlet.JspServlet.serviceJspFile (jspservlet.java:390)
At Org.apache.jasper.servlet.JspServlet.service (jspservlet.java:334)
At Javax.servlet.http.HttpServlet.service (httpservlet.java:728)
At Org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (applicationfilterchain.java:305)
At Org.apache.catalina.core.ApplicationFilterChain.doFilter (applicationfilterchain.java:210)
At Org.apache.tomcat.websocket.server.WsFilter.doFilter (wsfilter.java:52)
At Org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (applicationfilterchain.java:243)
At Org.apache.catalina.core.ApplicationFilterChain.doFilter (applicationfilterchain.java:210)
At Org.apache.catalina.core.StandardWrapperValve.invoke (standardwrappervalve.java:222)
At Org.apache.catalina.core.StandardContextValve.invoke (standardcontextvalve.java:123)
At Org.apache.catalina.authenticator.AuthenticatorBase.invoke (authenticatorbase.java:502)
At Org.apache.catalina.core.StandardHostValve.invoke (standardhostvalve.java:171)
At Org.apache.catalina.valves.ErrorReportValve.invoke (errorreportvalve.java:100)
At Org.apache.catalina.valves.AccessLogValve.invoke (accesslogvalve.java:953)
At Org.apache.catalina.core.StandardEngineValve.invoke (standardenginevalve.java:118)
At Org.apache.catalina.connector.CoyoteAdapter.service (coyoteadapter.java:409)
At Org.apache.coyote.http11.AbstractHttp11Processor.process (abstracthttp11processor.java:1044)
At Org.apache.coyote.abstractprotocol$abstractconnectionhandler.process (abstractprotocol.java:607)
At Org.apache.tomcat.util.net.jioendpoint$socketprocessor.run (jioendpoint.java:313)
At Java.util.concurrent.ThreadPoolExecutor.runWorker (threadpoolexecutor.java:1145)
At Java.util.concurrent.threadpoolexecutor$worker.run (threadpoolexecutor.java:615)
At Java.lang.Thread.run (thread.java:744)
The reason: The project automatically servlet-api and Tomcat Servlet-api conflict,
Workaround:
To include the scope option in the Pom.xml file:
<dependency> <groupId>javax.servlet</groupId> <artifactid>servlet-api</ artifactid> <version>2.4</version> <scope>provided</scope> </ Dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jsp-api</artifactId>
<version>2.0</version>
<scope>provided</scope>
</dependency>
Org.apache.jasper.JasperException:Unable to compile class for JSP