title: Java, java.lang.reflect.InvocationTargetException with Digester parser
body: <p>I've a Java app, working with Lucene and Apache commons Digester to parse a xml collection. After the first item is parsed, I get this error... What does it mean ?</p>
  
  <pre><code>Feb 24, 2011 5:53:16 PM org.apache.commons.digester.Digester endElement
  SEVERE: End event threw exception
  java.lang.reflect.InvocationTargetException
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.apache.commons.beanutils.MethodUtils.invokeMethod(MethodUtils.java:216)
      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 CollectionIndexer.main(CollectionIndexer.java:103)
  Caused by: java.lang.NullPointerException
      at CollectionIndexer.addDocument(CollectionIndexer.java:41)
      ... 20 more
  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 CollectionIndexer.main(CollectionIndexer.java:103)
  Caused by: java.lang.NullPointerException
      at CollectionIndexer.addDocument(CollectionIndexer.java:41)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.apache.commons.beanutils.MethodUtils.invokeMethod(MethodUtils.java:216)
      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
  </code></pre>