From: Mark D. <Mar...@sa...> - 2005-08-02 14:54:30
|
1. e. When you invoke the main method from the instrumented classes, are = you forking or otherwise running the class in a different JVM? This JVM = must terminate before you run cobertura-report 2. You need cobertura.jar in your classpath when running (along with = log4j.jar) 3. You need the ..\Build\classes folder in your classpath (after = ..\Build\instrumented, of course). Cobertura can't instrument = interfaces and classes that do not contain debug information, and it = does not currently copy these classes to the instrumented directory -Mark > -----Original Message----- > From: lokesh [mailto:lok...@wi...]=20 > Sent: Tuesday, August 02, 2005 10:47 AM > To: Mark Doliner > Subject: RE: [Cobertura-devel] urgent----0% coverage >=20 >=20 > Hi mark, >=20 > I am facing these problems, >=20 > 1. I am doing the following steps for generating the reports: > a. compile my source code and generate the class files to some > ..\Build\classes folder.=20 > b. set all the jars to the classpath(jars related to cobertura). > c. instrument my class files in the ..Build\classes to > ..Build\instrumented folder. > d. set the instrumented folder path before the uninstrumented > folder path to the classpath. > e. invoke the main method found in the instrumented classes. > d. generate the report using the same ser file.=20 >=20 >=20 > 2. Exception in thread "main" java.lang.NoClassDefFoundError: > net/sourceforge/cobertura/coveragedata/HasBeenInstrumented > at java.lang.ClassLoader.defineClass1(Native Method) > at java.lang.ClassLoader.defineClass(ClassLoader.java:620) > at > java.security.SecureClassLoader.defineClass(SecureClassLoader.java:12 > at=20 > java.net.URLClassLoader.defineClass(URLClassLoader.java:260) > at java.net.URLClassLoader.access$100(URLClassLoader.java:56) > at java.net.URLClassLoader$1.run(URLClassLoader.java:195) > at java.security.AccessController.doPrivileged(Native Method) > at java.net.URLClassLoader.findClass(URLClassLoader.java:188) > at java.lang.ClassLoader.loadClass(ClassLoader.java:306) > at=20 > sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268) > at java.lang.ClassLoader.loadClass(ClassLoader.java:251) > at=20 > java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) >=20 > ---------I have all the jars set in the classpath. >=20 > 3. some classes are missing in the instrumented classes.(so I=20 > am getting > noclassdeffounderror) >=20 > please help me out in these issues. >=20 > Thanks, > Lokesh. >=20 >=20 > -----Original Message----- > From: Mark Doliner [mailto:Mar...@sa...]=20 > Sent: Tuesday, August 02, 2005 7:40 PM > To: lok...@wi... > Subject: RE: [Cobertura-devel] urgent----0% coverage >=20 > > -----Original Message----- > > From: cob...@li...=20 > > [mailto:cob...@li...] On=20 > > Behalf Of lokesh > > Sent: Tuesday, August 02, 2005 8:13 AM > > To: cob...@li... > > Subject: [Cobertura-devel] urgent----0% coverage > >=20 > > Hi, > > =20 > > I'm attempting to use Cobertura for the first time and the=20 > > report shows up as 0% coverage. I don't have unit tests. > > While running my application I think the .ser file is not=20 > > getting updated, the time stamp remains same. > > =20 > > Could any one please tell me how to proceed after=20 > > instrumenting the classes. >=20 > Two of the more likely things that could be happening are: >=20 > 1. You're not using the instrumented classes when running your > application. The instrumented classes should be in your=20 > classpath, and > they should appear BEFORE the non-instrumented classes. >=20 > 2. You ARE using instrumented classes, but they're creating=20 > an ser file > in a different location than the original one. The default=20 > location is > the directory from where your application was started >=20 > Hope that helps, > Mark >=20 >=20 >=20 >=20 > Confidentiality Notice=20 >=20 > The information contained in this electronic message and any=20 > attachments to this message are intended > for the exclusive use of the addressee(s) and may contain=20 > confidential or privileged information. If > you are not the intended recipient, please notify the sender=20 > at Wipro or Mai...@wi... immediately > and destroy all copies of this message and any attachments. >=20 |