Hi,

I'm new to Log4j. I've written a simple custom Appender which extends FileAppender. 
I'm getting the following error while the DOMConfigurator parses my XML configuration 
file. Could anybody tell me where I'm wrong. 

Would highly appreciate your timely response.

log4j: Class name: [MyAppender]
log4j:ERROR Could not create an Appender. Reported error follows.
java.lang.InstantiationException: MyAppender
        at java.lang.Class.newInstance0(Native Method)
        at java.lang.Class.newInstance(Unknown Source)
        at org.apache.log4j.xml.DOMConfigurator.parseAppender(DOMConfigurator.ja
va:164)
        at org.apache.log4j.xml.DOMConfigurator.findAppenderByName(DOMConfigurat
or.java:140)
        at org.apache.log4j.xml.DOMConfigurator.findAppenderByReference(DOMConfi
gurator.java:153)
        at org.apache.log4j.xml.DOMConfigurator.parseChildrenOfLoggerElement(DOM
Configurator.java:415)
        at org.apache.log4j.xml.DOMConfigurator.parseCategory(DOMConfigurator.ja
va:335)
        at org.apache.log4j.xml.DOMConfigurator.parse(DOMConfigurator.java:788)
        at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java
:673)
        at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java
:616)
        at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java
:584)
        at org.apache.log4j.xml.DOMConfigurator.configure(DOMConfigurator.java:6
94)
        at MyLoggerTest.main(MyLoggerTest.java:62)
log4j:ERROR Could not parse input source [org.xml.sax.InputSource@2808b3].
java.lang.NullPointerException
        at java.util.Hashtable.put(Unknown Source)
        at org.apache.log4j.xml.DOMConfigurator.findAppenderByName(DOMConfigurat
or.java:141)
        at org.apache.log4j.xml.DOMConfigurator.findAppenderByReference(DOMConfi
gurator.java:153)
        at org.apache.log4j.xml.DOMConfigurator.parseChildrenOfLoggerElement(DOM
Configurator.java:415)
        at org.apache.log4j.xml.DOMConfigurator.parseCategory(DOMConfigurator.ja
va:335)
        at org.apache.log4j.xml.DOMConfigurator.parse(DOMConfigurator.java:788)
        at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java
:673)
        at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java
:616)
        at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java
:584)
        at org.apache.log4j.xml.DOMConfigurator.configure(DOMConfigurator.java:6
94)
        at MyLoggerTest.main(MyLoggerTest.java:62)

Thanks & Regards  
Sridharan Vembu


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to