Free Support Forum - aspose.com

FileCorruptedException reading file from Websphere 6 (Aspose.Words Java)

Hi Everyone! I’m dealing with an issue when I create a com.aspose.words.Document from Websphere 6 using Aspose.Words for Java (last version). Actually, it works great under tomcat (i used tomcat 5.5 for development), but when I deploy the EAR file to Websphere, it throws me an com.aspose.words.FileCorruptedException trying to open ANY word file (.doc not .docx…i’ve tried with even a simple text word file with no luck…)
Does anybody knows why this could happen?? I’m using Aspose.Words.Java.2.4.2 btw

Append the code where it fails…

I’ve tried this

Document doc = new Document(file.getAbsolutePath());

And this

Document doc = new Document(file.getAbsolutePath(),LoadFormat.DOC,null);

And this…

FileInputStream is = new FileInputStream(new File(file.getAbsolutePath()));
Document doc = new Document(is);

And the exception is

INFO 2008-06-24 20:06:23,363readContent : com.aspose.words.FileCorruptedException: The document appears to be corrupted and cannot be loaded.
at com.aspose.words.Document.a(Unknown Source)
at com.aspose.words.Document.a(Unknown Source)
at com.aspose.words.Document.(Unknown Source)
at com.bci.author.domain.dataImport.WordFileReader.readContent(WordFileReader.java:119)

Thanks in advance
Regards!!


Hi Kenneth,

Probably, IBM JIT conflicts with our last code optimization…

Please, try turn of the JIT on IBM JVM. If all works without JIT I will send you non-optimized version of Aspose.Words that works with JIT.

In that case I need in your jdk version (1.4, 1.5 or 1.6). And, please, provide me your e-mail – you can use buttons Contact|Send an e-mail.

Best Regards,

Yes, it was the JIT that was causing the issue. Its all working great now!

Thanks a lot, take care!