Getting MarvinSketch to output InChI

User 9fd402adb0

17-03-2008 11:52:48

Hello,





(Marvin Version 5.0.1, running on Microsoft Windows Server 2003, IIS.)





I'm struggling, even after a clean install of marvin-all-5_0_01.zip, to get MarvinSketch to output InChI. Every time I attempt it (embedded in a file search_both.php), with exportMol('inchi'); which points to





function exportMol(format) {


if(document.MSketch != null) {


var s = document.MSketch.getMol(format);


document.MolForm.mol.value = s;


} else {


alert("Cannot import molecule:\n"+


"no JavaScript to Java communication in your browser.\n");


}


}





I get the standard "Marvin caught a SecurityException" message. exportMol('smiles'), exportMol('mol'), exportMol('pdb') all work fine.





If I look at the server logs (slightly trimmed to save space, response code first to see where it's 404ing), I see this:





200: 2008-03-17 11:03:47 GET /marvin/sjars/inchi.jar


200: 2008-03-17 11:03:47 POST /marvin/examples/search_both.php


404: 2008-03-17 11:03:47 GET /marvin/META-INF/services/javax.xml.parsers.DocumentBuilderFactory


404: 2008-03-17 11:03:47 GET /marvin/META-INF/services/javax.xml.transform.TransformerFactory


404: 2008-03-17 11:03:47 GET /marvin/META-INF/services/com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager


404: 2008-03-17 11:03:47 GET /marvin/META-INF/services/javax.xml.parsers.DocumentBuilderFactory


404: 2008-03-17 11:03:47 GET /marvin/META-INF/services/javax.xml.transform.TransformerFactory


404: 2008-03-17 11:03:47 GET /marvin/META-INF/services/com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager





(I'm pretty sure the 404s aren't relevant because they also appear in the SMILES- or mol-only searches, which don't produce the SecurityException.) So it looks as if inchi.jar is trying to access something on the server that it doesn't have access to. Is it one of the inchi-native-* jars?





Do I need to add the inchi-native-* jar files to the MANIFEST.MF file in jmarvin.jar, and, if so, what are their SHA1-Digest strings?





Looking forward to your reply,


Colin Batchelor,


--


Dr Colin Batchelor MChem MRSC, Production Systems Analyst


Informatics Department,


Royal Society of Chemistry, Thomas Graham House, Cambridge UK CB4 0WF


batchelorc _at_ rsc.org t: +44 1223 432280

ChemAxon 7c2d26e5cf

17-03-2008 13:39:22

Inchi import / export requires a native lib. It is wrapped into the platform specific jar file that has to be in the same directory than jmarvin.jar.


Please check that the following jars are in the Marvin Applet's home directory (beside jmarvin.jar).


Code:
inchi-native-windows-1_1.jar


inchi-native-linux-1_1.jar   


inchi-native-macosx-1_1.jar


inchi-native-macosx-ppc-1_1.jar



If these files exist, the problem may be by downloading. Please check the access log of your server and/or the network traffic of Java in the Java console. (Open Java consol and set debug level to 3 to print network traffic of the applet.)


Have you tried inchi in Marvin applets from the ChemAxon site? Does it work for you? If not, the problem can be the client side.


I also suggest to test inchi export via the Edit/Source menu in the applet. If it works there but not from JavaScript, it can be a JavaScript issue.

User 9fd402adb0

17-03-2008 14:34:50

Hello Tamas,





Thanks for this.





(1) all of the inchi-native-*.jar files are in the same directory as jmarvin.jar.





(2) I have had a go at testing InChI export via Edit/Source in the applet, and that works beautifully:





InChI=1/C20H30/c1-6-16-8-2-10-18(16)12-4-14-20(18)15-5-13-19(20)11-3-9-17(16,19)7-1/h1-15H2


AuxInfo=1/0/N:2,7,18,12,17,3,1,6,19,8,20,11,14,13,16,4,5,9,15,10/E:(1,2,3,4,5)(6,7,8,9,10,11,12,13,14,15)(16,17,18,19,20)/rA:20nCCCCCCCCCCCCCCCCCCCC/rB:s1;s2;s3;s1s4;s4;s6;s7;s4s8;s9;s9;s11;s10s12;;s5s10s14;s10;s14s16;;s5s18;s15s18;/rC:-2.7704,.3757,0;-3.4379,-.1092,0;-3.183,-.8938,0;-2.3579,-.8938,0;-2.103,-.1092,0;-3.0254,-1.3787,0;-2.7704,-2.1633,0;-1.9454,-2.1633,0;-1.6905,-1.3787,0;-1.0231,-.8938,0;-1.4356,-2.1633,0;-.6106,-2.1633,0;-.3557,-1.3787,0;-.6106,.3757,0;-1.278,-.1092,0;-.1981,-.8938,0;.0568,-.1092,0;-1.6905,1.1603,0;-2.3579,.6753,0;-1.0231,.6753,0;





(3) So on looking at the network traffic I get this:





network: Connecting http://xx.yy.zz.aa/marvin/chemaxon/marvin/templates/custom.t with proxy=DIRECT


network: Connecting http://xx.yy.zz.aa/marvin/chemaxon/marvin/templates/custom.t with cookie [DELETED]


java.lang.SecurityException: Unable to create temporary file


at java.io.File.checkAndCreate(Unknown Source)


at java.io.File.createTempFile(Unknown Source)


at java.io.File.createTempFile(Unknown Source)


at chemaxon.marvin.io.formats.inchi.InchiExport.b(Unknown Source)


at chemaxon.marvin.io.formats.inchi.InchiExport.convert(Unknown Source)


at chemaxon.struc.Molecule.a(Unknown Source)


at chemaxon.struc.Molecule.exportToObject(Unknown Source)


at chemaxon.struc.Molecule.exportToFormat(Unknown Source)


at chemaxon.struc.Molecule.toFormat(Unknown Source)


at JMSketch.getMol(Unknown Source)





and so forth. Is it likely to be a permissions problem with wherever the temporary file is supposed to be created?





Best wishes,


Colin.

ChemAxon 7c2d26e5cf

17-03-2008 15:19:13

Inchi tries to write a temporary file to the local machine but it fails.


Probably, it can be a platform specific issue.


Can you describe your software environment?


- brower type


- java version


Does the current user have got administrator priviliges or not?


Does other I/O operation (like File/Open or File/Save) work from the applet?

User 9fd402adb0

18-03-2008 10:04:33

Hello,





Browser: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.1.12) Gecko/20080201 Firefox/2.0.0.12





java version "1.5.0_14"


Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_14-b03)


Java HotSpot(TM) Client VM (build 1.5.0_14-b03, mixed mode, sharing)





Other input/output operations like File/Open and File/Save work fine from the applet.





Best wishes,


Colin.

ChemAxon 7c2d26e5cf

19-03-2008 16:11:36

Indeed. I have managed to reproduce it.


Thanks for the bug report. We will debug it.

User b78df45c95

05-06-2008 07:01:35

Hello,


is there any progress with this issue? I seem to hit the same problem.





Best regards





Beda Kosata

ChemAxon 0a9e2a55e1

05-06-2008 14:34:06

Hello,





We have found that this is a general problem when calling Java applet methods from JavaScripts. Even if the applet is signed, it acts like it is unsigned. We are looking for a workround for this problem. We will notify you when we have solved the problem.





Best Regards


Peter