mustangproject icon indicating copy to clipboard operation
mustangproject copied to clipboard

NullPointerException at: ZUGFeRDExporter.PDFattachZugferdFile(this)

Open mitchneu opened this issue 5 years ago • 4 comments

Hello, I copied the MustangWriter example form the project. I just changed the input and the output filename and the path to the files. When the program tries to attach the Zugferd file by calling .PDFattachZugferdFile(this), I get the following NullPointerException:

Exception in thread "main" java.lang.NullPointerException
	at org.mustangproject.ZUGFeRD.ZUGFeRDTransactionModelConverter.getPaymentData(ZUGFeRDTransactionModelConverter.java:454)
	at org.mustangproject.ZUGFeRD.ZUGFeRDTransactionModelConverter.getTradeSettlement(ZUGFeRDTransactionModelConverter.java:429)
	at org.mustangproject.ZUGFeRD.ZUGFeRDTransactionModelConverter.getTradeTransaction(ZUGFeRDTransactionModelConverter.java:187)
	at org.mustangproject.ZUGFeRD.ZUGFeRDTransactionModelConverter.convertToModel(ZUGFeRDTransactionModelConverter.java:103)
	at org.mustangproject.ZUGFeRD.ZUGFeRD1PullProvider.createZugferdXMLForTransaction(ZUGFeRD1PullProvider.java:77)
	at org.mustangproject.ZUGFeRD.ZUGFeRD1PullProvider.generateXML(ZUGFeRD1PullProvider.java:104)
	at org.mustangproject.ZUGFeRD.ZUGFeRDExporter.PDFattachZugferdFile(ZUGFeRDExporter.java:393)
	at MustangWriter.apply(MustangWriter.java:270)
	at MustangWriter.main(MustangWriter.java:283)

A similar error occurred in january. I also tried to attach custom XML which works just fine.

mitchneu avatar Nov 10 '20 11:11 mitchneu

did you try the corrected sample I had mentioned on 14 jan?

jstaerk avatar Nov 10 '20 12:11 jstaerk

Yes, I tried the newest sample. also using mustang-1.7.8.jar

mitchneu avatar Nov 10 '20 12:11 mitchneu

hi, tweimer just submitted a patch for mustang 2 on https://github.com/ZUGFeRD/mustangproject/pull/204 does that help?

jstaerk avatar Nov 30 '20 14:11 jstaerk

Seems to be the same NullPointerException as in #165

tweimer avatar Dec 01 '20 12:12 tweimer