jmockit / jmockit1

Advanced Java library for integration testing, mocking, faking, and code coverage
Other
465 stars 240 forks source link

Linkage error in JMockit 1.12 #76

Closed svenwaibel closed 10 years ago

svenwaibel commented 10 years ago

Hi,

i got this linkage error since version 1.10. In version 1.9 there is no problem.

Java(TM) SE Runtime Environment (build 1.8.0_20-b26) Java HotSpot(TM) 64-Bit Server VM (build 25.20-b23, mixed mode)

import org.junit.Test;
import mockit.NonStrictExpectations;

public class ToTest{
   @Test
   public void test()  {
      new NonStrictExpectations()  { { } };
   }
}

Error: java.lang.LinkageError: loader (instance of sun/misc/Launcher$AppClassLoader): attempted duplicate class definition for name: "..../ToTest$1" at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:792) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) at java.net.URLClassLoader.defineClass(URLClassLoader.java:449) at java.net.URLClassLoader.access$100(URLClassLoader.java:71) at java.net.URLClassLoader$1.run(URLClassLoader.java:361) at java.net.URLClassLoader$1.run(URLClassLoader.java:355) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:354) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

rliesenfeld commented 10 years ago

Ok, but I can't reproduce the error in my environment, even though running "ToTest" with JDK 1.8.0_20.

svenwaibel commented 10 years ago

Same to me now but just in Idea. I gonna check my gradle environment