Java program crashes with RPGLE interface

434730 pts.
Tags:
IBM iSeries
Java
RPGLE
A good friend of mine recently created a Java program that creates PDF files that are based to GNUPDF. It's running great when he's using a native Java code but when it's used through RPGLE, the program crashes when it processes images. He tracked it down when of them to loading an image from a .JAR file / removed the call from the code. It worked for a little while but it's crashing again for images loaded from IFS. Any ideas? Here's the code:
java.lang.NullPointerException
    at gnu.jpdf.PDFImage.write(PDFImage.java:286)
    at gnu.jpdf.PDFOutput.write(PDFOutput.java:114)
    at gnu.jpdf.PDFDocument.write(PDFDocument.java:307)
    at gnu.jpdf.PDFJob.end(PDFJob.java:182)
    at com.mysite.pdf.PdfDocumentStateValid.endDocument(PdfDocumentStateValid.java:657)
    at com.mysite.pdf.PdfDocument.endDocument(PdfDocument.java:36)
java.io.IOException: Descriptor not valid.
    at java.lang.Throwable.<init>(Throwable.java:196)
    at java.lang.Exception.<init>(Exception.java:41)
    at java.io.IOException.<init>(IOException.java:40)
    at java.io.FileOutputStream.writeBytes(Native Method)
    at java.io.FileOutputStream.write(FileOutputStream.java:260)
    at java.io.ByteArrayOutputStream.writeTo(ByteArrayOutputStream.java:112)
    at gnu.jpdf.PDFOutput.<init>(PDFOutput.java:96)
    at gnu.jpdf.PDFDocument.write(PDFDocument.java:302)
    at gnu.jpdf.PDFJob.end(PDFJob.java:182)
    at java.awt.PrintJob.finalize(PrintJob.java:60)
    at java.lang.ref.Finalizer.runFinalizer(Finalizer.java:116)
    at java.lang.ref.Finalizer.access$100(Finalizer.java:47)
    at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:193)

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: