MarvinView with FireFox and IE

User 3898c01b63

25-01-2006 23:21:58

www.bindingDB.org uses JSP, together with marvin.js and JChemSearch to present chemical structures. Mol file is delivered with a string. Please refer to the following codes:





---codes fragment begin----


//check whether structures are duplicated in the DB


ConnectionHandler conHandler = new ConnectionHandler();


conHandler.setUrl(bundle.getString("URL"));


conHandler.setDriver(bundle.getString("driver"));


conHandler.setLoginName(bundle.getString("dbLogin"));


conHandler.setPassword(bundle.getString("dbPassword"));


conHandler.connect();


JChemSearch searcher = new JChemSearch();// Create searcher object





String molfile = request.getParameter("molfile");





searcher.setQueryStructure(molfile);


searcher.setConnectionHandler(conHandler);


searcher.setStructureTable("BIND_2000_05.MONOMER_STRUCT");


searcher.setWaitingForResult(true);





String SearchType = request.getParameter("SearchType");


int int_SearchType = Integer.parseInt(SearchType);


switch (int_SearchType) {


case 3:


String Similarity = request.getParameter("Similarity");


double dp_Similarity = atof(Similarity);


if (dp_Similarity > 1.0 || dp_Similarity < 0.0)


dp_Similarity = 0.8;


float ft_Similarity = (float) (1.0 - dp_Similarity);


searcher.setSearchType(JChemSearch.SIMILARITY);


searcher.setDissimilarityThreshold(ft_Similarity);


break;


case 4:


searcher.setSearchType(JChemSearch.EXACT);


break;


default:


break;


}


searcher.run();


---codes fragment end----





searcher.run(); works fine with IE, but for some molecules firefox does not work well.





The error message is


---Message begin---


chemaxon.formats.MolFormatException: java.io.IOException: file format not recognized


at chemaxon.util.MolHandler.toMolFormatException(MolHandler.java:667)


at chemaxon.util.MolHandler.importMol(MolHandler.java:655)


at chemaxon.util.MolHandler.setMolecule(MolHandler.java:162)


at chemaxon.jchem.db.JChemSearch.initQuery(JChemSearch.java:2458)


at chemaxon.jchem.db.JChemSearch.init(JChemSearch.java:2528)


at chemaxon.jchem.db.JChemSearch.search1(JChemSearch.java:1960)


at chemaxon.jchem.db.JChemSearch.search(JChemSearch.java:1862)


at chemaxon.jchem.db.JChemSearch.setRunning(JChemSearch.java:1740)


at chemaxon.jchem.db.JChemSearch.run(JChemSearch.java:1760)


at org.apache.jsp.bind.chemsearch.marvin.SearchMol_jsp._jspService(org.apache.jsp.bind.chemsearch.marvin.SearchMol_jsp:238)


at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)


at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)


at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)


at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)


at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)


at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)


at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)


at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)


at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)


at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)


at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:541)


at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)


at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)


at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:868)


at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:663)


at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)


at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)


at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)


at java.lang.Thread.run(Unknown Source)


---Message end---





Thank you for the help.

ChemAxon 7c2d26e5cf

27-01-2006 15:09:34

Probably, you try to read an invalid molecule or the molecure is in wrong format.


Can you send me the generated HTML (that includes the molecule string)?


The following example demonstrates how to encode molecule string in HTML.


http://www.chemaxon.com/marvin/doc/dev/example-sketch3.2.html

ChemAxon 9c0afc9aaf

30-01-2006 09:03:21

Tamas, you misunderstood the problem.





The problem is not about displaying the structure, but the source of the query structure that is sent to the server for search.





Liut,





Probably the structure source gets corrupted when sending it to the server.





Please


- send us a query structure that behaves incorrectly (you can save it from the applet as a file, and attach it here also as a file)


- let us know the exact Firefox version and the Java version on the client side (this is displayed by Help -> about Java VM in the applet)


- let me know the exact version of Tomcat and the Java version it's running on


- the JChem version on the server





You can look for changes in the structure source the following ways:


- in the browser, you can print it out with an alert() javascript call


- on the server side you may print it to the standard error stream, which is logged by Tomcat


We had a former complaint where the leading empty line from the molfile tended to disappear. This was not fully debugged as the customer was happy with a workaround. This time I would like to get to the bottom of this with your help.





Best regards,





Szilard





PS: we suggest the more capable "mrv" format (especially in later versions), as it can describe non-MDL query features too.


Although changing the format would probably solve your problem instantly, I'm really curious about the cause of the current problem.

30-01-2006 13:22:57

Hi Tamas,





Please go to


http://www.bindingdb.org/bind/chemsearch/marvin/MolStructure.jsp?monomerid=578&entryid=326. It works fine with IE, but not for FireFox.





http://www.bindingdb.org/bind/chemsearch/marvin/MolStructure.jsp?monomerid=4699&entryid=640. It works fine for both IE and FireFox.





The program takes Molfile string from our database. The data stored span


for five years. Molfile is passed as a string by browser. Is it possible


for browser to add something that JChemSearch cannot recognize?





Please try them, and give me instructions.





Thank you very much.





Tiqing

ChemAxon 9c0afc9aaf

30-01-2006 15:06:56

Hi,





I am glad to confirm that problem is not related to our code.





You set the hidden variable containing the structure source in a plain HTML code (not in JavaScript).


In this case Firefox seems to ignore the empty line at the start of the string , so when you post it for further processing this line is missing.





With the empty line removed it is not a legal molfile any more, so JChem throws an exception of course.





You can overcome this problem, if the hidden variable is set by a javascript function - this can be triggered by the onSubmit attribute of the form tag.





Best regards,





Szilard

User 3898c01b63

30-01-2006 15:55:07

Thank you for the help. I added some string to the beginning of the hidden Molfile string, and the program runs well.





Tiqing