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 ...
随机推荐
- ValueError: Variable conv1/weights already exists.
跑TensorFlow程序的过程中出现了错误,解决之后再次跑时,报如下错误: ValueError: Variable conv1/weights already exists, 原因: 这是因为我在 ...
- AIO异步非阻塞学习
Client:客户端 package aio; import java.io.UnsupportedEncodingException; import java.net.InetSocketAddre ...
- List -- 变更列表
1,一些常见的内建函数 L.append # 加一个 L.extend # 加一串 L.insert(index, item) #固定位置插入 L.[index : index] = sequence ...
- LUOGU P1903 [国家集训队]数颜色 / 维护队列
传送门 解题思路 带修莫队,第一次写,其实和普通莫队差不多,就是多了个时间轴,块分n^(2/3)最优,时间复杂度O(n^(5/3)). #include<iostream> #includ ...
- inode学习笔记
在学习文件描述符时会看到有个inode概念,今天学习了一下. 在操作系统里,一个文件对应一个inode,inode存储了该文件相关信息,作用有一点点像内存的指针,通过他可以找到对应位置上的数据,但是i ...
- html如何设置表格单元格内容垂直居中?
父元素设置为表格的单元格元素td,而在表格单元格中的元素设置vertical-align: middle; 对父容器(td)使用:display: table-cell 其内子元素使用:vertica ...
- 使用ssh时报错:Service对象空指针异常
有可能是spring容器不能自动生成service对象,导致空指针异常,常见的情况可能是在service前面加@Service注释
- 高性能非阻塞 Web 服务器 Undertow
Undertow 简介 Undertow是一个用java编写的.灵活的.高性能的Web服务器,提供基于NIO的阻塞和非阻塞API. Undertow的架构是组合式的,可以通过组合各种小型的目的单一的处 ...
- InnoDB: Error number 24 means ‘Too many open files’
一.问题的描述 备份程序 执行前滚的时候报错.(-apply-log) InnoDB: Errornumber 24 means 'Too many open files'. InnoDB: Some ...
- KOA 学习(八) koa-bodyparser
此控件支持Josn,form,text类型 用法 var Koa = require('koa'); var bodyParser = require('koa-bodyparser'); var a ...