Free Support Forum - aspose.com

Can not load a document in websphere5

HI,
when use new Document(is),(is is a inputStream),in websphere5, windows,it throws such Exception:

Caused by: java.lang.IllegalStateException: java.nio.charset.UnsupportedCharsetException: x-mswin-936
at asposewobfuscated.ks.yI(Encoding.java:482)
at asposewobfuscated.ks.yE(Encoding.java:241)
at asposewobfuscated.ks.m(Encoding.java:445)
at asposewobfuscated.le.e(PropertySetSection.java:418)
at asposewobfuscated.le.c(PropertySetSection.java:230)
at asposewobfuscated.le.(PropertySetSection.java:97)
at asposewobfuscated.co.(PropertySet.java:57)
at com.aspose.words.do.d(DocPropertiesFiler.java:53)
at com.aspose.words.do.a(DocPropertiesFiler.java:41)
at com.aspose.words.rf.b(DocReader.java:81)
at com.aspose.words.Document.b(Document.java:1280)
… 48 more
Caused by: java.nio.charset.UnsupportedCharsetException: x-mswin-936
at java.nio.charset.Charset.forName(Charset.java:453)
at asposewobfuscated.ks.yI(Encoding.java:478)
… 58 more


bellow is the charset in the jvm:

[Big5, CESU-8, COMPOUND_TEXT, EUC-CN, EUC-JP, EUC-KR, EUC-TW, GB18030, GB2312, GBK, hp-roman8, IBM-037, IBM-1006, IBM-1025, IBM-1026, IBM-1027, IBM-1041, IBM-1043, IBM-1046, IBM-1046S, IBM-1047, IBM-1088, IBM-1097, IBM-1098, IBM-1112, IBM-1114, IBM-1115, IBM-1122, IBM-1123, IBM-1124, IBM-1140, IBM-1141, IBM-1142, IBM-1143, IBM-1144, IBM-1145, IBM-1146, IBM-1147, IBM-1148, IBM-1149, IBM-1351, IBM-1362, IBM-1363, IBM-1363C, IBM-1364, IBM-1370, IBM-1371, IBM-1380, IBM-1381, IBM-1382, IBM-1383, IBM-1385, IBM-1386, IBM-1388, IBM-1390, IBM-1399, IBM-273, IBM-277, IBM-278, IBM-280, IBM-284, IBM-285, IBM-290, IBM-297, IBM-300, IBM-301, IBM-33722, IBM-33722C, IBM-420, IBM-420S, IBM-424, IBM-437, IBM-500, IBM-737, IBM-775, IBM-808, IBM-833, IBM-834, IBM-835, IBM-836, IBM-837, IBM-838, IBM-850, IBM-852, IBM-855, IBM-856, IBM-857, IBM-858, IBM-859, IBM-860, IBM-861, IBM-862, IBM-863, IBM-864, IBM-864S, IBM-865, IBM-866, IBM-867, IBM-868, IBM-869, IBM-870, IBM-871, IBM-874, IBM-875, IBM-897, IBM-918, IBM-921, IBM-922, IBM-924, IBM-927, IBM-930, IBM-932, IBM-933, IBM-935, IBM-937, IBM-939, IBM-942, IBM-942C, IBM-943, IBM-943C, IBM-947, IBM-948, IBM-949, IBM-949C, IBM-950, IBM-951, IBM-954, IBM-954C, IBM-964, IBM-971, ISCII91, ISO-2022-CN, ISO-2022-CN-GB, ISO-2022-JP, ISO-2022-KR, ISO-8859-1, ISO-8859-10, ISO-8859-13, ISO-8859-14, ISO-8859-15, ISO-8859-16, ISO-8859-2, ISO-8859-3, ISO-8859-4, ISO-8859-5, ISO-8859-6, ISO-8859-6S, ISO-8859-7, ISO-8859-8, ISO-8859-9, JIS0201, JIS0208, JIS0212, Johab, KOI8-R, KOI8-RU, KOI8-U, KSC5601, MacArabic, MacCentralEurope, MacCroatian, MacCyrillic, MacDingbat, MacGreek, MacHebrew, MacIceland, MacRoman, MacRomania, MacSymbol, MacThai, MacTurkish, MacUkraine, PTCP154, Shift_JIS, TIS-620, US-ASCII, UTF-16, UTF-16BE, UTF-16LE, UTF-32, UTF-32BE, UTF-32LE, UTF-8, UTF-8J, windows-1250, windows-1251, windows-1252, windows-1253, windows-1254, windows-1255, windows-1256, windows-1256S, windows-1257, windows-1258, windows-874, windows-932, windows-936, windows-949, windows-950, X-UnicodeBig, X-UnicodeLittle]

