New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Log4j error when using PowerMockRule - Classloader inconsistencies #272
Comments
From johan.ha...@gmail.com on April 12, 2010 03:43:13 Don't you get the same error when running with the PowerMock runner? |
From loic.lac...@gmail.com on April 12, 2010 03:44:25 Nope |
From johan.ha...@gmail.com on April 12, 2010 03:57:33 Could you help us by providing an example test/project? |
From loic.lac...@gmail.com on April 12, 2010 04:10:26 The test class is instanciated by the PowerMockRunner when used, while when the PowerMockRule is used, the default classloader is used for the test class. My test |
From johan.ha...@gmail.com on April 12, 2010 04:13:27 Could you attach the test and class under test here? |
From loic.lac...@gmail.com on April 12, 2010 05:01:32 I'll try to pinpoint the problem ASAP and post the set of problematic classes. |
From loic.lac...@gmail.com on April 12, 2010 05:23:54 I tried to reduce the problem I spotted to a single class and another problem happens. Attachment: PowerMockIssue.zip |
From johan.ha...@gmail.com on April 12, 2010 05:26:47 The NPE is a known issue which has been resolved in trunk already. Thanks for the zip |
From loic.lac...@gmail.com on April 12, 2010 05:39:55 Here I could reproduce the original issue. Attachment: PowerMockIssue_originalIssue.zip |
From johan.ha...@gmail.com on April 12, 2010 07:10:25 Thanks, hopefully I can have a look at this tomorrow. |
From johan.ha...@gmail.com on April 12, 2010 23:26:24 What error do you get? I get the same print-out when using the PowerMockRunner as Status: Accepted |
From loic.lac...@gmail.com on April 21, 2010 09:12:26 I get a JVM crash |
From loic.lac...@gmail.com on April 12, 2010 11:15:55
What steps will reproduce the problem? 1. Add PowerMockRule to junit test class
2. Remove PowerMockRunner
3. Run the test
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 [org.powermock.core.classloader.MockClassLoader@1b09468]
whereas object of type
log4j:ERROR "org.apache.log4j.xml.DOMConfigurator" was loaded by
[sun.misc.Launcher$AppClassLoader@17172ea].
log4j:ERROR Could not instantiate configurator
[org.apache.log4j.xml.DOMConfigurator].
The problem probably comes from the fact that the test class contains a
logger that is instanciated by the default classloader. It is a limitation
of the new bootstrapper that should be properly documented.
Original issue: http://code.google.com/p/powermock/issues/detail?id=252
The text was updated successfully, but these errors were encountered: