Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Samebug tips

  1. ,

    Thrown if an application attempts to access or modify a field, or to call a method or interface it does not have access to. Can also occur if the two classes are compiled with different compiler version so the interface and its implementation don't match.

Solutions on the web

via Google Groups by Alexander Pelepeychenko, 1 year ago
Mockito cannot mock this class: class java.nio.DirectByteBuffer Mockito can only mock visible & non-final classes. If you're not sure why you're getting this error, please report to the mailing list.
java.lang.IllegalAccessError: class $java.nio.
DirectByteBuffer$$EnhancerByMockitoWithCGLIB$$d5fb8f36 cannot access its 
superclass java.nio.DirectByteBuffer	at java.lang.ClassLoader.defineClass1(Native Method)	at java.lang.ClassLoader.defineClass(ClassLoader.java:760)	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 org.mockito.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:385)	at org.mockito.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:220)	at org.mockito.cglib.proxy.Enhancer.createHelper(Enhancer.java:378)	at org.mockito.cglib.proxy.Enhancer.createClass(Enhancer.java:318)	at org.powermock.api.mockito.repackaged.ClassImposterizer.createProxyClass(ClassImposterizer.java:123)	at org.powermock.api.mockito.repackaged.ClassImposterizer.imposterise(ClassImposterizer.java:57)	at org.powermock.api.mockito.internal.mockcreation.MockCreator.createMethodInvocationControl(MockCreator.java:111)	at org.powermock.api.mockito.internal.mockcreation.MockCreator.mock(MockCreator.java:59)	at org.powermock.api.mockito.PowerMockito.spy(PowerMockito.java:220)	at misat.rounddb.EnsurePowerMockTest.addSpyTest(EnsurePowerMockTest.java:34)	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 org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:85)	at org.testng.internal.Invoker.invokeMethod(Invoker.java:639)	at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:816)	at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1124)	at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:108)	at org.testng.TestRunner.privateRun(TestRunner.java:774)	at org.testng.TestRunner.run(TestRunner.java:624)	at org.testng.SuiteRunner.runTest(SuiteRunner.java:359)	at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:354)	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:312)	at org.testng.SuiteRunner.run(SuiteRunner.java:261)	at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)	at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)	at org.testng.TestNG.runSuitesSequentially(TestNG.java:1191)	at org.testng.TestNG.runSuitesLocally(TestNG.java:1116)	at org.testng.TestNG.run(TestNG.java:1024)	at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:112)	at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:205)	at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:176)	at org.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:125)	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:140)