Hi Vijay,
When sending an email to this list please put the relevant commons
component name(s) in the subject line. I've done this for this reply..
On Wed, 2007-08-08 at 15:59 -0700, Vijay Balakrishnan wrote:
> 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)
What version of digester is in your classpath?
The latest release is 1.8, but line 3181 is this one:
return new SAXParseException(error, locator, e);
which shouldn't ever throw a NullPointerException.
I suggest enabling debug-level logging for category
org.apache.commons.digester and sending the last 20 lines or so of the
output to this list too.
Regards,
Simon
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]