Tag Archives: EasyMock

EasyMock Exception NoClassDefFoundError

While trying to set up my JUnit test project in eclipse to be able to mock the dependencies of my classes under test, I was receiving a java.lang.NoClassDefFoundError exception on the call to EasyMock.replay(myMockedObject). Included in my build path were easymock-3.0.jar, objenesis-1.2.jar, and cglib-2.2.jar.

I eventually found this site, and saw that I needed cglib-nodep-2.2.jar in my build path instead of just cglib-2.2.jar. Odd that EasyMock didn’t mention that .jar specifically.