[ http://jira.codehaus.org/browse/MNG-1178?page=comments#action_50889 ]
Christian Mouttet commented on MNG-1178:
----------------------------------------
Brett,
to reproduce the bug you can write a simple TestCase like this (initializing
Log4J):
public class SimpleTest extends TestCase {
static {
URL url = AbstractTestCase.class.getResource("/test-log4j.xml");
DOMConfigurator.configure(url);
}
// any tests you like to do ...
}
I have maven-2.0 with surefire-1.4 and junit-3.8.1.
> weird junit classloader issue
> -----------------------------
>
> Key: MNG-1178
> URL: http://jira.codehaus.org/browse/MNG-1178
> Project: Maven 2
> Type: Bug
> Environment: java 1.5, linux
> Reporter: Matthew Pocock
> Assignee: Brett Porter
> Attachments: mng-1178-1.tar.gz
>
>
> In some cases (that I've not narrowed down), I get this exception when doing
> m2 install. The affected projects have no test cases and no dependencies taht
> use JUnit in any way. i can get rid of this exceptino if Junit is added as a
> test scope dependency. It smells like a class loader issue where something
> funkey is going on to make the no-args constructor of UnitTest unavailable
> for chaining from BatteryAssert. Beats me.
> org.apache.maven.plugin.MojoExecutionException: Error executing surefire
> at
> org.apache.maven.test.SurefirePlugin.execute(SurefirePlugin.java:294)
> at
> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:419)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:599)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:546)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:529)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:326)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:152)
> at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:237)
> at org.apache.maven.cli.MavenCli.main(MavenCli.java:251)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:585)
> at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
> at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
> at
> org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
> at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
> Caused by: java.lang.reflect.InvocationTargetException
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:585)
> at org.codehaus.surefire.SurefireBooter.run(SurefireBooter.java:104)
> at
> org.apache.maven.test.SurefirePlugin.execute(SurefirePlugin.java:289)
> ... 16 more
> Caused by: java.lang.reflect.InvocationTargetException
> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> Method)
> at
> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
> at
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
> at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
> at
> org.codehaus.surefire.Surefire.instantiateBatteries(Surefire.java:274)
> at org.codehaus.surefire.Surefire.run(Surefire.java:82)
> at org.codehaus.surefire.Surefire.run(Surefire.java:76)
> ... 22 more
> Caused by: java.lang.IllegalAccessError: tried to access method
> junit.framework.TestCase.<init>()V from class
> org.codehaus.surefire.battery.assertion.BatteryAssert
> at
> org.codehaus.surefire.battery.assertion.BatteryAssert.<init>(BatteryAssert.java:23)
> at
> org.codehaus.surefire.battery.AbstractBattery.<init>(AbstractBattery.java:31)
> at
> org.codehaus.surefire.battery.DirectoryBattery.<init>(DirectoryBattery.java:39)
> ... 29 more
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]