You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Keith Rogers <ke...@mouchelparkman.com> on 2004/08/10 10:52:36 UTC

Log4J and JUnit

I've got an application full of logging messages, and I've just started
writing JUnit tests for it. Unfortunately, when I try to use the JUnit
gui, I get the following warnings:

log4j:ERROR A "org.apache.log4j.xml.DOMConfigurator" object is not
assignable to a "org.apache.log4j.spi.Configurator" variable.
log4j:ERROR The class "org.apache.log4j.spi.Configurator" was loaded by

log4j:ERROR [junit.runner.TestCaseClassLoader@1c9e67a] whereas object
of type 
log4j:ERROR "org.apache.log4j.xml.DOMConfigurator" was loaded by
[sun.misc.Launcher$AppClassLoader@1ff5ea7].
log4j:ERROR Could not instantiate configurator
[org.apache.log4j.xml.DOMConfigurator].
log4j:WARN No appenders could be found for logger
(com.mp.aat.exor.ExorDatasource).
log4j:WARN Please initialize the log4j system properly.

Can anyone explain whats going wrong and how I can fix it?

Thanks,

Keith


The information in this e-mail is confidential and intended to be solely for the use of the addressee(s) and may contain copyright and/or legally privileged information.  If you are not the addressee (or responsible for delivery of the message to the addressee) please e-mail us at Postmaster@mouchelparkman.com and delete the message from your computer; copying, distribution, use or disclosure of its contents is strictly prohibited.
As Internet communications are capable of data corruption no responsibility is accepted for changes made to this message after it was sent. For this reason it may be inappropriate to rely on advice contained in any e-mail without obtaining written confirmation of it.
In addition, no liability or responsibility is accepted for viruses and it is your responsibility to scan attachments (if any).
Please note that for business purposes, outgoing and incoming emails from and to the company may be monitored and recorded.

Mouchel Parkman Services Ltd, Registered in England at West Hall, Parvis Road, West Byfleet, Surrey UK KT14 6EZ Registered No : 1686040


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: Log4J and JUnit

Posted by Ceki Gülcü <ce...@qos.ch>.
Keith,

This is a well known problem with a well known solution. Look in the 
archives. In particular, read the junit FAQ.

At 10:52 AM 8/10/2004, Keith Rogers wrote:
>I've got an application full of logging messages, and I've just started
>writing JUnit tests for it. Unfortunately, when I try to use the JUnit
>gui, I get the following warnings:
>
>log4j:ERROR A "org.apache.log4j.xml.DOMConfigurator" object is not
>assignable to a "org.apache.log4j.spi.Configurator" variable.
>log4j:ERROR The class "org.apache.log4j.spi.Configurator" was loaded by
>
>log4j:ERROR [junit.runner.TestCaseClassLoader@1c9e67a] whereas object
>of type
>log4j:ERROR "org.apache.log4j.xml.DOMConfigurator" was loaded by
>[sun.misc.Launcher$AppClassLoader@1ff5ea7].
>log4j:ERROR Could not instantiate configurator
>[org.apache.log4j.xml.DOMConfigurator].
>log4j:WARN No appenders could be found for logger
>(com.mp.aat.exor.ExorDatasource).
>log4j:WARN Please initialize the log4j system properly.
>
>Can anyone explain whats going wrong and how I can fix it?
>
>Thanks,
>
>Keith
>

-- 
Ceki Gülcü

      For log4j documentation consider "The complete log4j manual"
      ISBN: 2970036908 http://www.qos.ch/shop/products/clm_t.jsp  



---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: Log4J and JUnit

Posted by Ceki Gülcü <ce...@qos.ch>.
Hello Keith,

Which version of Junit and log4j are you using? JDK?

At 10:52 AM 8/10/2004, you wrote:
>I've got an application full of logging messages, and I've just started
>writing JUnit tests for it. Unfortunately, when I try to use the JUnit
>gui, I get the following warnings:
>
>log4j:ERROR A "org.apache.log4j.xml.DOMConfigurator" object is not
>assignable to a "org.apache.log4j.spi.Configurator" variable.
>log4j:ERROR The class "org.apache.log4j.spi.Configurator" was loaded by
>
>log4j:ERROR [junit.runner.TestCaseClassLoader@1c9e67a] whereas object
>of type
>log4j:ERROR "org.apache.log4j.xml.DOMConfigurator" was loaded by
>[sun.misc.Launcher$AppClassLoader@1ff5ea7].
>log4j:ERROR Could not instantiate configurator
>[org.apache.log4j.xml.DOMConfigurator].
>log4j:WARN No appenders could be found for logger
>(com.mp.aat.exor.ExorDatasource).
>log4j:WARN Please initialize the log4j system properly.
>
>Can anyone explain whats going wrong and how I can fix it?
>
>Thanks,
>
>Keith

-- 
Ceki Gülcü

      For log4j documentation consider "The complete log4j manual"
      ISBN: 2970036908 http://www.qos.ch/shop/products/clm_t.jsp  



---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org