Error when using Marvin java code in DB with JA16SJIS

User 952e1d9361

17-05-2011 12:46:17

Hello,


We have loaded the marvin.jar into an Oracle 10g (10.2.0.4) database using loadjava so we can parse and read content from SD files inside the database.  This has worked well until we have a user reporting a problem.


The database in question is using the Japanese character set JA16SJIS and the NLS_LANGUAGE and NLS_TERRITORY values are set to JAPANESE / JAPAN respectively.


When they try to invoke the Java code an error is generated which after looking in the trace file seems to boil down to :


 


java.lang.ExceptionInInitializerError

at chemaxon.marvin.io.PositionedInputStream.init(Unknown Source)

at chemaxon.marvin.io.PositionedInputStream.<init>(Unknown Source)

at chemaxon.formats.MolInputStream.<init>(Unknown Source)

at chemaxon.formats.MolInputStream.<init>(Unknown Source)

at chemaxon.formats.MFileFormatUtil.createRecordReader(Unknown Source)

at ImportSDFile.ProcessFile(ImportSDFile:27)

Caused by: java.lang.RuntimeException: The default system encoding "MS932" is unsupported

at chemaxon.marvin.io.Encoding.<clinit>(Unknown Source)

... 6 more




 


This seems to imply that the character set MS932 is not supported?  Is this an issue with the marvin library or is it a fault with Oracle's JVM (although we are using other Java stored procedures successfully).


Any help is gratefully received.


Thanks,


Steve H

ChemAxon aa7c50abf8

17-05-2011 14:11:18

Hello Steve,


There are a number of bugs with this character encoding listed for Java 1.4 (http://www.google.hu/search?hl=en&lr=&safe=active&biw=1333&bih=667&q=MS932+1.4+site%3Abugs.sun.com&aq=f&aqi=&aql=&oq=) and it is not impossible that the JVM in this particular Oracle version is based on a Sun Java version plagued with one those bugs.


Perhaps more importantly, recent Marvin/JChem versions require at least Java 5 -- and starting with version 5.5, Java 6 is required. This contrasts with Java 1.4 in Oracle 10g with which you're experiencing the error. Can the problem be reproduced with Oracle 11.2 (whose Java version would be compatible with Marvin versions prior to 5.5)?


Peter

User 952e1d9361

20-05-2011 15:35:26

Thanks Peter.


We changed the database character set (well, created a new database) to AL32UTF8 instead and all now works as expected.


Steve