Receive the following error:
Error occured while opening the document
java.lang.IllegalStateException: Unknown file format.
at com.aspose.words.Document.a(Unknown Source)
at com.aspose.words.Document.(Unknown Source)
at com.aspose.words.Document.(Unknown Source)
at com.aspose.words.Document.(Unknown Source)
Code:
com.aspose.words.Document doc = new com.aspose.words.Document(service.readDoc(fileId));
Where "service.readDoc" is
public InputStream readDoc(String strDocSeqNo) throws Exception {
logger.entry("readDoc");
// query to retrieve the document.
String GETDOC = "select docBdy from Docs where docSeqNo=:searchString";
// executethe query.
List l = HibernateUtil.retrieveObjs(GETDOC, strDocSeqNo.trim());
logger.exit("readDoc");
// return the document as an inputstream.
return ((Blob) l.get(0)).getBinaryStream();
}// end of method - readDoc().
Have also tried the code below without success:
com.aspose.words.Document doc = new com.aspose.words.Document(service.readDoc(fileId), "", LoadFormat.FORMAT_DOCUMENT, "");
Also, when using this parameter, LoadFormat.FormatDocument, I get "LoadFormat cannot be resolved" error.