I install Metrics 1.3.5 from
"http://metrics.sourceforge.net/update/" using Ant
eclipse update manager. And the Metrics view can show
me the data correctly.
But when I perform headless operation from ant
according to the example in
http://metrics.sourceforge.net/, there is
NullPointerException error.
D:\>D:\jdk\java141\jre\bin\java.exe "-Xmx256m" -cp
D:\eclipse30\eclipse\startup.
jar org.eclipse.core.launcher.Main -noupdate
-application org.eclipse.ant.core.a
ntRunner -data D:\eclipse30\eclipse\workspace -file
D:\eclipse30\eclipse\workspa
ce\projtest\build.xml
Buildfile:
D:\eclipse30\eclipse\workspace\projtest\build.xml
init:
build:
[metrics.enable] Metrics already enabled
[eclipse.build] ProjTest ...
[eclipse.build] Building: /ProjTest ...
[eclipse.build] Invoking Java Builder on /ProjTest....
[eclipse.build] Preparing for build...
[eclipse.build] Cleaning output folder...
[eclipse.build] Analyzing sources...
[eclipse.build] Build done...
[eclipse.build] Invoking Metrics Builder on /ProjTest....
[eclipse.build] Queuing ...
[eclipse.build] Queuing ...
[eclipse.build] Queuing ProjTest...
[eclipse.build] Building: /ProjTest... Done.
[eclipse.build] unknown... Done.
[eclipse.build] unknown... Done.
[metrics.export] Exporting metrics to flat per Metric
XML format... ...
BUILD FAILED
java.lang.NullPointerException
at
net.sourceforge.metrics.internal.xml.MetricsFirstExporter.getName(Met
ricsFirstExporter.java:378)
at
net.sourceforge.metrics.internal.xml.MetricsFirstExporter.printRoot(M
etricsFirstExporter.java:119)
at
net.sourceforge.metrics.internal.xml.MetricsFirstExporter.export(Metr
icsFirstExporter.java:94)
at
net.sourceforge.metrics.ant.ExportMetricsTask.execute(ExportMetricsTa
sk.java:75)
at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:269)
at org.apache.tools.ant.Task.perform(Task.java:364)
at
org.apache.tools.ant.Target.execute(Target.java:301)
at
org.apache.tools.ant.Target.performTasks(Target.java:328)
at
org.apache.tools.ant.Project.executeTarget(Project.java:1215)
at
org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRu
nner.java:635)
at
org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRu
nner.java:539)
at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:79)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:41)
at java.lang.reflect.Method.invoke(Method.java:371)
at
org.eclipse.ant.core.AntRunner.run(AntRunner.java:488)
at
org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformAct
ivator.java:335)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.ja
va:273)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.ja
va:129)
at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:79)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:41)
at java.lang.reflect.Method.invoke(Method.java:371)
at
org.eclipse.core.launcher.Main.basicRun(Main.java:183)
at
org.eclipse.core.launcher.Main.run(Main.java:644)
at
org.eclipse.core.launcher.Main.main(Main.java:628)
Total time: 1 second
java.lang.IllegalArgumentException
at
org.eclipse.core.internal.plugins.PluginDescriptor.doPluginActivation
(PluginDescriptor.java:345)
at
org.eclipse.core.internal.plugins.PluginDescriptor.getPlugin(PluginDe
scriptor.java:328)
at
org.eclipse.core.runtime.Platform.getPlugin(Platform.java:636)
at
net.sourceforge.metrics.core.Log.logError(Log.java:23)
at
net.sourceforge.metrics.builder.MetricsBuilder$CalculatorThread.run(M
etricsBuilder.java:731)
Logged In: NO
Frank,
Any chance of a fix / work-around for this?