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

Free Support Forum - aspose.com

Java ClassCastException: class com.aspose.words.Shape cannot be cast to class com.aspose.words.Paragraph

Hi,

We are using Aspose.Total license and are getting the following Java ClassCastException when trying to update a MS Word document (*.docx):
java.lang.ClassCastException: class com.aspose.words.Shape cannot be cast to class com.aspose.words.Paragraph

Word has no problem reading the source file and neither has several online viewers I have tested.
We are using your latest Java library aspose-words-22.3-jdk17.jar.

To reproduce in Java, just open and save the document:

Document doc = new Document(filename);
doc.save(filename);

Please check the attached Word file: input.docx (398.3 KB)

@tommyR Thank you for reporting this problem to us. For a sake of correction it has been logged as WORDSJAVA-2708. We will keep you informed and let you know once it is resolved.