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

Free Support Forum - aspose.com

ClassCastException on loading a document

Hello I’m working Aspose Java version 21.11 (but issue exists prior to this version).
I have a document that when loaded (new Document(stream)) raises an exception.

java.lang.ClassCastException: class com.aspose.words.zzXib cannot be cast to class com.aspose.words.zzY5B (com.aspose.words.zzXib and com.aspose.words.zzY5B are in unnamed module of loader 'app')
    at com.aspose.words.zzYG1.zzW9K(Unknown Source)
    at com.aspose.words.zzYG1.zzWuo(Unknown Source)
    at com.aspose.words.zzZET.zzWuo(Unknown Source)
    at com.aspose.words.zzZET.zzWuo(Unknown Source)
    at com.aspose.words.zzZET.zzWg7(Unknown Source)
    at com.aspose.words.zzZET.zzWuo(Unknown Source)
    at com.aspose.words.zzZET.zzWg7(Unknown Source)
    at com.aspose.words.zzZET.zzWuo(Unknown Source)
    at com.aspose.words.zzZET.zzWg7(Unknown Source)
    at com.aspose.words.zz3z.zzWuo(Unknown Source)
    at com.aspose.words.zz3z.zzWuo(Unknown Source)
    at com.aspose.words.zz3z.zzWuo(Unknown Source)
    at com.aspose.words.zzXZ4.zzXM6(Unknown Source)
    at com.aspose.words.zzqg.zzXM6(Unknown Source)
    at com.aspose.words.Document.zzXou(Unknown Source)
    at com.aspose.words.Document.zzWuo(Unknown Source)
    at com.aspose.words.Document.<init>(Unknown Source)
    at com.aspose.words.Document.<init>(Unknown Source)
    at com.aspose.words.Document.<init>(Unknown Source)
    at com.peopledoc.aspose.App.readADoc(App.java:13)
    at com.peopledoc.aspose.AppTest.shouldAnswerWithTrue(AppTest.java:20)

I have not been given the permission to provide an example document yet.
But wanted to ask anyway if the issue was already raised.
I found nothing on the forum.

@PierreS,
It seems that your issue haven’t been raised yet.
Could you please, if possible, provide us a simplified example document with same issue, which does not contain any private information, that will help us to reproduce the same issue on our side? We will check it and provide you more information about your issue.

I was given the right to provide the file.
It is in a maven project.

testProject.zip (21.3 KB)

Pierre

@PierreS Thank you for additional information. I have managed to reproduce the problem and logged it as WORDSNET-23215. We will keep you informed and let you know once it is resolved.
Also, please not that MS Word also reports the document has problems and opens it with repairs.

The issues you have found earlier (filed as WORDSNET-23215) have been fixed in this Aspose.Words for Java 22.1 update.