Skip to content
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
Open

Ant task throws NullPointerException #240

eerohele opened this issue Aug 11, 2016 · 3 comments

Comments

@eerohele
Copy link

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
Copy link

dwcramer commented Aug 15, 2017

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

@lbize
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
Copy link

lbize commented Dec 18, 2018

Thanks !

ndw added a commit that referenced this issue Mar 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants