gpt4 book ai didi

easymock - easymock 依赖于 net/sf/cglib/proxy/Enhancer 吗?

转载 作者:行者123 更新时间:2023-12-02 08:04:56 33 4
gpt4 key购买 nike

我正在尝试完成有关 easymock 的教程以首次使用它。 http://www.vogella.de/articles/EasyMock/article.html

我正在使用- 面向 Java 开发人员的 Eclipse IDE(内部版本号:20100218-1602)
- Junit 4插件
- Easymock 3.0

按照如下所述创建项目并作为 JUNIT 测试执行后,我收到错误。

**java.lang.NoClassDefFoundError: net/sf/cglib/proxy/Enhancer**            

这个错误是什么以及如何修复它?它发生在线路上

EasyMock.replay(calcMethod);            

java.lang.NoClassDefFoundError: net/sf/cglib/proxy/Enhancer at org.easymock.internal.ClassExtensionHelper.getControl(ClassExtensionHelper.java:57) at org.easymock.EasyMock.getControl(EasyMock.java:2068) at org.easymock.EasyMock.replay(EasyMock.java:1970) at income.IncomeCalculatorTest.testCalc1(IncomeCalculatorTest.java:33)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:73) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:46) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:180)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:41)
at org.junit.runners.ParentRunner$1.evaluate(ParentRunner.java:173)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31) at org.junit.runners.ParentRunner.run(ParentRunner.java:220) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:46) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197) Caused by: java.lang.ClassNotFoundException: net.sf.cglib.proxy.Enhancer at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) ... 28 more

最佳答案

是的,我想你需要它。

http://cglib.sourceforge.net/

它也可能位于 Easymock 下载中的某种依赖项目录中

关于easymock - easymock 依赖于 net/sf/cglib/proxy/Enhancer 吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4372029/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com