Free Support Forum - aspose.com

Cannot save to HTML

Hello,



I cannot save a document to HTML using Aspose.Words JAVA 2.3.0.0.

Here is the very simple code I use :

public static void main(String[] args) throws Exception {
License lic = new License();
lic.setLicense(“D:\Aspose\Aspose.Words.Java\Aspose.Words.lic”);
Document doc = new Document(“Docs\test.doc”);
doc.save(“Docs\OUTPUT_ASPOSE.html”, SaveFormat.HTML);
}

And the exception I got :

Exception in thread “main” java.lang.NoClassDefFoundError: javax/xml/stream/XMLOutputFactory
at com.aspose.words.internal.dv.(Unknown Source)
at com.aspose.words.gr.(Unknown Source)
at com.aspose.words.dh.(Unknown Source)
at com.aspose.words.ei.b(Unknown Source)
at com.aspose.words.Document.a(Unknown Source)
at com.aspose.words.Document.save(Unknown Source)
at MainXHTMLGenerator.main(MainXHTMLGenerator.java:205)

I also attached a document I cannot save to this format.

Thank you.

Hi

Thanks for your request. It seems that you missed to add references to jsr173_1.0_api.jar and sjsxp.jar.

Best regards.