NPE when saveGlobalProjectData

View: New views
1 Messages — Rating Filter:   Alert me  

NPE when saveGlobalProjectData

by Jim R :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,:

I was trying to run an instrumented web application in jboss and use
saveGlobalProjectData to save data to cobertura.ser, but I got this error:

java.lang.NullPointerException at
net.sourceforge.cobertura.coveragedata.CoverageDataContainer.merge(CoverageDataContainer.java:210)
at
net.sourceforge.cobertura.coveragedata.ProjectData.merge(ProjectData.java:142)
at
net.sourceforge.cobertura.coveragedata.ProjectData.saveGlobalProjectData(ProjectData.java:243)

I checked the source code, but couldn't think of an obvious reason why
this is happening.

Setup:
-- Web application deployed as exploded ear, some of the classes in
WEB-INF/classes are instrumented, not all of them
-- JBoss 4.2.2 running on JDK 5.0
-- saveGlobalProjectData is called by a jsp inside the webapp:
<%
try
{
     String className =
"net.sourceforge.cobertura.coveragedata.ProjectData";
     String methodName = "saveGlobalProjectData";
     Class saveClass = Class.forName(className);
     java.lang.reflect.Method saveMethod =
saveClass.getDeclaredMethod(methodName, new Class[0]);
     saveMethod.invoke(null,new Object[0]);
     out.println("Cobertura data saved.");
}
catch (Throwable t)
{
     out.println("Unable to save Cobertura data: " + t);
     t.printStackTrace(new java.io.PrintWriter(out));
}
%>
-- cobertura.ser is saved at jboss's bin directory
-- After the web application is started and our test cases are run, we
get "[STDOUT] Cobertura: Loaded information on 43 classes." in console,
so it looks like the ser file is found.

Thanks

Jim

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Cobertura-devel mailing list
Cobertura-devel@...
https://lists.sourceforge.net/lists/listinfo/cobertura-devel
LightInTheBox - Buy quality products at wholesale price!