java.lang.IllegalArgumentException

Can not set final [Lorg.powermock.core.spi.PowerMockPolicy; field org.powermock.tests.utils.impl.MockPolicyInitializerImpl.mockPolicies to [Lorg.powermock.core.spi.PowerMockPolicy;

Samebug tips0

We couldn't find tips for this exception.

Don't give up yet. Paste your full stack trace to get a solution.

Solutions on the web515

Stack trace

  • java.lang.IllegalArgumentException: Can not set final [Lorg.powermock.core.spi.PowerMockPolicy; field org.powermock.tests.utils.impl.MockPolicyInitializerImpl.mockPolicies to [Lorg.powermock.core.spi.PowerMockPolicy; at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:167) at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:171) at sun.reflect.UnsafeQualifiedObjectFieldAccessorImpl.set(UnsafeQualifiedObjectFieldAccessorImpl.java:83) at java.lang.reflect.Field.set(Field.java:764) at org.powermock.classloading.DeepCloner.cloneFields(DeepCloner.java:257) at org.powermock.classloading.DeepCloner.performClone(DeepCloner.java:128) at org.powermock.classloading.DeepCloner.cloneFields(DeepCloner.java:248) at org.powermock.classloading.DeepCloner.performClone(DeepCloner.java:128) at org.powermock.classloading.DeepCloner.cloneFields(DeepCloner.java:248) at org.powermock.classloading.DeepCloner.performClone(DeepCloner.java:128) at org.powermock.classloading.DeepCloner.cloneFields(DeepCloner.java:248) at org.powermock.classloading.DeepCloner.performClone(DeepCloner.java:128) at org.powermock.classloading.DeepCloner.cloneFields(DeepCloner.java:248) at org.powermock.classloading.DeepCloner.performClone(DeepCloner.java:128) at org.powermock.classloading.DeepCloner.cloneFields(DeepCloner.java:248) at org.powermock.classloading.DeepCloner.performClone(DeepCloner.java:128) at org.powermock.classloading.DeepCloner.cloneFields(DeepCloner.java:248) at org.powermock.classloading.DeepCloner.performClone(DeepCloner.java:128) at org.powermock.classloading.DeepCloner.clone(DeepCloner.java:82) at org.powermock.classloading.DeepCloner.clone(DeepCloner.java:69) at org.powermock.classloading.ClassloaderExecutor.execute(ClassloaderExecutor.java:89) at org.powermock.classloading.ClassloaderExecutor.execute(ClassloaderExecutor.java:78) at org.powermock.modules.junit4.rule.PowerMockStatement.evaluate(PowerMockRule.java:57) at org.robolectric.RobolectricTestRunner$2.evaluate(RobolectricTestRunner.java:265) at org.robolectric.RobolectricTestRunner.runChild(RobolectricTestRunner.java:191) at org.robolectric.RobolectricTestRunner.runChild(RobolectricTestRunner.java:56) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.robolectric.RobolectricTestRunner$1.evaluate(RobolectricTestRunner.java:157) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.junit.runner.JUnitCore.run(JUnitCore.java:137) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:69) at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:234) at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:74) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)

Write tip

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

Users with the same issue

PilleoPilleo
6 times, last one
Unknown visitor
Unknown visitorOnce,
Andreas HäberAndreas Häber
5 times, last one
linxiaolonglinxiaolong
8 times, last one
Unknown visitor
Unknown visitorOnce,
61 more bugmates