claeis / ilivalidator

INTERLIS validator
14 stars 21 forks source link

java.lang.NullPointerException when starting filelist #224

Closed Pierre-de-la-Verre closed 4 years ago

Pierre-de-la-Verre commented 4 years ago

I have the ilivalidator in folder d:\Program Files\ilivalidator\ and some XTF-files in d:\Program Files\ilivalidator\xx

I tried some examples from the manual, like "java -jar ilivalidator.jar --createIliData --ilidata newIlidata.xml --repos folder" and "java -jar "d:\Program Files\ilivalidator\ilivalidator.jar" --createIliData --ilidata newIlidata.xml --srcfiles files.txt"

with a lot of relative and absulote paths and with quotes and without - and always I get a "java.lang.NullPointerException"

A new newIlidata.xml is sometimes created, it looks like this:

  <?xml version="1.0" encoding="UTF-8" ?> 
- <TRANSFER xmlns="http://www.interlis.ch/INTERLIS2.3">
- <HEADERSECTION SENDER="ilivalidator-1.11.3-0de2d606b648b74ab53fce8201a0fdf70b208a47" VERSION="2.3">
- <MODELS>
  <MODEL NAME="DatasetIdx16" VERSION="2018-11-21" URI="mailto:ce@eisenhutinformatik.ch" /> 
  </MODELS>
  </HEADERSECTION>
- <DATASECTION>
  <DatasetIdx16.DataIndex BID="b1" /> 
  </DATASECTION>
  </TRANSFER>

Can you help me to find the right batch line?

claeis commented 4 years ago

please post the stack trace (use --trace). "Fall 9" requires --repos folder and srcfiles.txt can only contain relative paths (no absolute ones) to the repos folder.

Pierre-de-la-Verre commented 4 years ago

So, here are my commands and my results - relative and absolute, (un)quoted ..

D:\Program Files\ilivalidator>java -jar "d:\Program Files\ilivalidator\ilivalidator.jar"  --trace --createIliData --ilidata ilidata.xml --repos "d:\Program Files\ilivalidator\xx"
java.lang.NullPointerException
    org.interlis2.validator.CreateIliDataTool.visitAllFiles(CreateIliDataTool.java:297)
    org.interlis2.validator.CreateIliDataTool.createIliData(CreateIliDataTool.java:61)
    org.interlis2.validator.CreateIliDataTool.start(CreateIliDataTool.java:48)
    org.interlis2.validator.Main.main(Main.java:183)

D:\Program Files\ilivalidator>java -jar "d:\Program Files\ilivalidator\ilivalidator.jar"  --trace --createIliData --ilidata ilidata.xml --repos "d:\Program Files\ilivalidator\xx\"
java.lang.NullPointerException
    org.interlis2.validator.CreateIliDataTool.visitAllFiles(CreateIliDataTool.java:294)
    org.interlis2.validator.CreateIliDataTool.createIliData(CreateIliDataTool.java:61)
    org.interlis2.validator.CreateIliDataTool.start(CreateIliDataTool.java:48)
    org.interlis2.validator.Main.main(Main.java:183)

D:\Program Files\ilivalidator>java -jar "d:\Program Files\ilivalidator\ilivalidator.jar"  --trace --createIliData --ilidata ilidata.xml --repos d:\Program Files\ilivalidator\xx\
ilivalidator: wrong number of arguments

D:\Program Files\ilivalidator>java -jar "d:\Program Files\ilivalidator\ilivalidator.jar"  --trace --createIliData --ilidata ilidata.xml --repos "xx\"
java.lang.NullPointerException
    org.interlis2.validator.CreateIliDataTool.visitAllFiles(CreateIliDataTool.java:294)
    org.interlis2.validator.CreateIliDataTool.createIliData(CreateIliDataTool.java:61)
    org.interlis2.validator.CreateIliDataTool.start(CreateIliDataTool.java:48)
    org.interlis2.validator.Main.main(Main.java:183)

D:\Program Files\ilivalidator>java -jar "d:\Program Files\ilivalidator\ilivalidator.jar"  --trace --createIliData --ilidata ilidata.xml --repos "xx"
java.lang.NullPointerException
    org.interlis2.validator.CreateIliDataTool.visitAllFiles(CreateIliDataTool.java:297)
    org.interlis2.validator.CreateIliDataTool.createIliData(CreateIliDataTool.java:61)
    org.interlis2.validator.CreateIliDataTool.start(CreateIliDataTool.java:48)
    org.interlis2.validator.Main.main(Main.java:183)

D:\Program Files\ilivalidator>java -jar "d:\Program Files\ilivalidator\ilivalidator.jar"  --trace --createIliData --ilidata ilidata.xml --repos "..\xx"
java.lang.NullPointerException
    org.interlis2.validator.CreateIliDataTool.visitAllFiles(CreateIliDataTool.java:294)
    org.interlis2.validator.CreateIliDataTool.createIliData(CreateIliDataTool.java:61)
    org.interlis2.validator.CreateIliDataTool.start(CreateIliDataTool.java:48)
    org.interlis2.validator.Main.main(Main.java:183)

D:\Program Files\ilivalidator>java -jar "d:\Program Files\ilivalidator\ilivalidator.jar"  --trace --createIliData --ilidata ilidata.xml --repos "..\xx\"
java.lang.NullPointerException
    org.interlis2.validator.CreateIliDataTool.visitAllFiles(CreateIliDataTool.java:294)
    org.interlis2.validator.CreateIliDataTool.createIliData(CreateIliDataTool.java:61)
    org.interlis2.validator.CreateIliDataTool.start(CreateIliDataTool.java:48)
    org.interlis2.validator.Main.main(Main.java:183)

D:\Program Files\ilivalidator>java -jar "d:\Program Files\ilivalidator\ilivalidator.jar"  --trace --createIliData --ilidata ilidata.xml --repos "..\xx\"
java.lang.NullPointerException
    org.interlis2.validator.CreateIliDataTool.visitAllFiles(CreateIliDataTool.java:294)
    org.interlis2.validator.CreateIliDataTool.createIliData(CreateIliDataTool.java:61)
    org.interlis2.validator.CreateIliDataTool.start(CreateIliDataTool.java:48)
    org.interlis2.validator.Main.main(Main.java:183)
claeis commented 4 years ago

The NPE is because the folder xx doesn't exist.

Pierre-de-la-Verre commented 4 years ago

?? But it exists on my local drive as defined and contains XTF-files, e.g. d:\Program Files\ilivalidator\xx\a.xtf