晚上下班的时候,把班上写了半截的代码带了回来。结果回到家后出乎意料的是回来的时候将代码导入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 ?的更多相关文章

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

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

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

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

  3. 解决eclipse中org.w3c.dom.Node类老报The method getTextContent() is undefined 问题

    http://www.cnblogs.com/itspy007/articles/4431581.html

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

    在使用百度的ueditor的时候,老是报错: The method getDispatcherType() is undefined for the type HttpServletRequest 原 ...

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

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

  6. “Uncaught TypeError: Cannot call method 'createChild' of undefined" 问题的解决

    Uncaught TypeError: Cannot call method 'createChild' of undefined 我在使用Ext 4.1.1做grid.Panel,然后chrome爆 ...

  7. sencha touch Ext.Ajax.request 错误 Cannot call method 'request' of undefined 解决方案

    凡是Cannot call method '' of undefined 这类错误大部分都可以参照下面的办法来解决 在st中有时候你会发现使用Ext.Ajax.request会出现一下错误: Cann ...

  8. intelj idea编译项目报错,Error:ajc: The method getDestHost() is undefined

    一.问题简述 这两天在idea中引入过aspectJ相关的东西,用到了aspectJ的编译器进行编译时织入. 结果今天在编译一个老项目时,(用到了lombok,lombok的idea插件会在javac ...

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

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

随机推荐

  1. 2018-10-31-C#-7.0-使用下划线忽略使用的变量

    title author date CreateTime categories C# 7.0 使用下划线忽略使用的变量 lindexi 2018-10-31 14:4:9 +0800 2018-10- ...

  2. 2018-10-19-C#-序列类为-xml-可以使用的特性大全

    title author date CreateTime categories C# 序列类为 xml 可以使用的特性大全 lindexi 2018-10-19 9:9:47 +0800 2018-6 ...

  3. 最大似然估计(Maximum likelihood estimation)

    最大似然估计提供了一种给定观察数据来评估模型参数的方法,即:"模型已定,参数未知".简单而言,假设我们要统计全国人口的身高,首先假设这个身高服从服从正态分布,但是该分布的均值与方差 ...

  4. day21 作业

    1.定义MySQL类 1.对象有id.host.port三个属性 2.定义工具create_id,在实例化时为每个对象随机生成id,保证id唯一 3.提供两种实例化方式,方式一:用户传入host和po ...

  5. Spring MVC(二)--Spring MVC登陆实例

    本文通过一个简单的登陆实例实现Spring MVC的流程,同时整合 MyBatis使用,流程是这样的: 1.访问一个URL进入登陆界面 2.输入正确的用户名和密码,成功则进入index页面,否则留在登 ...

  6. 洛谷p1008 三连击

    https://www.luogu.org/problemnew/show/P1008 题目描述 将1,2,3,4,5,6,7,8,9共9个数分成3组,分别组成3个三位数,且使这3个三位数的值构成1: ...

  7. 2019-8-31-C#-程序集数量对软件启动性能的影响

    title author date CreateTime categories C# 程序集数量对软件启动性能的影响 lindexi 2019-08-31 16:55:58 +0800 2018-10 ...

  8. falsh 遮住div 解决方案

    1.修改代码 <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http ...

  9. bzoj 3231 [Sdoi2008]递归数列——矩阵乘法

    题目:https://www.lydsy.com/JudgeOnline/problem.php?id=3231 矩阵乘法裸题. 1018是10^18.别忘了开long long. #include& ...

  10. ES6学习笔记之Symbol

    新的数据类型Symbol 1. 概述 ES5 的对象属性名都是字符串,这容易造成属性名的冲突.比如,你使用了一个他人提供的对象,但又想为这个对象添加新的方法(mixin 模式),新方法的名字就有可能与 ...