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

Free Support Forum - aspose.com

Intermittent issus on document creation

I am using the attached docx content to create a document object but this fails intermittently. On successive calls the document is been created.

Here is the code i use to create the document object

byte[] byteArray

fpByteStream = new ByteArrayInputStream(byteArray);

doc = new Document(fpByteStream)

and the error log

com.aspose.words.FileCorruptedException: The document appears to be corrupted and cannot be loaded.

at com.aspose.words.FileFormatUtil.a(FileFormatUtil.java:98)

at com.aspose.words.Document.b(Document.java:1215)

at com.aspose.words.Document.a(Document.java:1084)

at com.aspose.words.Document.(Document.java:194)

at com.aspose.words.Document.(Document.java:165)

at com.aspose.words.Document.(Document.java:160)

at com.wellsfargo.service.creditview.aspose.words.DocumentUtils.createDocument(DocumentUtils.java:284)

Caused by: java.lang.IllegalStateException: Invalid hex string.

at asposewobfuscated.ke.ae(PalFormatter.java:368)

at com.aspose.words.abz.hn(NrxXmlUtil.java:203)

at com.aspose.words.hk.e(DocxNumberingReader.java:134)

at com.aspose.words.hk.b(DocxNumberingReader.java:40)

at com.aspose.words.go.read(DocxDocumentReaderBase.java:37)

at com.aspose.words.hn.BY(DocxReader.java:63)

at com.aspose.words.hn.read(DocxReader.java:55)

at com.aspose.words.Document.b(Document.java:1164)

... 36 more

Can you please advise why this fails intermittently



Hi Hari,

Thanks for your request. I cannot reproduce the problem on my side. I used the latest version of Aspose.Words and the following code:

// Read document to byte array.

File file = new File("C:\\Temp\\FP-3rd+time.docx");

byte[] fileBytes = getBytesFromFile(file);

// Create inputStream.

ByteArrayInputStream fileStream = new ByteArrayInputStream(fileBytes);

// Open document from stream.

Document doc = new Document(fileStream);

// Save document to file.


You can download the latest version of Aspose.Words from here:


Best regards,