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

java.lang.NoClassDefFoundError: net/sourceforge/cobertura/coveragedata/LightClassmapListener #128

Closed
olemara opened this issue Jan 23, 2014 · 8 comments

Comments

@olemara
Copy link

olemara commented Jan 23, 2014

Hi,

I downloaded the 2.0.3 version, and I am trying to get coverage reports for my war deployed on JBoss.

I have updated the cobertura-instrument.bat to adhere to the jar file present in the download.

I have instrumented the jar with the following command:
"C:\cobertura\cobertura-2.0.3\cobertura-instrument.bat" --basedir C:\Jboss\jboss-as-7.1.1.Final\standalone\deployments proejct.war --datafile C:\Jboss\jboss-as-7.1.1.Final\bin\cobertura.ser --auxClasspath "C:.m2\repository\com\project1
\project-1.jar"

I get the message "INFO: Cobertura: Saved information on 40 classes."

In the next step when I am trying to start jboss is where the error occurs.

15:40:49,093 ERROR [org.jboss.msc.service.fail](MSC service thread 1-5) MSC00001: Failed to start service jboss.deployment.unit."project.war".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.unit."project.war".POST_MODULE: Failed to process phase POST_MODULE of deployment "project.war"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:119) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [rt.jar:1.7.0_25]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.7.0_25]
at java.lang.Thread.run(Unknown Source) [rt.jar:1.7.0_25]
Caused by: java.lang.RuntimeException: Error getting reflective information for class com.project.project.OddsCreator with ClassLoader ModuleClassLoader for Module "deployment.project.war:main" from Service Module Loader
at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:70) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.ee.metadata.MethodAnnotationAggregator.runtimeAnnotationInformation(MethodAnnotationAggregator.java:58)
at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.handleAnnotations(InterceptorAnnotationProcessor.java:85)
at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.processComponentConfig(InterceptorAnnotationProcessor.java:70)
at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.deploy(InterceptorAnnotationProcessor.java:55)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
... 5 more
Caused by: java.lang.NoClassDefFoundError: net/sourceforge/cobertura/coveragedata/LightClassmapListener
at java.lang.Class.getDeclaredMethods0(Native Method) [rt.jar:1.7.0_25]
at java.lang.Class.privateGetDeclaredMethods(Unknown Source) [rt.jar:1.7.0_25]
at java.lang.Class.getDeclaredMethods(Unknown Source) [rt.jar:1.7.0_25]
at org.jboss.as.server.deployment.reflect.ClassReflectionIndex.(ClassReflectionIndex.java:65) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:66) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
... 10 more
Caused by: java.lang.ClassNotFoundException: net.sourceforge.cobertura.coveragedata.LightClassmapListener from [Module "deployment.oddscreator.war:main" from Service Module Loader]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190) [jboss-modules.jar:1.1.1.GA]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468) [jboss-modules.jar:1.1.1.GA]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456) [jboss-modules.jar:1.1.1.GA]
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398) [jboss-modules.jar:1.1.1.GA]
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120) [jboss-modules.jar:1.1.1.GA]
... 15 more

What am I missing here? Have I done the instrumentation wrong, or is this a bug?

Any help would be much appreciated.

@olemara olemara closed this as completed Jan 24, 2014
@ducva
Copy link

ducva commented Jun 24, 2014

How did you resolve it?

@sathishkannanp
Copy link

Facing same issue. any suggestion to overcome this issue?

@cristiantm
Copy link

Same here. Did someone found a solution? Why was this closed?

@pavel-hp
Copy link

pavel-hp commented Apr 2, 2017

the same issue

@cristiantm
Copy link

Cobertura does not seem to be very active. I've replaced it with JaCoCo and did not had any problem anymore.

@pavel-hp
Copy link

pavel-hp commented Apr 4, 2017

I've solved this problem I've just added this in pom.xml
<dependency> <groupId>net.sourceforge.cobertura</groupId> <artifactId>cobertura</artifactId> <version>2.1.1</version> <scope>test</scope> </dependency>

mtoonen added a commit to B3Partners/tailormap that referenced this issue May 23, 2017
mprins pushed a commit to B3Partners/tailormap that referenced this issue Aug 18, 2017
mprins added a commit to B3Partners/tailormap that referenced this issue Oct 3, 2017
so integration tests are reported as well

use travis-ci profile

Github suggested adding this dependency... cobertura/cobertura#128
mprins added a commit to B3Partners/tailormap that referenced this issue Jan 29, 2018
so integration tests are reported as well

use travis-ci profile

Github suggested adding this dependency... cobertura/cobertura#128
@liu906
Copy link

liu906 commented Sep 5, 2018

in command line,same error when
"java -classpath D:\cobertura2.-1.1\cobertura-2.1.1.jar;D:\cobertura2.-1.1\lib*.jar;C:\Users\liuxu\Desktop\java-algorithms-implementation\build\instrumented;C:\Users\liuxu\Desktop\java-algorithms-implementation\build\com;C:\Users\liuxu\Desktop\java-algorithms-implementation\build\com -Dnet.sourceforge.cobertura.datafile=D:\cobertura-2.1.1\cobertura.ser com.jwetherell.algorithms.data_structures.test.AllTests"

mprins added a commit to B3Partners/tailormap that referenced this issue Sep 10, 2018
so integration tests are reported as well

use travis-ci profile

Github suggested adding this dependency... cobertura/cobertura#128
mprins added a commit to B3Partners/tailormap that referenced this issue Dec 18, 2018
so integration tests are reported as well

use travis-ci profile

Github suggested adding this dependency... cobertura/cobertura#128
mprins added a commit to B3Partners/tailormap that referenced this issue Jan 11, 2019
so integration tests are reported as well

use travis-ci profile

Github suggested adding this dependency... cobertura/cobertura#128
@Kaka727
Copy link

Kaka727 commented Mar 19, 2019

same error in the command line when
"java -cp junit-4.6.jar;cobertura-2.1.1.jar;chart1-instru;chart1;-Dnet.sourceforge.cobertura.datafile=cobertura.ser org.junit.runner.JUnitCore AbstractCategoryItemRendererTests"

The error is "Exception in thread "main" java.lang.NoClassDefFoundError: AbstractCategoryItemRendererTests (wrong name: org/jfree/chart/renderer/category/junit/AbstractCategoryItemRendererTests)
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:335)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at org.junit.runner.JUnitCore.runMain(JUnitCore.java:90)
at org.junit.runner.JUnitCore.runMainAndExit(JUnitCore.java:54)
at org.junit.runner.JUnitCore.main(JUnitCore.java:46)”

Anyone can help me?

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

7 participants