Hi all,
 
    I have been using Log4j for a short while and have now started to introduce it to my EJB development however I am getting an exception when calling PropertyConfigurator with a property file loaded from the system. Here's the exception I'm getting:
 
log4j:ERROR A "org.apache.log4j.RollingFileAppender" object is not assignable to a "org.apache.log4j.Appender" object.
Exception: org.apache.log4j.RollingFileAppender
java.lang.ClassCastException: org.apache.log4j.RollingFileAppender
 at org.apache.log4j.PropertyConfigurator.parseAppender(PropertyConfigurator.java:574)
 at org.apache.log4j.PropertyConfigurator.parseCategory(PropertyConfigurator.java:555)
 at org.apache.log4j.PropertyConfigurator.configureRootCategory(PropertyConfigurator.java:462)
 at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:388)
 at org.apache.log4j.PropertyConfigurator.configure(PropertyConfigurator.java:332)
 
The property file is being loaded ok, but as soon as the property object if passed to the PropertyConfigurator it bombs with the above exception.
The same code works fine outside of an EJB. Has anybody used log4j with EJBs and can help.
 
Thanks in advance.
 
Best Regards,
 
Gareth Powell
 
------------------------------------------------------------------------
Gareth Powell BSc. (Hons)
Java Software Engineer
TriNet IMB Ltd
Orchard House
Castle Garth
Kendal
Cumbria
LA9 7AT
www.trinetimb.com
t : +44 (0) 1539 731000
f : +44 (0) 1539 729995
 
 

Reply via email to