Menu

Headless mode NPE

Help
KingArgyle
2009-11-22
2013-04-24
  • KingArgyle

    KingArgyle - 2009-11-22

    When running in headless mode during a build to generate the coverage information, I'm getting the following stack trace and no session data is written:

    java.lang.NullPointerException
    at java.io.File.<init>(File.java:220)
    at org.eclemma.runtime.equinox.internal.EMMAAnalyzer.writeSessionData(EMMAAnalyzer.java:237)
    at org.eclemma.runtime.equinox.internal.EMMAAnalyzer.stop(EMMAAnalyzer.java:104)
    at org.eclemma.runtime.equinox.internal.InstrumentationHook.frameworkStop(InstrumentationHook.java:53)
    at org.eclipse.osgi.baseadaptor.BaseAdaptor.frameworkStop(BaseAdaptor.java:260)
    at org.eclipse.osgi.framework.internal.core.SystemBundleActivator.stop(SystemBundleActivator.java:72)
    at org.eclipse.osgi.framework.internal.core.BundleContextImpl$2.run(BundleContextImpl.java:840)
    at java.security.AccessController.doPrivileged(AccessController.java:246)
    at org.eclipse.osgi.framework.internal.core.BundleContextImpl.stop(BundleContextImpl.java:833)
    at org.eclipse.osgi.framework.internal.core.StartLevelManager.suspendAllBundles(StartLevelManager.java:623)
    at org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:265)
    at org.eclipse.osgi.framework.internal.core.StartLevelManager.shutdown(StartLevelManager.java:216)
    at org.eclipse.osgi.framework.internal.core.InternalSystemBundle.suspend(InternalSystemBundle.java:266)
    at org.eclipse.osgi.framework.internal.core.Framework.shutdown(Framework.java:685)
    at org.eclipse.osgi.framework.internal.core.Framework.close(Framework.java:583)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.shutdown(EclipseStarter.java:409)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:200)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:618)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:559)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1287)
    at org.eclipse.core.launcher.Main.main(Main.java:34)

    I've tried setting the location where the file should be written but that seems to have no affect.

     
  • Marc R. Hoffmann

    Hi,

    It looks like the system can't determine the parent directory of your output location. The line that causes the NPE:

    new File(file.getParent()).mkdirs();

    Have you tried to specify an absolute path, that actually exists?

    -marc

     
  • KingArgyle

    KingArgyle - 2009-11-24

    Yeah I've tried but for some reason none of the emma system properties are taking affect.  Bundles and Session properties never seem to get set, which is probably just a problem with the way the PDE build is passing in the extraVMargs property to the testing harness.