在使用百度的ueditor的时候,老是报错:

The method getDispatcherType() is undefined for the type HttpServletRequest

原因可能有二:1、是jar冲突了,把servlet-api的jar包直接删了就ok了。

2、tomcat版本低了,升级后就ok。

补充一下,关于第一个原因,我们可以扩展下,如果做java开发的时候,碰到class找不到或者method找不到的错误时,可以使用下面的命令

dependency:tree -Dverbose(如果集成了maven,可以直接使用此命令。如果没有,需要在命令前增加 mvn : mvn dependency:tree -Dverbose)

这样就会得到下面的输出,此时就可以分析哪些jar包冲突以及jvm在运行时加载了哪个class。如果遇到jar包冲突,可以在pom的dependency Hierarchy视图中选择加载jar包,排除

特定版本的jar包。

[INFO] cn.todaycity:web-sf:war:0.0.1-SNAPSHOT
[INFO] +- cn.todaycity:server-data-provider-clients-image:jar:2.0.1.1025:compile
[INFO] | +- com.aliyun.oss:aliyun-sdk-oss:jar:2.2.0:compile
[INFO] | | +- (org.apache.httpcomponents:httpclient:jar:4.4.1:compile - omitted for duplicate)
[INFO] | | +- org.jdom:jdom:jar:1.1:compile
[INFO] | | \- net.sf.json-lib:json-lib:jar:jdk15:2.4:compile
[INFO] | | +- commons-beanutils:commons-beanutils:jar:1.8.0:compile
[INFO] | | | \- (commons-logging:commons-logging:jar:1.1.1:compile - omitted for conflict with 1.2)
[INFO] | | +- commons-collections:commons-collections:jar:3.2.1:compile

[INFO] | | +- (commons-lang:commons-lang:jar:2.5:compile - omitted for conflict with 2.6)
[INFO] | | +- (commons-logging:commons-logging:jar:1.1.1:compile - omitted for conflict with 1.2)

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

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

    配置项目,从tomcat低版本,放到tomcat8时,正常的项目居然报错了: The method getDispatcherType() is undefined for the type Http ...

  2. 升级到tomcat8遇到The method getDispatcherType() is undefined for the type HttpServletRequest

    今天升级到tomcat8,发现原来的项目不能运行了,遇到下面的错误:The method getDispatcherType() is undefined for the type HttpServl ...

  3. The method getDispatcherType() is undefined for the type HttpServletRequest错误解决方法

    使用Eclipse Luna版本,jdk1.7和tomcat8.0开发JAVA EE应用.写一个简单的JSP部署后访问报JSP编译错误,具体错误信息如下: The method getDispatch ...

  4. The method getServletContext() is undefined for the type HttpServletRequest

    request.getServletContext().getRealPath("/") 已经加入了 sun runtime library但是还是提示错误 是因为 写法过时了改成 ...

  5. The method getTextContent() is undefined for the type Node

    eclipse 中 如果加入了 其他了xfire 等其他xml解析包的话,使用org.w3c.dom.Node下的getTextContent()方法会出现The method getTextCont ...

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

    notification 报错the method build() is undefined for the type Notificatin.Builder 这事api版本号太低导致的 Notifi ...

  7. getTextContent()方法会出现The method getTextContent() is undefined for the type Node 提示

    eclipse 中 如果加入了 其他了xfire 等其他xml解析包的话,使用org.w3c.dom.Node下的getTextContent()方法会出现The method getTextCont ...

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

    转自:https://blog.csdn.net/panshoujia/article/details/78203837 持久层(DAO层)下的一个接口 ,eclipse报了一个The method ...

  9. The method getContextPath() is undefined for the type ServletContext

    我出错时,到网上说得是版本问题,我找到对应的包javax-servlet5.1.12.jar,把它删了,居然不报错了,原来是和包servlet-2_5-api.jar冲突了

随机推荐

  1. python 3.x urllib学习

    urllib.request import urllib.request as ur url='http://ie.icoa.cn' user_agent = 'Mozilla/4.0 (compat ...

  2. 向Maven的本地库中添加jar文件

    有时我们要用的 maven 依赖项在官方repo库中找不到,然而我们从其他渠道获得了依赖项中的所有jar文件,本文记录了如何向本地库添加jar文件. 从复杂到简单,有三种方法: 使用 maven 的仓 ...

  3. asp.net ajax 调用后台方法

    js代码 <form id="form1" runat="server"> <script language=javascript type= ...

  4. xampp环境搭建+bugfree

    一.xampp安装 1.下载xampp安装文件,下载地址:http://pan.baidu.com/s/1eSp5wVw 2.上传到Linux服务器,执行赋权并安装(我安装在/opt目录下) 3.安装 ...

  5. winform 多个label绑定一个事件

    1当多个label帮到到一个事件后 private void jiandao_Click(object sender, EventArgs e) { //sender显示的是窗体上接受事件的label ...

  6. apache自带的web监控器配置

    第一:将mod_status模块放开,即去掉httpd.conf中的# 第二:在httpd.conf后面添加下面内容 <Location /server-status> SetHandle ...

  7. 【Java EE 学习 17 上】【dbutils和回调函数】

    一.dbutils的核心就是回调函数,可以说如果没有回调函数的思想,dbutils是不可能被开发出来的. 对于dbutils中的QuryRunner类,向该类的query方法提供不同的参数,可以得到不 ...

  8. JavaScript预解析1

    var 不一定是用来定义局部变量的 jscript的全局变量和局部变量的分界是这样的:                  过程体(包括方法function,对象Object o ={})外的所有变量不 ...

  9. jmeter仅一次控制器

    仅针对 1个线程的 多线程的那个不生效  想实现多次执行某个请求只执行一次 需要设置为单线程 循环次数设置为多次就可以了 

  10. Delphi基本类型--枚举 子界 集合 数组

    [plain] view plain copy <strong>根据枚举定义集合 </strong> TMyColor = (mcBlue, mcRed); TMyColorS ...