I’m using Aspose.Words.jdk14.jar in a web application running under Tomcat. This jar is located into the lib directory of my application and there also I pasted the licence file Aspose.Custom.lic
So, before I use any Document instance I called the next method :
Strange, one of my test configurations is exactly as your one and all works fine. May be Tomcat loads your application from another folder? May be some old configuration still remains in Tomcat’s cashes…
The last test works as expected in your environment. So we have to try more verbose test. But first of all, please, reload your Tomcat and check are you using the last Aspose.Words release. Here is the code:
Sorry for delay. The last test code doesn’t loads the license – it is just a simplified emulation how Aspose.Words finds the license file in the “root” dir. So, what we have after these tests.
Tomcat. The file with ‘licenseName’ name doesn’t exist in the folder named ‘folder’ OR it can’t be opened from under Tomcat because of security reasons. – Please, check your Tomcat configuration, file name and “root” folder.
WebSphere. Aspose.Words can locate and open the license file as a stream. You just have to use setLicense() as usual to set the license.
Any way you have to know that Aspose.Words does support Tomcat and WebSphere – we just have to locate what is wrong with configuration of your environment.
Finally it loads correctly the licence file. Thanks for your help.
Unfortunatelly now I’m dealing now with an issue when I create a com.aspose.words.Document (still Websphere 6 ) . Actually, it works great under tomcat (i used tomcat 5.5 for development as I said above), 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…)
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
[8/11/08 17:16:21:177 EDT] 0000001d SystemErr R 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.aspose.words.Document.(Unknown Source)