JSP Problem: Error parsing SMILES

ChemAxon 909aee4527

27-01-2010 09:15:39

From a client:


A problem with Marvin Sketch and Ajax.
If I do a document.MSketch.setMol(xmlhttp.responseText), Marvin Sketch
is not able to display the molecule. I get the error "...Cannot
recognize format...".

xmlhttp.responseText contains SMILES of molecules retrieved from the database.
I have tried document.MSketch.setMol(xmlhttp.responseText, "smiles"), that gives "...Error parsing SMILES....".

Attached are the files for your reference, which needs to be placed in
the root of marvin folder (as you may see from CODEBASE parameter in
the applet).

I am using MySQL database.

ChemAxon 909aee4527

27-01-2010 09:24:17

Please try to replace in check.jsp the following code part:


while(result.next())
 {
    out.print("'"+result.getString("REACTANT1")+"'");
 }

with this one:


while(result.next())
 {
    out.print(result.getString("REACTANT1"));
 }

Attached is a test set, where only the first molecule seems to cause an error.

ChemAxon 909aee4527

27-01-2010 09:29:58

From client:


As I had mentioned, xmlhttp.responseText returns just the SMILES of
molecules from the database. Hence when I execute
alert(xmlhttp.responseText) it displays SMILES. I have attached a
screenshot of such an alert.

I have also added the alert statement in the .js file for you to run and see.

There was a small error in the code in the check.jsp file, which I
have corrected. Now Marvin Sketch doesn't display any errors, but it
doesn't display the structure either. I have no way to understand whats
wrong.

Attached are the updated files.

 


(Please note that the quoted text does not follow the exact communication. Since there were many internal e-mails in this topic (mainly in Hungarian), it is not possible to post the communication in its original form.)

ChemAxon 7c2d26e5cf

29-01-2010 17:10:34

I guess that the same problem was reported in the linking topic.


Problem displaying structures from MySQL database with Ajax


Roland has already answered that question there.