xmlcalabash1
xmlcalabash1 copied to clipboard
Ant task throws NullPointerException
xmlcalabash-1.1.9-96.
Buildfile:
<project xmlns:c="antlib:com.xmlcalabash" name="test" default="build">
<typedef uri="antlib:com.xmlcalabash"
resource="com/xmlcalabash/antlib.xml"
classpath="xmlcalabash-1.1.9-96.jar"/>
<target name="build">
<c:calabash pipeline="xpl/pipe.xpl"/>
</target>
</project>
Error:
Buildfile: /private/tmp/xmlcalabash-1.1.9-96/build.xml
build:
[c:calabash] Pipelining into /private/tmp/xmlcalabash-1.1.9-96
BUILD FAILED
/private/tmp/xmlcalabash-1.1.9-96/build.xml:8: java.lang.NullPointerException
at com.xmlcalabash.drivers.Main.run(Main.java:182)
at com.xmlcalabash.drivers.CalabashTask.process(CalabashTask.java:1309)
at com.xmlcalabash.drivers.CalabashTask.execute(CalabashTask.java:1201)
It seems to me that runtime
is null
at Main.java#L182.
I also get the same error using the latest xmlcalabash-1.1.16-97.jar.
Hello.
First, thanks for your work Mr Walsh.
The problem is the runtime
field in the com.xmlcalabash.drivers.Main
class is not initialize when the protected method boolean run(UserArgs userArgs, XProcConfiguration config)
is called. So just replace:
boolean run(UserArgs userArgs, XProcConfiguration config) throws SaxonApiException, IOException, URISyntaxException {
if (userArgs.isShowVersion()) {
XProcConfiguration.showVersion(runtime);
}
XPipeline pipeline = null;
if (userArgs.getPipeline() != null) {
by
boolean run(UserArgs userArgs, XProcConfiguration config) throws SaxonApiException, IOException, URISyntaxException {
if (userArgs.isShowVersion()) {
XProcConfiguration.showVersion(runtime);
}
XPipeline pipeline = null;
if (runtime == null) {
runtime = new XProcRuntime(config);
}
if (userArgs.getPipeline() != null) {
It works.
Thanks !