The method getTextContent() is undefined ?
晚上下班的时候,把班上写了半截的代码带了回来。结果回到家后出乎意料的是回来的时候将代码导入eclipse后,下面这行代码就直接报错了,显示 getTextContent()未定义 。
((Element) ele.getElementsByTagName( "err_code").item(0 )).getTextContent();
首先想到的是jdk 的版本问题,不可能啊,我昨天才装的jdk 1.6.0_24 , 查看jdk文档 org.w3c.dom.Element, 在其父接口org.w3c.dom.Node 中是有getTextContent() 这个方法,奇了怪了。 google 了一番,才发现项目中xml-apis.jar 其中也有一个 org.w3c.dom.Element, 实际调用中,java 编译器使用了这个类,而没有使用jdk中的类。真相到此大白。
解决方法就需要改一下java 编译器编译顺序。
下面是eclipse 中的截图和修改说明:
这是jre 在 builder path 的最下层,所以编译器没有使用JRE 中的类,这时需要将JRE 的位置网上调节,选择旁边的复选框,然后使用右边的Down 和 Up 按钮 (现在JRE已经在最底层了,所以此时的Down 按钮不可用)就可以调节JRE的位置了。将JRE的位置调到Web APP Library上面 就ok 了。
The method getTextContent() is undefined ?的更多相关文章
- The method getTextContent() is undefined for the type Node
eclipse 中 如果加入了 其他了xfire 等其他xml解析包的话,使用org.w3c.dom.Node下的getTextContent()方法会出现The method getTextCont ...
- getTextContent()方法会出现The method getTextContent() is undefined for the type Node 提示
eclipse 中 如果加入了 其他了xfire 等其他xml解析包的话,使用org.w3c.dom.Node下的getTextContent()方法会出现The method getTextCont ...
- 解决eclipse中org.w3c.dom.Node类老报The method getTextContent() is undefined 问题
http://www.cnblogs.com/itspy007/articles/4431581.html
- The method getDispatcherType() is undefined for the type HttpServletRequest
在使用百度的ueditor的时候,老是报错: The method getDispatcherType() is undefined for the type HttpServletRequest 原 ...
- The method getDispatcherType() is undefined for the type HttpServletRequest 升级到tomcat8(转)
配置项目,从tomcat低版本,放到tomcat8时,正常的项目居然报错了: The method getDispatcherType() is undefined for the type Http ...
- “Uncaught TypeError: Cannot call method 'createChild' of undefined" 问题的解决
Uncaught TypeError: Cannot call method 'createChild' of undefined 我在使用Ext 4.1.1做grid.Panel,然后chrome爆 ...
- sencha touch Ext.Ajax.request 错误 Cannot call method 'request' of undefined 解决方案
凡是Cannot call method '' of undefined 这类错误大部分都可以参照下面的办法来解决 在st中有时候你会发现使用Ext.Ajax.request会出现一下错误: Cann ...
- intelj idea编译项目报错,Error:ajc: The method getDestHost() is undefined
一.问题简述 这两天在idea中引入过aspectJ相关的东西,用到了aspectJ的编译器进行编译时织入. 结果今天在编译一个老项目时,(用到了lombok,lombok的idea插件会在javac ...
- notification 报错the method build() is undefined for the type Notificatin.Builder
notification 报错the method build() is undefined for the type Notificatin.Builder 这事api版本号太低导致的 Notifi ...
随机推荐
- 伸缩布局flex
一.伸缩布局的起源 1.之前我们想要适应不同的浏览器,一般采用的是设置宽度.高度为父级元素的百分比,但是有时候百分比的计算是相当复杂的,加上有时候还有规定的宽度要设置,所以,伸缩布局的出现是我们所急需 ...
- TFS2013 微软源代码管理工具 安装与使用图文教程
最近公司新开发一个项目要用微软的TFS2013进行项目的源代码管理,以前只是用过SVN,从来没有用过TFS,所以在网上百度.谷歌了好一阵子来查看怎么安装和配置,还好花了一天时间总算是初步的搞定了,下面 ...
- 深入浅出 Java Concurrency (1) : J.U.C的整体认识[转]
去年年底有一个Guice的研究计划,可惜由于工作“繁忙”加上实际工作中没有用上导致“无疾而终”,最终只是完成了Guice的初步学习教程,深入的研究没有继续进行下去. 最近一直用的比较多的就是java. ...
- JEECMS8——系列文档
jeecms8 系列文章地址 https://blog.csdn.net/weixin_37490221/article/details/78652035
- 【JAVA】Class.getResource()与ClassLoader.getResource()的区别
转载自:https://blog.csdn.net/qq_33591903/article/details/91444342 Class.getResource()与ClassLoader.getRe ...
- Eclipse使用过程的常见问题:
3-1 "Failed to load the JNI shared library" -jdk 与eclipse位数不一致出现的问题 解决方法: ...
- Mysql指定部分数据同步
一.需求背景 朋友的公司需要每天定时从源端定时同步一部分数据到目标端,库中存在company_id列的表,只将指定的company_id列导入到目标端数据库:存在company_id列的表,将表中所有 ...
- webServices学习一(了解基础和作用。)
一.第一部分 1. 带着几个问题学习: l 什么是WebService? l 它能做什么? l 为什么要学习WebService? l 学习WebService ...
- create_pascal_tf_record.py 生成的record一直为0字节
后面发现这个错误原来是自己Main目录下的train.txt中间没东西
- npm 安装删除模块
npm安装模块 [npm install xxx]利用 npm 安装xxx模块到当前命令行所在目录: [npm install -g xxx]利用npm安装全局模块xxx: 本地安装时将模块写入pac ...