Hi Gareth,
 
Maybe you're running into ClassLoader problems. J2EE product vendors often have
multiple classloaders at work (esp. if they support servlets and dynamic reloading like
BEA's WebLogic). Careful attention to classpaths usually fixes most problems.
 
If you're using BEA's products see the FAQs and newgroup archives online
online (search for ClassLoader).
-----Original Message-----
From: Gareth Powell [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 22, 2001 9:53 AM
To: [EMAIL PROTECTED]
Subject: Please help... (EJBs and Log4j)

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