显示java.lang.NullPointerException ..是与XML相关的文件结构?

我卡在以下运行时错误。 我运行它读取XML文件作为输入代码,这是代码:http://pastie.org/1617011。 XML:http://pastie.org/1617014

Feb 28, 2011 4:07:29 PM org.apache.commons.digester.Digester peek WARNING: Empty stack (returning null) Feb 28, 2011 4:07:29 PM org.apache.commons.digester.Digester endElement SEVERE: End event threw exception java.lang.NullPointerException at org.apache.commons.beanutils.MethodUtils.invokeMethod(MethodUtils.java:209) at org.apache.commons.digester.SetNextRule.end(SetNextRule.java:220) at org.apache.commons.digester.Rule.end(Rule.java:257) at org.apache.commons.digester.Digester.endElement(Digester.java:1345) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:601) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1782) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2938) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205) at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522) at org.apache.commons.digester.Digester.parse(Digester.java:1871) at QueryPerformer.main(QueryPerformer.java:127) Exception in thread "main" java.lang.NullPointerException at org.apache.commons.digester.Digester.createSAXException(Digester.java:3363) at org.apache.commons.digester.Digester.createSAXException(Digester.java:3389) at org.apache.commons.digester.Digester.endElement(Digester.java:1348) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:601) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1782) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2938) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205) at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522) at org.apache.commons.digester.Digester.parse(Digester.java:1871) at QueryPerformer.main(QueryPerformer.java:127) Caused by: java.lang.NullPointerException at org.apache.commons.beanutils.MethodUtils.invokeMethod(MethodUtils.java:209) at org.apache.commons.digester.SetNextRule.end(SetNextRule.java:220) at org.apache.commons.digester.Rule.end(Rule.java:257) at org.apache.commons.digester.Digester.endElement(Digester.java:1345) ... 12 more

--------------解决方案-------------

你肯定想在解析器配置设置来创建一个QueryDoc到返回的对象转换为QueryPerformer时,你是正确的? 此外,似乎传递到addSetNext该方法是指在QueryPerformer,不QueryDoc的方法,这是堆栈跟踪似乎什么在以及被指向。

分类:java的 时间:2015-03-15 人气:1
本文关键词: java的
分享到:

相关文章

Copyright (C) 55228885.com, All Rights Reserved.

55228885 版权所有 京ICP备15002868号

processed in 0.358 (s). 10 q(s)