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

下载运行报错NoClassDefFoundError #1

Open
newbigland opened this issue Jun 13, 2018 · 1 comment
Open

下载运行报错NoClassDefFoundError #1

newbigland opened this issue Jun 13, 2018 · 1 comment

Comments

@newbigland
Copy link

在JAVA 8上

2018-06-13 18:05:29,125 [INFO] com.demo.common.utils.ListenerUtils - --> com.demo.douban.TestMovieApi
2018-06-13 18:05:29,497 [INFO] com.demo.common.utils.ListenerUtils - ----> com.demo.douban.TestMovieApi.testTop250

java.lang.NoClassDefFoundError: org/apache/http/client/HttpResponseException

at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:338)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
at java.lang.Class.getDeclaredMethods(Class.java:1975)
at org.codehaus.groovy.reflection.stdclasses.CachedSAMClass$1.run(CachedSAMClass.java:104)
at org.codehaus.groovy.reflection.stdclasses.CachedSAMClass$1.run(CachedSAMClass.java:102)
at java.security.AccessController.doPrivileged(Native Method)
at org.codehaus.groovy.reflection.stdclasses.CachedSAMClass.getDeclaredMethods(CachedSAMClass.java:102)
at org.codehaus.groovy.reflection.stdclasses.CachedSAMClass.getAbstractMethods(CachedSAMClass.java:120)
at org.codehaus.groovy.reflection.stdclasses.CachedSAMClass.getSAMMethod(CachedSAMClass.java:186)
at org.codehaus.groovy.reflection.ClassInfo.isSAM(ClassInfo.java:359)
at org.codehaus.groovy.reflection.ClassInfo.createCachedClass(ClassInfo.java:349)
at org.codehaus.groovy.reflection.ClassInfo.access$700(ClassInfo.java:41)
at org.codehaus.groovy.reflection.ClassInfo$LazyCachedClassRef.initValue(ClassInfo.java:497)
at org.codehaus.groovy.reflection.ClassInfo$LazyCachedClassRef.initValue(ClassInfo.java:488)
at org.codehaus.groovy.util.LazyReference.getLocked(LazyReference.java:49)
at org.codehaus.groovy.util.LazyReference.get(LazyReference.java:36)
at org.codehaus.groovy.reflection.ClassInfo.getCachedClass(ClassInfo.java:111)
at org.codehaus.groovy.reflection.ReflectionCache.getCachedClass(ReflectionCache.java:110)
at org.codehaus.groovy.reflection.ParameterTypes.getParametersTypes0(ParameterTypes.java:81)
at org.codehaus.groovy.reflection.ParameterTypes.getParameterTypes(ParameterTypes.java:67)
at org.codehaus.groovy.runtime.metaclass.MetaMethodIndex.isMatchingMethod(MetaMethodIndex.java:453)
at org.codehaus.groovy.runtime.metaclass.MetaMethodIndex.addMethodToList(MetaMethodIndex.java:378)
at groovy.lang.MetaClassImpl.addMetaMethodToIndex(MetaClassImpl.java:2953)
at groovy.lang.MetaClassImpl.populateMethods(MetaClassImpl.java:396)
at groovy.lang.MetaClassImpl.fillMethodIndex(MetaClassImpl.java:344)
at groovy.lang.MetaClassImpl.initialize(MetaClassImpl.java:3264)
at org.codehaus.groovy.reflection.ClassInfo.getMetaClassUnderLock(ClassInfo.java:254)
at org.codehaus.groovy.reflection.ClassInfo.getMetaClass(ClassInfo.java:285)
at com.jayway.restassured.authentication.NoAuthScheme.$getStaticMetaClass(NoAuthScheme.groovy)
at com.jayway.restassured.authentication.NoAuthScheme.<init>(NoAuthScheme.groovy)
at com.jayway.restassured.RestAssured.<clinit>(RestAssured.java:356)
at com.demo.common.utils.HttpUtils.<init>(HttpUtils.java:39)
at com.demo.common.utils.ProxyUtils.create(ProxyUtils.java:47)
at com.demo.douban.TestMovieApi.<init>(TestMovieApi.java:20)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.junit.runners.BlockJUnit4ClassRunner.createTest(BlockJUnit4ClassRunner.java:217)
at org.junit.runners.BlockJUnit4ClassRunner$1.runReflectiveCall(BlockJUnit4ClassRunner.java:266)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.BlockJUnit4ClassRunner.methodBlock(BlockJUnit4ClassRunner.java:263)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
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.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at com.demo.common.runner.ListenerRunner.run(ListenerRunner.java:19)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)

Caused by: java.lang.ClassNotFoundException: org.apache.http.client.HttpResponseException
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:338)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 70 more

2018-06-13 18:05:29,515 [INFO] com.demo.common.utils.ListenerUtils - Execution of test case failed : org/apache/http/client/HttpResponseException
2018-06-13 18:05:29,517 [INFO] com.demo.common.utils.ListenerUtils - <---- com.demo.douban.TestMovieApi.testTop250
2018-06-13 18:05:29,518 [INFO] com.demo.common.utils.ListenerUtils - ----> com.demo.douban.TestMovieApi.testCelebrity

java.lang.NoClassDefFoundError: Could not initialize class com.jayway.restassured.RestAssured

at com.demo.common.utils.HttpUtils.<init>(HttpUtils.java:39)
at com.demo.common.utils.ProxyUtils.create(ProxyUtils.java:47)
at com.demo.douban.TestMovieApi.<init>(TestMovieApi.java:20)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.junit.runners.BlockJUnit4ClassRunner.createTest(BlockJUnit4ClassRunner.java:217)
at org.junit.runners.BlockJUnit4ClassRunner$1.runReflectiveCall(BlockJUnit4ClassRunner.java:266)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.BlockJUnit4ClassRunner.methodBlock(BlockJUnit4ClassRunner.java:263)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
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.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at com.demo.common.runner.ListenerRunner.run(ListenerRunner.java:19)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)

2018-06-13 18:05:29,521 [INFO] com.demo.common.utils.ListenerUtils - Execution of test case failed : Could not initialize class com.jayway.restassured.RestAssured
2018-06-13 18:05:29,521 [INFO] com.demo.common.utils.ListenerUtils - <---- com.demo.douban.TestMovieApi.testCelebrity
2018-06-13 18:05:29,533 [INFO] com.demo.common.utils.ListenerUtils - 执行结果 : false
2018-06-13 18:05:29,533 [INFO] com.demo.common.utils.ListenerUtils - 执行时间 : 403
2018-06-13 18:05:29,533 [INFO] com.demo.common.utils.ListenerUtils - 用例总数 : 2
2018-06-13 18:05:29,538 [INFO] com.demo.common.utils.ListenerUtils - 失败数量 : 2
2018-06-13 18:05:29,538 [INFO] com.demo.common.utils.ListenerUtils - 忽略数量 : 0

Process finished with exit code 255

@zhangboyi
Copy link

使用jdk1.8

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

2 participants