jmockit / jmockit1

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

Fatal error: processing of -javaagent failed #28

Closed Staanie closed 10 years ago

Staanie commented 10 years ago

Hi,

I get the following stack trace trying to run tests with JMockit:

Ausnahmebedingung in Thread "main"# START NON-TRANSLATABLEjava.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37) at java.lang.reflect.Method.invoke(Method.java:611) at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:335) at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:350) Caused by: java.lang.ClassFormatError: JVMCFRE009 Schnittstellenfeld muss 'public', 'static' oder 'final' sein.; Klasse=org/omg/CORBA/portable/IDLEntity, Offset=198 at com.ibm.oti.vm.VM.findClassOrNull(Native Method) at com.ibm.oti.vm.BootstrapClassLoader.loadClass(BootstrapClassLoader.java:62) at com.ibm.oti.vm.VM.findClassOrNull(Native Method) at com.ibm.oti.vm.BootstrapClassLoader.loadClass(BootstrapClassLoader.java:62) at java.lang.ClassLoader.loadClassHelper(ClassLoader.java:655) at java.lang.ClassLoader.loadClass(ClassLoader.java:644) at java.lang.ClassLoader.loadClassHelper(ClassLoader.java:657) at java.lang.ClassLoader.loadClass(ClassLoader.java:644) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:358) at java.lang.ClassLoader.loadClass(ClassLoader.java:627) at mockit.internal.startup.MockingBridgeFields.createSyntheticFieldsInJREClassToHoldMockingBridges(MockingBridgeFields.java:30) at mockit.internal.startup.Startup.initialize(Startup.java:57) at mockit.internal.startup.Startup.premain(Startup.java:49) ... 6 more

Used to work well with prior versions of JMockit, including 1.9, only changed JMockit version to 1.10. Any ideas why it won't work anymore?

JMockit: 1.10 JRE: WebSphere Application Servers V8.5 JRE (Java 1.7) JUnit: 4.10

rliesenfeld commented 10 years ago

I think this is an incompatibility with the IBM JRE. Although this particular issue could be fixed, the IBM JRE is known to have other problems in its implementation of the java.lang.instrument API, which JMockit uses. So, in the end, the fact is that JMockit cannot run reliably on the IBM JRE.

Staanie commented 10 years ago

We have been using JMockit with the IBM JRE's since almost 3 years now. So far, we did not have too many problems, taken the size of the projects and the number of people working in those into account. Even though we would like to switch to a different JRE, that's not a choice we have. As I said, everything is fine with the JMockit versions prior to 1.10. Since we don't want to get stuck on version 1.9 and benefit from future enhancements we would highly appreciate a fix for that issue.

rliesenfeld commented 10 years ago

Ok, I will see if a solution for this problem can be found.

fw-aaron commented 4 years ago

Bravo @rliesenfeld !