New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ant task throws NullPointerException #240

Open
eerohele opened this Issue Aug 11, 2016 · 3 comments

Comments

Projects
None yet
3 participants
@eerohele
Copy link

eerohele commented Aug 11, 2016

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.

@dwcramer

This comment has been minimized.

Copy link

dwcramer commented Aug 15, 2017

I also get the same error using the latest xmlcalabash-1.1.16-97.jar.

@lbize

This comment has been minimized.

Copy link

lbize commented Nov 19, 2018

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.

ndw added a commit that referenced this issue Dec 8, 2018

ndw added a commit that referenced this issue Dec 8, 2018

@lbize

This comment has been minimized.

Copy link

lbize commented Dec 18, 2018

Thanks !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment