有谁在做xml解析的时候遇到这个问题的
Exception in thread "main" java.lang.AbstractMethodError: org.apache.crimson.tree.ElementNode.getTextContent()Ljava/lang/String;
报出错误代码:String name=oneInfos.item(NAME).getChildNodes().item(i).getTextContent(); //调用的都是org.w3c.dom.*中的类
如果调用其他函数则运行正常:
如:oneInfos.item(NAME).getChildNodes().item(i).getNodeValue();
在程序中因为涉及到将xml文件写入文件,使用到XmlDocment类,所以导入了第三方包:import org.apache.crimson.tree.XmlDocument;
如果我把此导入的第三方包去掉 ,程序也运行正常
自我感觉是getTextContent没有调用到正确的对象的方法,可能与导入的包里的冲突了,网上查了下,写没找出问题所在
麻烦大伙看看。。。。
是包冲突,我遇到过