From: Steve C. <sch...@gm...> - 2013-10-24 19:50:40
|
Sorry for the delay in response on this. I believe I found the root cause of the auxClasspath issue where people will receive the ClassNotFoundException. Part of the reason was I added the CheckMethod api from the ASM library. I believed it would be better that people receive issues of instrumentation issues at instrumentation time instead of at execution time. We required the auxClasspath because we actually rebuild the entire .class file and because of that it requires that the .class files are added. This actually helped a great lot with debugging (for me) as I could see why it failed to instrument a .class file. I noticed a lot of people were having issues with upgrading and I think to maintain backward compatibility and less arguments for people to add, I will remove this extra item and perform a 2.0.4 release before doing the new feature 2.1.0 release. On Wed, Oct 23, 2013 at 1:37 PM, KARR, DAVID <dk...@at...> wrote: > > -----Original Message----- > > From: KARR, DAVID > > Sent: Wednesday, October 23, 2013 10:09 AM > > To: cob...@li... > > Subject: [Cobertura-devel] app classes not found upgrading from Cobertura > > 1.9.4.1 to 2.0.3 > > > > We've been working fine with Cobertura 1.9.4.1 for a while. A related > > project tried to implement the same infrastructure, but they were seeing > > errors like this: > > > > [junit] junit.framework.TestListener: addError(testServiceForNullInputs, > > tried to access method > > net.sourceforge.cobertura.coveragedata.ProjectData.initialize()V from > class > > net.sourceforge.cobertura.coveragedata.TouchCollector) > > After some analysis, I have to conclude that they must have had their > classpath messed up, perhaps with both 1.9.4.1 and 2.0.3 in their > classpath. It seems like a stretch, but I could see this problem happening > if they had the old TouchCollector class with the new ProjectData class > (the call to "ProjectData.initialize()" is only in the old TouchCollector, > and "ProjectData.initialize()" went from public to private in the new > version). > > > As a result, they tried upgrading to Cobertura 2.0.3. This fixed their > > problem, but I'm not sure why, and I don't know why we weren't seeing > this in > > the other project. I believe I noticed a couple of occurrences of this > error > > on the net, but I didn't notice that anyone reported a solution. > > > > I then tried to see if the original project using 1.9.4.1 would upgrade > > cleanly with 2.0.3. I replaced the older cobertura jar and the older > "asm" > > jars with the cobertura and asm jars, but when I ran my test, I saw new > > errors like the following: > > ---------------- > > Cobertura 2.0.3 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file > > 2013-10-23 09:56:14,233 WARN > > [net.sourceforge.cobertura.instrument.CoberturaInstrumenter] > > [instrumentClass] [Thread:main] - [Unable to instrument file <application > > class>] > > java.lang.RuntimeException: java.lang.ClassNotFoundException: <framework > > class> > > I'm guessing I have to add "auxClassPath" entries for my application and > framework classes, but I don't understand why I didn't have to do this with > 1.9.4.1. > > > at > > > net.sourceforge.cobertura.instrument.CoberturaClassWriter.getCommonSuperClass > > (CoberturaClassWriter.java:35) > > at org.objectweb.asm.ClassWriter.a(Unknown Source) > > ---------------- > > > > Where "application class" is a local class in my application, and > "framework > > class" is a class in a framework we use. I checked the classpath, which > was > > echoed just before the "cobertura" Ant task was referenced, and the jar > > containing that framework class was in the classpath. > > > > The reference to the "cobertura" Ant task looks like this: > > > > <target name="cobertura-instrument-unit-test"> > > <delete file="${cobertura.dir}/cobertura.ser"/> > > <cobertura-instrument > datafile="${cobertura.dir}/cobertura.ser" > > todir="${instrumented.dir}"> > > <fileset dir="${main.classes.dir}" /> > > </cobertura-instrument> > > </target> > > > > Is there something else I have to change in the upgrade from 1.9.4.1 to > 2.0.3 > > that I've missed? > > > ------------------------------------------------------------------------------ > October Webinars: Code for Performance > Free Intel webinars can help you accelerate application performance. > Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most > from > the latest Intel processors and coprocessors. See abstracts and register > > http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk > _______________________________________________ > Cobertura-devel mailing list > Cob...@li... > https://lists.sourceforge.net/lists/listinfo/cobertura-devel > |