as long as u see, the windows-936 exists, but not the x-mswin-936,may be aspose.word should conside the compatibility of such envirentment.

Hi Kun,

Try using this code in place of loading the stream into a new document object and see if that solves the issue:


Document doc = new Document(is,"",LoadFormat.HTML,"");
doc.save("document out.doc", SaveFormat.DOC);

Thanks,

hi,
this will not solve the problem, and the document is not html format at all, it’s word format.

Hi Kun,

In that case, try using LoadFormat.Doc or LoadFormat.Docx. If this does not work could you please attach your template here for testing.

Thanks,

when use DOC,or DOCX, it throws:
Caused by: java.lang.IllegalStateException: java.nio.charset.UnsupportedCharsetException: UTF-7
at asposewobfuscated.ks.yI(Encoding.java:482)
at asposewobfuscated.ks.yE(Encoding.java:241)
at asposewobfuscated.ks.aa(Encoding.java:460)
at com.aspose.words.fm.hm(FileFormatDetector.java:246)
at com.aspose.words.fm.f(FileFormatDetector.java:38)
at com.aspose.words.Document.b(Document.java:1267)
… 47 more
Caused by: java.nio.charset.UnsupportedCharsetException: UTF-7
at java.nio.charset.Charset.forName(Charset.java:453)
at asposewobfuscated.ks.yI(Encoding.java:478)
… 52 more

and this problem only accurs in WebSphere5, ibm jdk 1.4, it works fine in WebSphere6, tomcat5&6(sun jdk)

so many u guys should add a unitest of websphere5, and by the way the document is created by a simplify chinese edition of ms word, as in the attachement
thx

Hi

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for additional information. Which version of Aspose.Words do you use? Some time ago there was problem with IBM JIT, but it was fixed few releases ago. So please try using the latest version of Aspose.Words for Java. You can download it from here:

http://www.aspose.com/community/files/72/java-components/aspose.words-for-java/category1378.aspx

To check version of Aspose.Words for Java you should unzip Aspose.Words.jdkXX.jar, open META-INF\ MANIFEST.MF file in notepad, you will see the following:

Manifest-Version: 1.0

Specification-Title: Aspose.Words for Java

Implementation-Title: Aspose.Words for Java

Specification-Version: 4.0.0.0

Implementation-Version: 4.0.0.0

Specification-Vendor: Aspose Pty Ltd

Implementation-Vendor: Aspose Pty Ltd

Copyright: Copyright 2003-2009 Aspose Pty Ltd

Best regards,

hi,
Manifest-Version: 1.0
Specification-Title: Aspose.Words for Java
Implementation-Title: Aspose.Words for Java
Specification-Version: 3.3.0.0
Implementation-Version: 3.3.0.0

Specification-Vendor: Aspose Pty Ltd
Implementation-Vendor: Aspose Pty Ltd
Copyright: Copyright 2003-2009 Aspose Pty Ltd
i am wondering whether the aspose.word 4.0.2 beta’s suitable for product envirement, i will take a try and report later, thank you!

Hi Kun,

Yes, you can use either the 4.0.0 or 4.0.2 verison. I suggest using the latest version, 4.0.2. These versions are perfectly safe for deployment, the beta prefix mainly applies to the PDF rendering feature. It is stable though. We will be releasing a new verison of Aspose.Words for Java once the code between platforms is syncronized. This will be sometime in August.

Thanks,

hi,
it dont work in 4.0.2 too, may be it’s the problem of websphere5, we will try to upgrade to websphere6 to solve this problem.
thanks all the same!