The method getDispatcherType() is undefined for the type HttpServletRequest

web项目访问时就报错,新建的一个jsp文件里面没有任何的内容也报错,错误:The method getDispatcherType() is undefined for the type HttpServletRequest

严重: Servlet.service() for servlet [jsp] in context with path [/studentManage] threw exception [Unable to compile class for JSP:

An error occurred at line: [44] in the generated java file: [D:\Tomcat8.0\apache-tomcat-8.0.12\work\Catalina\localhost\studentManage\org\apache\jsp\login_jsp.java]

Stacktrace:] with root cause

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

An error occurred at line: [44] in the generated java file: [D:\Tomcat8.0\apache-tomcat-8.0.12\work\Catalina\localhost\studentManage\org\apache\jsp\login_jsp.java]

Stacktrace:

at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:103)

at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:199)

at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:446)

at org.apache.jasper.compiler.Compiler.compile(Compiler.java:361)

at org.apache.jasper.compiler.Compiler.compile(Compiler.java:336)

at org.apache.jasper.compiler.Compiler.compile(Compiler.java:323)

at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:564)

at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357)

at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:391)

at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:335)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

at com.dw.filter.EncodingFilter.doFilter(EncodingFilter.java:33)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)

at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)

at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)

at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)

at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:610)

at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)

at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:534)

at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1081)

at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:658)

at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:277)

at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2381)

at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2370)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)

at java.lang.Thread.run(Thread.java:745)

从表面报错的来看就是HttpServletRequest没有你的这个方法,我查了下,这个方法在这个类中javax.servlet.ServletRequestWrapper。

但是在该页面上什么都没有,试了老半天还是不知道哪儿出错,最后换了一下tomcat运行,可以了。

原来的tomcat是8.0版本的,换了7的,虽然决解了,但还是不知道为什么,以前的tomcat用了大半年没出过任何的问题。

望大神解释下。

时间: 2024-09-28 19:37:53

The method getDispatcherType() is undefined for the type HttpServletRequest的相关文章

Tomcat6服务端工程部署Tomcat8遇到的 “The method getDispatcherType() is undefined for the type HttpServletRequest” 问题

一个安卓服务端程序起初部署在Tomcat6.0当中,但是当我用Tomcat8.0部署时,出现了一个错误: org.apache.jasper.JasperException: Unable to compile class for JSP: An error occurred at line: [52] in the generated java file: [D:\apache-tomcat-8.0.15\work\Catalina\localhost\allRunServer\org\apa

The method getDispatcherType() is undefined for the type HttpServletRequest 升级到tomcat8(转)

配置项目,从tomcat低版本,放到tomcat8时,正常的项目居然报错了: The method getDispatcherType() is undefined for the type HttpServletRequest 从网上查资料,找可能出现这个问题的因素: 1可能是环境变量,检查了没问题 2有人说jar包冲突 对于servlet-api.jar这个包,原来工程中有,在旧的tomcat版本中,如果不加,会出问题,新的版本中加了会有问题,删除这个包,重启,ok http://blog.

日常问题记录--访问JSP文件时The method getDispatcherType() is undefined for the type HttpServletRequest

问题现象: 访问任一jsp(即使是空白文件)文件报The method getDispatcherType() is undefined for the type HttpServletRequest错误. 定位: 根据错误提示,查询到getDispatcher位于servlet-api.jar包中. 反编译tomcat/webapp/proj/lib中的servelt-api.jar,发现确实没有这个方法: 问题解决: 清理这个包,删除之,并升级到最新的servelt-api包.解决:

The method getTextContent() is undefined for the type Node

The method getTextContent() is undefined for the type Node eclipse 中 如果加入了 其他了xfire 等其他xml解析包的话,使用org.w3c.dom.Node下的getTextContent()方法会出现The method getTextContent() is undefined for the type Node 提示,解决方法如下: project-->properties->java build path-->

The method getTextContent() is undefined for the type Element

使用org.w3c.dom解析XML,有时可能会报错The method getTextContent() is undefined for the type Element/Node,这种情况可能是加入了其他的XML解析jar包. 解决方法如下: 将Project->Properties->Java Build Path->Order and Export->JRE System Library移动到顶部(Top)

dao 接口定义了一个方法,报错 The method xxx is undefined for the type xxx;

转自:https://blog.csdn.net/panshoujia/article/details/78203837 持久层(DAO层)下的一个接口 ,eclipse报了一个The method xxx  is undefined for the type xxxx,以为方法的参数类型有误,找来找去也没有发现参数或者参数类型错误,结果重新将整个project  clear一下,重新启动AliTomcat就可以. 原文地址:https://www.cnblogs.com/sharpest/p/

notification 报错the method build() is undefined for the type Notificatin.Builder

这事api版本太低导致的 Notifica没有builder方法,解决方案,将项目api调整到 17 ok.

The method getTextContent()is undefined for...编译出错

在build项目中出现了The method getTextContent() is undefined for the type Element 的错误, 原因是 本来调用的那个方法应该是jdk下的那个包里的类,而在web项目里却调用了J2EE里的xml-apis.jar下的org.w3c.dom.(实际上要 调用的那个方法是在jdk下的rt.jar下的org.w3c.dom). 解决方法 尝试了很多次.后来把jdk和J2EE在项目里的位置调整了下就好 了,即让jdk在J2EE上面. buil

The method getJspApplicationContext(ServletContext) is undefined for the type JspFactory

An error occurred at line: 23 in the generated java file The method getJspApplicationContext(ServletContext) is undefined for the type JspFactory Stacktrace: org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:92) org.a