Problem in getting inchi from Sketch

User 5fbed0c6cb

04-02-2010 12:58:50

I have a simple program with Sketch applet. I am trying to get inchi from Sketch. However it returns "null" with a window "Marvin Caught a security exception"  displaying "Error: Marvin cannot load a module, a template or a molecule file .........."


<html>
<head>
<script>
function getformat()
{
    alert("Format = " + document.MSketch.getMol("inchi"));            
}

</script>
</head>
<body>

<applet id="appl" CODEBASE="./" ARCHIVE="appletlaunch.jar" CODE="JMSketchLaunch" WIDTH=760 HEIGHT=300 NAME="MSketch"></applet>

<input type="button" value="Click" onclick="getformat()" />

</body>
</html>



getMol("inchi")

ChemAxon 7c2d26e5cf

05-02-2010 16:05:43

Yes, we know about this problem. See the linking topic:


Marvin Firewall error message when using Marvin applet


It is the shortcomming of JavaScript.


The problem is that inchi import/export working into a temporary directory on your local machine. When you call inchi import/export from JavaScript, The security manager of Java does not access file system operation since the request was received from an untrusted content (JavaScript). If you do inchi import/export inside the Marvin GUI (applet), it works fine since the request is invoked from the applet that is a signed trusted content.


We have some ideas how to modify Marvin applet api to avoid this security issue. We plan to implement it till Marvin 5.4.