I keep getting a Null Pointer Exception on the Digester parse of the
chain-config.xml.Using Commons Chain 1.1 with the digester jar and beanutils
and logging jars.
1. CatalogLoader.java:
public Catalog getCatalog(String configfile) throws Exception {
ConfigParser parser = new ConfigParser();<== done in Constructor
CatalogLoader()
if (catalog == null) {
URL configFileUrl = FileUtils.findURL("chain-config.xml");//find
this from claspath
//Thread.currentThread().getContextClassLoader().getResource(new
File("chain-config.xml"));
//<== I am able to see the contents of the chain-config.xml
parser.parse(configFileUrl);<== fails here
}
catalog = CatalogFactoryBase.getInstance().getCatalog();
return catalog;
}
2. chain-config.xml:
<?xml version="1.0" ?>
<catalogs>
<catalog name="sentinel">
<chain name="loginProcessor">
<command id="securityEqualsHeaderProcessor" classname="
com.usbank.aid.chain.SecurityEqualsHeaderProcessor"
/>
</chain>
</catalog>
</catalogs>
3. SecurityEqualsHeaderProcessor.java :
public class SecurityEqualsHeaderProcessor implements Command {
private String oldNames;
...
I keep getting a Null Pointer Exception. Here is the stack Trace:
at org.apache.commons.digester.Digester.createSAXException(Digester.java
:3181)
at org.apache.commons.digester.Digester.createSAXException(Digester.java
:3207)
at org.apache.commons.digester.Digester.startElement(Digester.java:1456)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown
Source)
at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.commons.digester.Digester.parse(Digester.java:1745)
at org.apache.commons.chain.config.ConfigParser.parse(ConfigParser.java
:198)
TIA for any help,
Vijay