Error java.lang.NoClassDefFoundError:org/apache/http/cookie/Cookie using Emma with Android

810 views
Skip to first unread message

lucidc...@gmail.com

unread,
Apr 14, 2014, 4:16:21 AM4/14/14
to jac...@googlegroups.com
I use Emma pluging for code coverage in Android project. My tests are success when I running with JUnit but when I run with Emma I found an execption :

java.lang.NoClassDefFoundError:org/apache/http/cookie/Cookie

I 'm using Cookie in the class test but JUnit pass with success. I have the same problem with the BasicNameValuePair. Do I need to make some import? Does anyone have this problem ?

Marc R. Hoffmann

unread,
Apr 14, 2014, 11:35:43 AM4/14/14
to jac...@googlegroups.com
Hi,

this mailing list is for the EclEmma Eclipse plugin and the JaCoCo code
coverage library (which is the library behind EclEmma since version
2.0). If you're looking for the Emma project the project's site is
http://emma.sourceforge.net/

Otherwise can you please let us know what product are you using, which
version? Also a full stack trace might help.

Best regards,
-marc

lucidc...@gmail.com

unread,
Apr 15, 2014, 3:55:35 AM4/15/14
to jac...@googlegroups.com
Thanks for this quick response.
Sorry , I misspoke. I have an Android project (using ADT IDE) and I want to use the plugin EclEmma ( EclEmma 2.3.0.201403192240) for Eclipse.
I don't download .jar I had just install EclEmma with Eclipse option. Like that Eclispe IDE >Help > Install new Software...

Thanks

Marc Hoffmann

unread,
Apr 15, 2014, 4:01:21 AM4/15/14
to jac...@googlegroups.com
Ok. So can you please provide the full stack trace?
-marc

lucidc...@gmail.com

unread,
Apr 16, 2014, 11:42:36 AM4/16/14
to jac...@googlegroups.com
See the full stack trace.

java.lang.NoClassDefFoundError: org/apache/http/cookie/Cookie
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
at java.lang.Class.getMethod0(Unknown Source)
at java.lang.Class.getMethod(Unknown Source)
at org.junit.internal.builders.SuiteMethodBuilder.hasSuiteMethod(SuiteMethodBuilder.java:20)
at org.junit.internal.builders.SuiteMethodBuilder.runnerForClass(SuiteMethodBuilder.java:13)
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:57)
at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:29)
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:57)
at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:24)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.<init>(JUnit4TestReference.java:33)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestClassReference.<init>(JUnit4TestClassReference.java:25)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createTest(JUnit4TestLoader.java:48)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.loadTests(JUnit4TestLoader.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:452)
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: org.apache.http.cookie.Cookie
at java.net.URLClassLoader$1.run(Unknown Source)
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)
... 18 more

Marc Hoffmann

unread,
Apr 16, 2014, 12:17:07 PM4/16/14
to jac...@googlegroups.com
Hi,

is this class actually on your classpath? If not, could you please
provide this dependencies.

We've seen a similar behaviour before with some Oracle driver JARs: The
library has some dependencies which are not supplied but not required in
a specific scenario. But if you run the same scenario under code
coverage (i.e. with instrumented classes) suddenly the dependencies are
required by the JVM (probably for some class file verification).

Cheers,
-marc

lucidc...@gmail.com

unread,
Apr 22, 2014, 2:57:07 AM4/22/14
to jac...@googlegroups.com
Ok I will try this way.
Thank you for your help.
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages