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

Free Support Forum - aspose.com

Document doc = new Document() throws error

Document doc = new Document();

When I run the above line of code on a linux instance I get the following error:

com.aspose.words.FileCorruptedException: The document appears to be corrupted and cannot be loaded.
	at com.aspose.words.FileFormatUtil.zzZ(Unknown Source)
	at com.aspose.words.Document.zzY(Unknown Source)
	at com.aspose.words.Document.zzZ(Unknown Source)
	at com.aspose.words.Document.zz5h(Unknown Source)
	at com.aspose.words.Document.(Unknown Source)
	at com.aspose.words.Document.(Unknown Source)
	at com.mycompany.service.AsposeServiceIntegrationSpec.createDocument should create document(AsposeServiceIntegrationSpec.groovy:19)
Caused by: java.lang.NullPointerException
	at com.aspose.words.zzYY0.zzZmc(Unknown Source)
	at com.aspose.words.zzYY0.zzZme(Unknown Source)
	at com.aspose.words.zzYY0.zzzu(Unknown Source)
	at com.aspose.words.zz5.zzTZ(Unknown Source)
	at com.aspose.words.zz5.zzU0(Unknown Source)
	at com.aspose.words.zzYY0.zzZmh(Unknown Source)
	at com.aspose.words.zzYY0.zzZ(Unknown Source)
	at com.aspose.words.zz6Q.visitSectionStart(Unknown Source)
	at com.aspose.words.Section.zzZ(Unknown Source)
	at com.aspose.words.CompositeNode.acceptCore(Unknown Source)
	at com.aspose.words.Section.accept(Unknown Source)
	at com.aspose.words.CompositeNode.acceptChildren(Unknown Source)
	at com.aspose.words.CompositeNode.acceptCore(Unknown Source)
	at com.aspose.words.Document.accept(Unknown Source)
	at com.aspose.words.zz6Q.zzZ(Unknown Source)
	at com.aspose.words.Document.zzY(Unknown Source)
	... 5 more


Any ideas?

Looks like this issue is related to issue 840723


We are using aspose 17.5

In order to reproduce the issue just run the following two lines:
<span style=“background-color: rgb(255, 255, 255); font-family: “Courier New”; font-size: 9pt;”>
<span style=“background-color: rgb(255, 255, 255); font-family: “Courier New”; font-size: 9pt;”>Locale.<span style=“font-family: “Courier New”; font-size: 9pt; font-style: italic;”>setDefault<span style=“background-color: rgb(255, 255, 255); font-family: “Courier New”; font-size: 9pt;”>(<span style=“font-family: “Courier New”; font-size: 9pt; color: rgb(0, 0, 67); font-weight: bold;”>new <span style=“background-color: rgb(255, 255, 255); font-family: “Courier New”; font-size: 9pt;”>Locale(<span style=“font-family: “Courier New”; font-size: 9pt; color: rgb(0, 128, 0); font-weight: bold;”>“en”<span style=“background-color: rgb(255, 255, 255); font-family: “Courier New”; font-size: 9pt;”>))
<pre style=“background-color: rgb(255, 255, 255); font-family: “Courier New”; font-size: 9pt;”><pre style=“font-family: “Courier New”; font-size: 9pt;”>Document doc = new Document()
Hi,

Thanks for your inquiry.

While using the latest version of Aspose.Words for Java 17.5, we managed to reproduce this issue on our end. We have logged this issue in our bug tracking system. The ID of your issue is WORDSJAVA-1571. Your request has been linked to the appropriate issue and you will be notified as soon as it is resolved. Sorry for the inconvenience.

Best regards,

It looks like this issue is now fixed in 17.6.

Thanks!

@andrhahn1,

Yes, the issue does not occur when using Aspose.Words for Java 17.6.
The fix of this issue will officially be integrated in next 17.7 version of Aspose.Words for Java.

Best regards,
Awais Hafeez

@andrhahn1,

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

6 posts were split to a new topic: Exception occurs when specifying Locale before creating a Document object

2 posts were split to a new topic: FileCorruptedException occurs when specifying Locale before creating a Document object