Skip to content
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

Powermock crashed on JDK 11 b8 (early access build) #904

Closed
Tibor17 opened this issue May 8, 2018 · 1 comment
Closed

Powermock crashed on JDK 11 b8 (early access build) #904

Tibor17 opened this issue May 8, 2018 · 1 comment

Comments

@Tibor17
Copy link

Tibor17 commented May 8, 2018

Our build 1 crashed while running the test 2.
IFAIK similar stacktrace from issue when run PowerMock on JDK 10 few months ago, this issue might be caused with similar root cause due to using new JDK 11.

16:45:37 [linux-jdk11-maven3.5.x] shouldBeDifferentJdk9(org.apache.maven.surefire.booter.SystemUtilsTest$MockTest)  Time elapsed: 1.846 sec  <<< ERROR!
16:45:37 [linux-jdk11-maven3.5.x] org.mockito.exceptions.base.MockitoException: 
16:45:37 [linux-jdk11-maven3.5.x] Mockito cannot mock this class: class org.apache.maven.surefire.booter.SystemUtils.
16:45:37 [linux-jdk11-maven3.5.x] Mockito can only mock non-private & non-final classes.
16:45:37 [linux-jdk11-maven3.5.x] If you're not sure why you're getting this error, please report to the mailing list.
16:45:37 [linux-jdk11-maven3.5.x] Java               : 11
16:45:37 [linux-jdk11-maven3.5.x] JVM vendor name    : "Oracle Corporation"
16:45:37 [linux-jdk11-maven3.5.x] JVM vendor version : 11-ea+8
16:45:37 [linux-jdk11-maven3.5.x] JVM name           : Java HotSpot(TM) 64-Bit Server VM
16:45:37 [linux-jdk11-maven3.5.x] JVM version        : 11-ea+8
16:45:37 [linux-jdk11-maven3.5.x] JVM info           : mixed mode
16:45:37 [linux-jdk11-maven3.5.x] OS name            : Linux
16:45:37 [linux-jdk11-maven3.5.x] OS version         : 4.4.0-112-generic
16:45:37 [linux-jdk11-maven3.5.x] Underlying exception : java.lang.UnsupportedOperationException: Cannot define class using reflection
16:45:37 [linux-jdk11-maven3.5.x] 	at org.apache.maven.surefire.booter.SystemUtilsTest$MockTest.testIsJava9AtLeast(SystemUtilsTest.java:321)
16:45:37 [linux-jdk11-maven3.5.x] 	at org.apache.maven.surefire.booter.SystemUtilsTest$MockTest.shouldBeDifferentJdk9(SystemUtilsTest.java:304)
16:45:37 [linux-jdk11-maven3.5.x] 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
16:45:37 [linux-jdk11-maven3.5.x] 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
16:45:37 [linux-jdk11-maven3.5.x] 	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
16:45:37 [linux-jdk11-maven3.5.x] 	at java.base/java.lang.reflect.Method.invoke(Method.java:569)
16:45:37 [linux-jdk11-maven3.5.x] 	at org.junit.internal.runners.TestMethod.invoke(TestMethod.java:68)
16:45:37 [linux-jdk11-maven3.5.x] 	at org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl$PowerMockJUnit44MethodRunner.runTestMethod(PowerMockJUnit44RunnerDelegateImpl.java:326)
16:45:37 [linux-jdk11-maven3.5.x] 	at org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java:89)
16:45:37 [linux-jdk11-maven3.5.x] 	at org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:97)
16:45:37 [linux-jdk11-maven3.5.x] 	at org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl$PowerMockJUnit44MethodRunner.executeTest(PowerMockJUnit44RunnerDelegateImpl.java:310)
16:45:37 [linux-jdk11-maven3.5.x] 	at org.powermock.modules.junit4.internal.impl.PowerMockJUnit47RunnerDelegateImpl$PowerMockJUnit47MethodRunner.executeTestInSuper(PowerMockJUnit47RunnerDelegateImpl.java:131)
16:45:37 [linux-jdk11-maven3.5.x] 	at org.powermock.modules.junit4.internal.impl.PowerMockJUnit47RunnerDelegateImpl$PowerMockJUnit47MethodRunner.access$100(PowerMockJUnit47RunnerDelegateImpl.java:59)
16:45:37 [linux-jdk11-maven3.5.x] 	at org.powermock.modules.junit4.internal.impl.PowerMockJUnit47RunnerDelegateImpl$PowerMockJUnit47MethodRunner$TestExecutorStatement.evaluate(PowerMockJUnit47RunnerDelegateImpl.java:147)
16:45:37 [linux-jdk11-maven3.5.x] 	at org.powermock.modules.junit4.internal.impl.PowerMockJUnit47RunnerDelegateImpl$PowerMockJUnit47MethodRunner.evaluateStatement(PowerMockJUnit47RunnerDelegateImpl.java:107)
16:45:37 [linux-jdk11-maven3.5.x] 	at org.powermock.modules.junit4.internal.impl.PowerMockJUnit47RunnerDelegateImpl$PowerMockJUnit47MethodRunner.executeTest(PowerMockJUnit47RunnerDelegateImpl.java:82)
16:45:37 [linux-jdk11-maven3.5.x] 	at org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl$PowerMockJUnit44MethodRunner.runBeforesThenTestThenAfters(PowerMockJUnit44RunnerDelegateImpl.java:298)
16:45:37 [linux-jdk11-maven3.5.x] 	at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:87)
16:45:37 [linux-jdk11-maven3.5.x] 	at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:50)
16:45:37 [linux-jdk11-maven3.5.x] 	at org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl.invokeTestMethod(PowerMockJUnit44RunnerDelegateImpl.java:218)
16:45:37 [linux-jdk11-maven3.5.x] 	at org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl.runMethods(PowerMockJUnit44RunnerDelegateImpl.java:160)
16:45:37 [linux-jdk11-maven3.5.x] 	at org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl$1.run(PowerMockJUnit44RunnerDelegateImpl.java:134)
16:45:37 [linux-jdk11-maven3.5.x] 	at org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:34)
16:45:37 [linux-jdk11-maven3.5.x] 	at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:44)
16:45:37 [linux-jdk11-maven3.5.x] 	at org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl.run(PowerMockJUnit44RunnerDelegateImpl.java:136)
16:45:37 [linux-jdk11-maven3.5.x] 	at org.powermock.modules.junit4.common.internal.impl.JUnit4TestSuiteChunkerImpl.run(JUnit4TestSuiteChunkerImpl.java:117)
16:45:37 [linux-jdk11-maven3.5.x] 	at org.powermock.modules.junit4.common.internal.impl.AbstractCommonPowerMockRunner.run(AbstractCommonPowerMockRunner.java:57)
16:45:37 [linux-jdk11-maven3.5.x] 	at org.powermock.modules.junit4.PowerMockRunner.run(PowerMockRunner.java:59)
16:45:37 [linux-jdk11-maven3.5.x] 	at org.junit.runners.Suite.runChild(Suite.java:128)
16:45:37 [linux-jdk11-maven3.5.x] 	at org.junit.runners.Suite.runChild(Suite.java:27)
16:45:37 [linux-jdk11-maven3.5.x] 	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
16:45:37 [linux-jdk11-maven3.5.x] 	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
16:45:37 [linux-jdk11-maven3.5.x] 	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
16:45:37 [linux-jdk11-maven3.5.x] 	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
16:45:37 [linux-jdk11-maven3.5.x] 	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
16:45:37 [linux-jdk11-maven3.5.x] 	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
16:45:37 [linux-jdk11-maven3.5.x] 	at org.junit.runners.Suite.runChild(Suite.java:128)
16:45:37 [linux-jdk11-maven3.5.x] 	at org.junit.runners.Suite.runChild(Suite.java:27)
16:45:37 [linux-jdk11-maven3.5.x] 	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
16:45:37 [linux-jdk11-maven3.5.x] 	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
16:45:37 [linux-jdk11-maven3.5.x] 	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
16:45:37 [linux-jdk11-maven3.5.x] 	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
16:45:37 [linux-jdk11-maven3.5.x] 	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
16:45:37 [linux-jdk11-maven3.5.x] 	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
16:45:37 [linux-jdk11-maven3.5.x] 	at junit.framework.JUnit4TestAdapter.run(JUnit4TestAdapter.java:38)
16:45:37 [linux-jdk11-maven3.5.x] 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
16:45:37 [linux-jdk11-maven3.5.x] 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
16:45:37 [linux-jdk11-maven3.5.x] 	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
16:45:37 [linux-jdk11-maven3.5.x] 	at java.base/java.lang.reflect.Method.invoke(Method.java:569)
16:45:37 [linux-jdk11-maven3.5.x] 	at org.apache.maven.surefire.shadefire.junit.JUnitTestSet.execute(JUnitTestSet.java:95)
16:45:37 [linux-jdk11-maven3.5.x] 	at org.apache.maven.surefire.shadefire.junit.JUnit3Provider.executeTestSet(JUnit3Provider.java:121)
16:45:37 [linux-jdk11-maven3.5.x] 	at org.apache.maven.surefire.shadefire.junit.JUnit3Provider.invoke(JUnit3Provider.java:98)
16:45:37 [linux-jdk11-maven3.5.x] 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
16:45:37 [linux-jdk11-maven3.5.x] 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
16:45:37 [linux-jdk11-maven3.5.x] 	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
16:45:37 [linux-jdk11-maven3.5.x] 	at java.base/java.lang.reflect.Method.invoke(Method.java:569)
16:45:37 [linux-jdk11-maven3.5.x] 	at org.apache.maven.surefire.shadefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
16:45:37 [linux-jdk11-maven3.5.x] 	at org.apache.maven.surefire.shadefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
16:45:37 [linux-jdk11-maven3.5.x] 	at org.apache.maven.surefire.shadefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
16:45:37 [linux-jdk11-maven3.5.x] 	at org.apache.maven.surefire.shadefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:103)
16:45:37 [linux-jdk11-maven3.5.x] 	at org.apache.maven.surefire.shadefire.booter.ForkedBooter.main(ForkedBooter.java:74)
16:45:37 [linux-jdk11-maven3.5.x] Caused by: java.lang.UnsupportedOperationException: Cannot define class using reflection
16:45:37 [linux-jdk11-maven3.5.x] 	at net.bytebuddy.dynamic.loading.ClassInjector$UsingReflection$Dispatcher$Unavailable.defineClass(ClassInjector.java:821)
16:45:37 [linux-jdk11-maven3.5.x] 	at net.bytebuddy.dynamic.loading.ClassInjector$UsingReflection.inject(ClassInjector.java:185)
16:45:37 [linux-jdk11-maven3.5.x] 	at net.bytebuddy.dynamic.loading.ClassLoadingStrategy$Default$InjectionDispatcher.load(ClassLoadingStrategy.java:187)
16:45:37 [linux-jdk11-maven3.5.x] 	at net.bytebuddy.dynamic.TypeResolutionStrategy$Passive.initialize(TypeResolutionStrategy.java:79)
16:45:37 [linux-jdk11-maven3.5.x] 	at net.bytebuddy.dynamic.DynamicType$Default$Unloaded.load(DynamicType.java:4456)
16:45:37 [linux-jdk11-maven3.5.x] 	at org.mockito.internal.creation.bytebuddy.SubclassBytecodeGenerator.mockClass(SubclassBytecodeGenerator.java:121)
16:45:37 [linux-jdk11-maven3.5.x] 	at org.mockito.internal.creation.bytebuddy.TypeCachingBytecodeGenerator$1.call(TypeCachingBytecodeGenerator.java:37)
16:45:37 [linux-jdk11-maven3.5.x] 	at org.mockito.internal.creation.bytebuddy.TypeCachingBytecodeGenerator$1.call(TypeCachingBytecodeGenerator.java:34)
16:45:37 [linux-jdk11-maven3.5.x] 	at net.bytebuddy.TypeCache.findOrInsert(TypeCache.java:138)
16:45:37 [linux-jdk11-maven3.5.x] 	at net.bytebuddy.TypeCache$WithInlineExpunction.findOrInsert(TypeCache.java:346)
16:45:37 [linux-jdk11-maven3.5.x] 	at net.bytebuddy.TypeCache.findOrInsert(TypeCache.java:161)
16:45:37 [linux-jdk11-maven3.5.x] 	at net.bytebuddy.TypeCache$WithInlineExpunction.findOrInsert(TypeCache.java:355)
16:45:37 [linux-jdk11-maven3.5.x] 	at org.mockito.internal.creation.bytebuddy.TypeCachingBytecodeGenerator.mockClass(TypeCachingBytecodeGenerator.java:32)
16:45:37 [linux-jdk11-maven3.5.x] 	at org.mockito.internal.creation.bytebuddy.SubclassByteBuddyMockMaker.createMockType(SubclassByteBuddyMockMaker.java:71)
16:45:37 [linux-jdk11-maven3.5.x] 	at org.mockito.internal.creation.bytebuddy.SubclassByteBuddyMockMaker.createMock(SubclassByteBuddyMockMaker.java:42)
16:45:37 [linux-jdk11-maven3.5.x] 	at org.mockito.internal.creation.bytebuddy.ByteBuddyMockMaker.createMock(ByteBuddyMockMaker.java:25)
16:45:37 [linux-jdk11-maven3.5.x] 	at org.powermock.api.mockito.mockmaker.PowerMockMaker.createMock(PowerMockMaker.java:41)
16:45:37 [linux-jdk11-maven3.5.x] 	at org.mockito.internal.util.MockUtil.createMock(MockUtil.java:35)
16:45:37 [linux-jdk11-maven3.5.x] 	at org.mockito.internal.MockitoCore.mock(MockitoCore.java:65)
16:45:37 [linux-jdk11-maven3.5.x] 	at org.mockito.Mockito.mock(Mockito.java:1821)
16:45:37 [linux-jdk11-maven3.5.x] 	at org.powermock.api.mockito.internal.mockcreation.DefaultMockCreator.createMethodInvocationControl(DefaultMockCreator.java:108)
16:45:37 [linux-jdk11-maven3.5.x] 	at org.powermock.api.mockito.internal.mockcreation.DefaultMockCreator.doCreateMock(DefaultMockCreator.java:61)
16:45:37 [linux-jdk11-maven3.5.x] 	at org.powermock.api.mockito.internal.mockcreation.DefaultMockCreator.createMock(DefaultMockCreator.java:53)
16:45:37 [linux-jdk11-maven3.5.x] 	at org.powermock.api.mockito.internal.mockcreation.DefaultMockCreator.mock(DefaultMockCreator.java:40)
16:45:37 [linux-jdk11-maven3.5.x] 	at org.powermock.api.mockito.PowerMockito.mockStatic(PowerMockito.java:62)
16:45:37 [linux-jdk11-maven3.5.x] 	... 61 more
16:45:37 [linux-jdk11-maven3.5.x] Caused by: java.lang.IllegalStateException: Could not find sun.misc.Unsafe
16:45:37 [linux-jdk11-maven3.5.x] 	at net.bytebuddy.dynamic.loading.ClassInjector$UsingUnsafe$Dispatcher$Disabled.initialize(ClassInjector.java:1357)
16:45:37 [linux-jdk11-maven3.5.x] 	at net.bytebuddy.dynamic.loading.ClassInjector$UsingUnsafe.inject(ClassInjector.java:1193)
16:45:37 [linux-jdk11-maven3.5.x] 	at net.bytebuddy.dynamic.loading.ClassLoadingStrategy$ForUnsafeInjection.load(ClassLoadingStrategy.java:458)
16:45:37 [linux-jdk11-maven3.5.x] 	at net.bytebuddy.dynamic.TypeResolutionStrategy$Passive.initialize(TypeResolutionStrategy.java:79)
16:45:37 [linux-jdk11-maven3.5.x] 	at net.bytebuddy.dynamic.DynamicType$Default$Unloaded.load(DynamicType.java:4456)
16:45:37 [linux-jdk11-maven3.5.x] 	at net.bytebuddy.dynamic.loading.ClassInjector$UsingReflection$Dispatcher$Indirect.make(ClassInjector.java:684)
16:45:37 [linux-jdk11-maven3.5.x] 	at net.bytebuddy.dynamic.loading.ClassInjector$UsingReflection$Dispatcher$CreationAction.run(ClassInjector.java:302)
16:45:37 [linux-jdk11-maven3.5.x] 	at net.bytebuddy.dynamic.loading.ClassInjector$UsingReflection$Dispatcher$CreationAction.run(ClassInjector.java:290)
16:45:37 [linux-jdk11-maven3.5.x] 	at java.base/java.security.AccessController.doPrivileged(Native Method)
16:45:37 [linux-jdk11-maven3.5.x] 	at net.bytebuddy.dynamic.loading.ClassInjector$UsingReflection.<clinit>(ClassInjector.java:70)
16:45:37 [linux-jdk11-maven3.5.x] 	at net.bytebuddy.dynamic.loading.ClassLoadingStrategy$Default$InjectionDispatcher.load(ClassLoadingStrategy.java:184)
16:45:37 [linux-jdk11-maven3.5.x] 	... 83 more
16:45:37 [linux-jdk11-maven3.5.x] Caused by: java.lang.NoSuchMethodException: sun.misc.Unsafe.defineClass(java.lang.String, [B, int, int, java.lang.ClassLoader, java.security.ProtectionDomain)
16:45:37 [linux-jdk11-maven3.5.x] 	at java.base/java.lang.Class.getMethod(Class.java:2067)
16:45:37 [linux-jdk11-maven3.5.x] 	at net.bytebuddy.dynamic.loading.ClassInjector$UsingUnsafe$Dispatcher$CreationAction.run(ClassInjector.java:1260)
16:45:37 [linux-jdk11-maven3.5.x] 	at net.bytebuddy.dynamic.loading.ClassInjector$UsingUnsafe$Dispatcher$CreationAction.run(ClassInjector.java:1248)
16:45:37 [linux-jdk11-maven3.5.x] 	at java.base/java.security.AccessController.doPrivileged(Native Method)
16:45:37 [linux-jdk11-maven3.5.x] 	at net.bytebuddy.dynamic.loading.ClassInjector$UsingUnsafe.<clinit>(ClassInjector.java:1127)
16:45:37 [linux-jdk11-maven3.5.x] 	... 92 more
16:45:37 [linux-jdk11-maven3.5.x] Caused by: java.lang.UnsupportedOperationException: Cannot define class using reflection
16:45:37 [linux-jdk11-maven3.5.x] 	at net.bytebuddy.dynamic.loading.ClassInjector$UsingReflection$Dispatcher$Unavailable.defineClass(ClassInjector.java:821)
16:45:37 [linux-jdk11-maven3.5.x] 	at net.bytebuddy.dynamic.loading.ClassInjector$UsingReflection.inject(ClassInjector.java:185)
16:45:37 [linux-jdk11-maven3.5.x] 	at net.bytebuddy.dynamic.loading.ClassLoadingStrategy$Default$InjectionDispatcher.load(ClassLoadingStrategy.java:187)
16:45:37 [linux-jdk11-maven3.5.x] 	at net.bytebuddy.dynamic.TypeResolutionStrategy$Passive.initialize(TypeResolutionStrategy.java:79)
16:45:37 [linux-jdk11-maven3.5.x] 	at net.bytebuddy.dynamic.DynamicType$Default$Unloaded.load(DynamicType.java:4456)
16:45:37 [linux-jdk11-maven3.5.x] 	at org.mockito.internal.creation.bytebuddy.SubclassBytecodeGenerator.mockClass(SubclassBytecodeGenerator.java:121)
16:45:37 [linux-jdk11-maven3.5.x] 	at org.mockito.internal.creation.bytebuddy.TypeCachingBytecodeGenerator$1.call(TypeCachingBytecodeGenerator.java:37)
16:45:37 [linux-jdk11-maven3.5.x] 	at org.mockito.internal.creation.bytebuddy.TypeCachingBytecodeGenerator$1.call(TypeCachingBytecodeGenerator.java:34)
16:45:37 [linux-jdk11-maven3.5.x] 	at net.bytebuddy.TypeCache.findOrInsert(TypeCache.java:138)
16:45:37 [linux-jdk11-maven3.5.x] 	at net.bytebuddy.TypeCache$WithInlineExpunction.findOrInsert(TypeCache.java:346)
16:45:37 [linux-jdk11-maven3.5.x] 	at net.bytebuddy.TypeCache.findOrInsert(TypeCache.java:161)
16:45:37 [linux-jdk11-maven3.5.x] 	at net.bytebuddy.TypeCache$WithInlineExpunction.findOrInsert(TypeCache.java:355)
16:45:37 [linux-jdk11-maven3.5.x] 	at org.mockito.internal.creation.bytebuddy.TypeCachingBytecodeGenerator.mockClass(TypeCachingBytecodeGenerator.java:32)
16:45:37 [linux-jdk11-maven3.5.x] 	at org.mockito.internal.creation.bytebuddy.SubclassByteBuddyMockMaker.createMockType(SubclassByteBuddyMockMaker.java:71)
16:45:37 [linux-jdk11-maven3.5.x] 	at org.mockito.internal.creation.bytebuddy.SubclassByteBuddyMockMaker.createMock(SubclassByteBuddyMockMaker.java:42)
16:45:37 [linux-jdk11-maven3.5.x] 	at org.mockito.internal.creation.bytebuddy.ByteBuddyMockMaker.createMock(ByteBuddyMockMaker.java:25)
16:45:37 [linux-jdk11-maven3.5.x] 	at org.powermock.api.mockito.mockmaker.PowerMockMaker.createMock(PowerMockMaker.java:41)
16:45:37 [linux-jdk11-maven3.5.x] 	at org.mockito.internal.util.MockUtil.createMock(MockUtil.java:35)
16:45:37 [linux-jdk11-maven3.5.x] 	at org.mockito.internal.MockitoCore.mock(MockitoCore.java:65)
16:45:37 [linux-jdk11-maven3.5.x] 	at org.mockito.Mockito.mock(Mockito.java:1821)
16:45:37 [linux-jdk11-maven3.5.x] 	at org.powermock.api.mockito.internal.mockcreation.DefaultMockCreator.createMethodInvocationControl(DefaultMockCreator.java:108)
16:45:37 [linux-jdk11-maven3.5.x] 	at org.powermock.api.mockito.internal.mockcreation.DefaultMockCreator.doCreateMock(DefaultMockCreator.java:61)
16:45:37 [linux-jdk11-maven3.5.x] 	at org.powermock.api.mockito.internal.mockcreation.DefaultMockCreator.createMock(DefaultMockCreator.java:53)
16:45:37 [linux-jdk11-maven3.5.x] 	at org.powermock.api.mockito.internal.mockcreation.DefaultMockCreator.mock(DefaultMockCreator.java:40)
16:45:37 [linux-jdk11-maven3.5.x] 	at org.powermock.api.mockito.PowerMockito.mockStatic(PowerMockito.java:62)
16:45:37 [linux-jdk11-maven3.5.x] 	... 61 more
16:45:37 [linux-jdk11-maven3.5.x] Caused by: java.lang.IllegalStateException: Could not find sun.misc.Unsafe
16:45:37 [linux-jdk11-maven3.5.x] 	at net.bytebuddy.dynamic.loading.ClassInjector$UsingUnsafe$Dispatcher$Disabled.initialize(ClassInjector.java:1357)
16:45:37 [linux-jdk11-maven3.5.x] 	at net.bytebuddy.dynamic.loading.ClassInjector$UsingUnsafe.inject(ClassInjector.java:1193)
16:45:37 [linux-jdk11-maven3.5.x] 	at net.bytebuddy.dynamic.loading.ClassLoadingStrategy$ForUnsafeInjection.load(ClassLoadingStrategy.java:458)
16:45:37 [linux-jdk11-maven3.5.x] 	at net.bytebuddy.dynamic.TypeResolutionStrategy$Passive.initialize(TypeResolutionStrategy.java:79)
16:45:37 [linux-jdk11-maven3.5.x] 	at net.bytebuddy.dynamic.DynamicType$Default$Unloaded.load(DynamicType.java:4456)
16:45:37 [linux-jdk11-maven3.5.x] 	at net.bytebuddy.dynamic.loading.ClassInjector$UsingReflection$Dispatcher$Indirect.make(ClassInjector.java:684)
16:45:37 [linux-jdk11-maven3.5.x] 	at net.bytebuddy.dynamic.loading.ClassInjector$UsingReflection$Dispatcher$CreationAction.run(ClassInjector.java:302)
16:45:37 [linux-jdk11-maven3.5.x] 	at net.bytebuddy.dynamic.loading.ClassInjector$UsingReflection$Dispatcher$CreationAction.run(ClassInjector.java:290)
16:45:37 [linux-jdk11-maven3.5.x] 	at java.base/java.security.AccessController.doPrivileged(Native Method)
16:45:37 [linux-jdk11-maven3.5.x] 	at net.bytebuddy.dynamic.loading.ClassInjector$UsingReflection.<clinit>(ClassInjector.java:70)
16:45:37 [linux-jdk11-maven3.5.x] 	at net.bytebuddy.dynamic.loading.ClassLoadingStrategy$Default$InjectionDispatcher.load(ClassLoadingStrategy.java:184)
16:45:37 [linux-jdk11-maven3.5.x] 	... 83 more
16:45:37 [linux-jdk11-maven3.5.x] Caused by: java.lang.NoSuchMethodException: sun.misc.Unsafe.defineClass(java.lang.String, [B, int, int, java.lang.ClassLoader, java.security.ProtectionDomain)
16:45:37 [linux-jdk11-maven3.5.x] 	at java.base/java.lang.Class.getMethod(Class.java:2067)
16:45:37 [linux-jdk11-maven3.5.x] 	at net.bytebuddy.dynamic.loading.ClassInjector$UsingUnsafe$Dispatcher$CreationAction.run(ClassInjector.java:1260)
16:45:37 [linux-jdk11-maven3.5.x] 	at net.bytebuddy.dynamic.loading.ClassInjector$UsingUnsafe$Dispatcher$CreationAction.run(ClassInjector.java:1248)
16:45:37 [linux-jdk11-maven3.5.x] 	at java.base/java.security.AccessController.doPrivileged(Native Method)
16:45:37 [linux-jdk11-maven3.5.x] 	at net.bytebuddy.dynamic.loading.ClassInjector$UsingUnsafe.<clinit>(ClassInjector.java:1127)
16:45:37 [linux-jdk11-maven3.5.x] 	... 92 more
@Tibor17
Copy link
Author

Tibor17 commented Jun 13, 2020

This issue was reported in 2018 (version 1.7.x) but now this issue seems to be gone in 2020 (version 2.0.5).

@Tibor17 Tibor17 closed this as completed Jun 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant