We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Convert Preserve Word Form Fields in PDF over Linux OpenJDK Runtime

Hi guys. Got an NPE running this little program. Compiled against 13.3.0.1. Program:


public class TestWordField {
public static void main( String[] args ) throws Exception {
String sourceDoc = “testWordField1.doc”;
String outFile = “/tmp/testWordField1.pdf”;
Document doc = new Document( sourceDoc );
PdfSaveOptions opts = new PdfSaveOptions();
opts.setPreserveFormFields( true );
doc.save( outFile, opts );
System.err.println( "Saved to " + outFile );
}
}

Output:
Exception in thread “main” java.lang.NullPointerException
at asposewobfuscated.ëCW.hasNext(Unknown Source)
at asposewobfuscated.ëOB.ë7(Unknown Source)
at asposewobfuscated.ëG4.ëZ(Unknown Source)
at asposewobfuscated.ëG4.ëS(Unknown Source)
at asposewobfuscated.ëGP.ëT(Unknown Source)
at asposewobfuscated.ëGO.ëZ(Unknown Source)
at asposewobfuscated.ëGL.ëCE(Unknown Source)
at asposewobfuscated.ëGL.ëCF(Unknown Source)
at asposewobfuscated.ëGL.(Unknown Source)
at asposewobfuscated.ëGP.ëZ(Unknown Source)
at asposewobfuscated.ëEL.ëZ(Unknown Source)
at asposewobfuscated.ëZX.ëZ(Unknown Source)
at asposewobfuscated.ëJ.ëZ(Unknown Source)
at asposewobfuscated.ëM.ëZ(Unknown Source)
at asposewobfuscated.ëJ.ëZ(Unknown Source)
at asposewobfuscated.ëM.ëZ(Unknown Source)
at asposewobfuscated.ëJ.ëZ(Unknown Source)
at asposewobfuscated.ëM.ëZ(Unknown Source)
at asposewobfuscated.ëJ.ëZ(Unknown Source)
at asposewobfuscated.ëM.ëZ(Unknown Source)
at asposewobfuscated.ëJ.ëZ(Unknown Source)
at asposewobfuscated.ëM.ëZ(Unknown Source)
at asposewobfuscated.ëJ.ëZ(Unknown Source)
at asposewobfuscated.ëM.ëZ(Unknown Source)
at asposewobfuscated.ëJ.ëZ(Unknown Source)
at asposewobfuscated.ë4.ëZ(Unknown Source)
at asposewobfuscated.ëEL.ëU(Unknown Source)
at com.aspose.words.ë2R.ëW(Unknown Source)
at com.aspose.words.ëL8.ëZ(Unknown Source)
at com.aspose.words.Document.ëZ(Unknown Source)
at com.aspose.words.Document.save(Unknown Source)
at TestWordField.main(TestWordField.java:11)

My test doc is attached.

Hi Eric,

Thanks for your inquiry. I was unable to reproduce this exception on my side using Aspose.Words for Java v13.3.0 . Please download this release of Aspose.Words from the following link:

I hope, this helps.

Best regards,

I downloaded that version (even though I am using a more recent version) and I still get the exception. I am using Aspose.Words.jdk16.jar, were you the same? What other information can I provide to help solve this?

Hi Eric,


Thanks for your inquiry. To ensure a timely and accurate response please supply us with the following information.
  • What environment are you running on?
    • OS (Windows Version or Linux Version)
    • Architecture (32 / 64 bit)
    • Any Third Party Libraries / SDK in addition to Aspose Products?
    • Java runtime (JDK) version?

As soon as you get these pieces of information to us we’ll start our investigation into your issue.

Many thanks,

Using Ubuntu Linux 12.04, 64 bit. There are no other libraries/jars being used, just the Aspose jar. Java runtime is:


java version "1.7.0_21"
OpenJDK Runtime Environment (IcedTea 2.3.9) (7u21-2.3.9-0ubuntu0.12.04.1)
OpenJDK 64-Bit Server VM (build 23.7-b01, mixed mode)

Hi Eric,


Thanks for the additional information. I will prepare the required platform to simulate the environment as of yours. As soon as everything is setup, I will test your issue on my end and will post the results here for your kind reference. We apologize for any inconvenience.

Best regards,

Hi Eric,


Thank you for being patient. I have tested your scenario by using the latest version of Aspose.Words for Java i.e. 13.4.0 over the environment you mentioned here but unfortunately couldn’t reproduce the NPE on my side. Please upgrade to latest version of Aspose.Words (13.4.0) and let me know how does it go on your side? I hope, this helps.

Best regards,

Same issue still exists with 13.4. I added this line to my code to ensure I really am using 13.4:


System.out.println( "Aspose version: " + BuildVersionInfo.getVersion() );

and here is the output. Any other thoughts?

java -cp Aspose.Words.jdk16.jar:. TestWordField testWordField1.doc
Just read in Aspose license information
Aspose version: 13.4.0.0
Exception in thread “main” java.lang.NullPointerException
at asposewobfuscated.ëCQ.hasNext(Unknown Source)
at asposewobfuscated.ëO9.ë7(Unknown Source)
at asposewobfuscated.ëFY.ëZ(Unknown Source)
at asposewobfuscated.ëFY.ëT(Unknown Source)
at asposewobfuscated.ëGJ.ëU(Unknown Source)
at asposewobfuscated.ëGI.ëZ(Unknown Source)
at asposewobfuscated.ëGF.ëC8(Unknown Source)
at asposewobfuscated.ëGF.ëC9(Unknown Source)
at asposewobfuscated.ëGF.(Unknown Source)
at asposewobfuscated.ëGJ.ëZ(Unknown Source)
at asposewobfuscated.ëEF.ëZ(Unknown Source)
at asposewobfuscated.ëZX.ëZ(Unknown Source)
at asposewobfuscated.ëJ.ëZ(Unknown Source)
at asposewobfuscated.ëM.ëZ(Unknown Source)
at asposewobfuscated.ëJ.ëZ(Unknown Source)
at asposewobfuscated.ëM.ëZ(Unknown Source)
at asposewobfuscated.ëJ.ëZ(Unknown Source)
at asposewobfuscated.ëM.ëZ(Unknown Source)
at asposewobfuscated.ëJ.ëZ(Unknown Source)
at asposewobfuscated.ëM.ëZ(Unknown Source)
at asposewobfuscated.ëJ.ëZ(Unknown Source)
at asposewobfuscated.ëM.ëZ(Unknown Source)
at asposewobfuscated.ëJ.ëZ(Unknown Source)
at asposewobfuscated.ëM.ëZ(Unknown Source)
at asposewobfuscated.ëJ.ëZ(Unknown Source)
at asposewobfuscated.ë4.ëZ(Unknown Source)
at asposewobfuscated.ëEF.ëT(Unknown Source)
at com.aspose.words.ë2I.ëW(Unknown Source)
at com.aspose.words.ëL4.ëZ(Unknown Source)
at com.aspose.words.Document.ëZ(Unknown Source)
at com.aspose.words.Document.save(Unknown Source)
at TestWordField.main(TestWordField.java:25)

Hi Eric,


Thanks for your inquiry and sorry for the delayed response. Unfortunately, after many attempts, I am still unable to reproduce it on my side. Could you please also download the document from here (not your local copy) and retest it on your end. Please create a simple application (for example a Java Console Application Project) that helps us reproduce the same exception on our end and attach it here for testing. Thanks for your cooperation.

Best regards,

The test still fails with the NPE, even if I download the document as you indicated in the link. I don’t see the point of making another application, I can’t think of a simpler app than the one I sent you.


It may be that the issue is specific to my version of java which is this:

java version "1.7.0_21"
OpenJDK Runtime Environment (IcedTea 2.3.9) (7u21-2.3.9-1ubuntu1)
OpenJDK 64-Bit Server VM (build 23.7-b01, mixed mode)

I say this because I ran the code without error using this JVM:

java version "1.7.0_21"
Java™ SE Runtime Environment (build 1.7.0_21-b11)
Java HotSpot™ Client VM (build 23.21-b01, mixed mode)

Did you do any testing using OpenJDK/IcedTea?

Hi,


Thanks for the additional information and I apologize for your inconvenience. I was having a few variants of JVM 1.7 installed on the Ubuntu VM on my side, but, when I referenced the correct OpenJDK in my Java project, I managed to reproduce the same exception. I have now logged this issue in our bug tracking system. The issue ID is WORDSJAVA-726. Your request has also been linked to this issue and you will be notified as soon as it is resolved. Sorry for the inconvenience.

Best regards,

The issues you have found earlier (filed as WORDSJAVA-726) have been fixed in this Aspose.Words for .NET update and this Aspose.Words for Java update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.