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 ...
随机推荐
- BASE64Encoder及BASE64Decoder查看源代码方法
一直以来Base64的加密解密都是使用sun.misc包下的BASE64Encoder及BASE64Decoder的sun.misc.BASE64Encoder/BASE64Decoder类.这人个类 ...
- 2019-8-30-Jenkins-配置自动合并-release-分支到-master-分支
title author date CreateTime categories Jenkins 配置自动合并 release 分支到 master 分支 lindexi 2019-08-30 08:5 ...
- 解决IDEA中,maven依赖不自动补全的问题
转载: 作者:七个榴莲链接:https://www.jianshu.com/p/46a423bdde31来源:简书 遇到的问题:Maven依赖不自动补全 在idea上使用maven插件时,发现在pom ...
- Python 编码转换与中文处理
python 中的 unicode是让人很困惑.比较难以理解的问题. 这篇文章 写的比较好,utf-8是 unicode的一种实现方式,unicode.gbk.gb2312是编码字符集. py文件中的 ...
- HZOI20190722 B visit 组合数+CRT合并
题目:https://www.cnblogs.com/Juve/articles/11226266.html solution: 30%:dp 设dp[k][i][j]表示经过k时间,在(i,j)的方 ...
- 第一章 使用开发者模式快速入门 Odoo 12
本文为最好用的免费ERP系统Odoo 12开发手册系列文章第一篇. Odoo提供了一个快速应用开发框架,非常适合创建商业应用.这类应用通常用于保留业务记录,增删改查操作.Odoo 不仅简化了这类应用的 ...
- ES5-ES8 数组拥有的方法
1.判断是否是数组 Array.isArray( arg ) 有兼容性 2.toString 数组转字符串 arr.toString(); 3.join 数组每一项间的拼接 arr.join(); S ...
- Linux下IP修改后重启服务器 oralce 出错(监听无法启动)
针对linux下修改IP导致的Oracle不能启动问题的解决 主要修改/etc/hosts配置文件.修改前配置: # Do not remove the following line, or vari ...
- Java虚拟机系列(一)---Java内存划分
Java和C++之间有一堵由内存管理和垃圾收集技术所围成的“高墙”,墙外的人想进去,墙内的人却想出来. ------摘自<深入理解Java虚拟机> 作为一个Java程序员,因为虚拟机的好 ...
- 爬虫(四)Selenium + Headless Chrome爬取Bing图片搜索结果
Bing图片搜索结果是动态加载的,如果我们直接用requests去访问页面爬取数据,那我们只能拿到很少的图片.所以我们使用Selenium + Headless Chrome来爬取搜索结果.在开始前, ...