JChemSearch behaves differently in commandline and Tomcat

User 3898c01b63

17-07-2012 21:52:28

  JChenSearch behaves the same in commandline and Tomcat in Windows Server 2008.  Recently, I tried to migrate BindingDB server from Windows Server 2008 to SUSE Linux 12.  Everything works fine except for similarity search with JChemSearch in Tomcat server in SUSE Linux 12.  The jsp file calls a static method for JChemSearch.  However, a new class calling the same static method for JChemSearch does return correct results for similarity JChemSearch.  It is noticed that in $CATALINA_HOME/logs/catalina.out, "InputStream cannot be null" is recorded when JChemSearch is done!


  InputStream cannot be null


  InputStream cannot be null


  Please help!

ChemAxon a3d59b832c

18-07-2012 07:33:30

Dear Liut,


 


Can you tell us which JChem version and RDBMS are you using?


Furthermore, for some reason I cannot access the .jsp file you attached. Can you try to rename it to .txt and attach again?


 


Thanks,


Szabolcs

User 3898c01b63

18-07-2012 16:13:12










Szabolcs wrote:

Dear Liut,


 


Can you tell us which JChem version and RDBMS are you using?


Furthermore, for some reason I cannot access the .jsp file you attached. Can you try to rename it to .txt and attach again?


 


Thanks,


Szabolcs



Dear Szabolcs,


  Thank you for your reply.  ORACLE 11.2 is used as RDBMS.  ss.txt is attached for your review.


  Regards,


Tiqing

User 3898c01b63

18-07-2012 18:45:31










liut wrote:










Szabolcs wrote:

Dear Liut,


 


Can you tell us which JChem version and RDBMS are you using?


Furthermore, for some reason I cannot access the .jsp file you attached. Can you try to rename it to .txt and attach again?


 


Thanks,


Szabolcs



Dear Szabolcs,


  Thank you for your reply.  ORACLE 11.2 is used as RDBMS.  ss.txt is attached for your review.


  Regards,


Tiqing



Dear Szabolcs,


  I tried 5.9, then 5.10 of JChem.  Please download ss.txt, and rename it as tt.jsp

ChemAxon 9c0afc9aaf

19-07-2012 04:24:48

Hi,


Probably the reason is that you have a different xerxes.jar in the classpath of your Tomcat, than what is shipped with our products in our "lib" directory.


Please see this past topic:


https://www.chemaxon.com/forum/ftopic5768.html 


Best regards,


Szilard

User 3898c01b63

19-07-2012 05:59:27










Szilard wrote:

Hi,


Probably the reason is that you have a different xerxes.jar in the classpath of your Tomcat, than what is shipped with our products in our "lib" directory.


Please see this past topic:


https://www.chemaxon.com/forum/ftopic5768.html 


Best regards,


Szilard



Dear Szilard,


  But there is no explicit xerxes.jar in lib of JChem.

ChemAxon 9c0afc9aaf

19-07-2012 06:13:22

Hi, 


 


You are right, newer versions do not contain it any more.


What is your Java vendor and version ?


This little JSP snippet should provide the information:


 


<table border="0" align="center" cellspacing="0" cellpadding="5">
<tr>
<td>JVM:</td>
<td width="30">&nbsp;</td>
<td><%=System.getProperty("java.vendor")
+"<br>"+System.getProperty("java.vm.name")
+"<br>"+System.getProperty("java.version")
%></td>
</tr>
</table>


 


Best,


Szilard

User 3898c01b63

19-07-2012 16:21:36

Hi Szilard,


Here is the response.










JVM:   Oracle Corporation
Java HotSpot(TM) 64-Bit Server VM
1.7.0

or you can click http://gilson-xps3.ucsd.edu/bind/TomcatInfo.jsp

ChemAxon 9c0afc9aaf

23-07-2012 04:41:16

Unfortunately we have no quick answer for this.


I think it's very likely that some library in Tomcat conflicts with our libraries.


Meanwhile please let us know


- Your Tomcat version


- Apart from the printout, what is the problem with similarity search ? No results ? Or exception ?


- Do you see any stack trace in the log file ? Can you paste a section corresponding to a couple of searches ?

User 3898c01b63

23-07-2012 05:21:47

Hi Szilard,


  The version of the Tomcat is 7.0.22.


  For JChemSerch with a SMILE String, substructure (2), exact (4), or perfect (5) searches works fine, but similarity search (3) return null.  But in commandline, the same method doing JChemSearch works very well for 2, 3, 4, and 5.


  When JChemSearch is invoked, the message is "InputStream cannot be null" in catalina.out as posted before.


  The following links are invoked to Tomcat 6, java 6, and Windows Server 2008


1.4 Exact JChemSearch: http://bindingdb.org/bind/searchby_smiles.jsp?submit=Search&startPg=0&Increment=15&SearchType=4&smilesStr=CCC%28C%29CC%28C%29CCCCCCCCC%28=O%29NC1C[C@@H]%28O%29[C@H]%28NC%28=O%29C2CN%28C[C@@H]2O%29C%28=O%29[C@@H]%28NC%28=O%29[C@@H]%28NC%28=O%29C2C[C@@H]%28O%29CN2C%28=O%29[C@@H]%28NC1=O%29[C@@H]%28C%29O%29[C@H]%28O%29[C@@H]%28O%29c1ccc%28O%29cc1%29[C@H]%28O%29CCNC%28=O%29[C@@H]%28N%29CN%29OCCN&molfile=CCC%28C%29CC%28C%29CCCCCCCCC%28=O%29NC1C[C@@H]%28O%29[C@H]%28NC%28=O%29C2CN%28C[C@@H]2O%29C%28=O%29[C@@H]%28NC%28=O%29[C@@H]%28NC%28=O%29C2C[C@@H]%28O%29CN2C%28=O%29[C@@H]%28NC1=O%29[C@@H]%28C%29O%29[C@H]%28O%29[C@@H]%28O%29c1ccc%28O%29cc1%29[C@H]%28O%29CCNC%28=O%29[C@@H]%28N%29CN%29OCCN&Similarity=0.9


1.3 Similarity JChemSearch: http://bindingdb.org/bind/searchby_smiles.jsp?submit=Search&startPg=0&Increment=15&SearchType=3&smilesStr=CCC%28C%29CC%28C%29CCCCCCCCC%28=O%29NC1C[C@@H]%28O%29[C@H]%28NC%28=O%29C2CN%28C[C@@H]2O%29C%28=O%29[C@@H]%28NC%28=O%29[C@@H]%28NC%28=O%29C2C[C@@H]%28O%29CN2C%28=O%29[C@@H]%28NC1=O%29[C@@H]%28C%29O%29[C@H]%28O%29[C@@H]%28O%29c1ccc%28O%29cc1%29[C@H]%28O%29CCNC%28=O%29[C@@H]%28N%29CN%29OCCN&molfile=CCC%28C%29CC%28C%29CCCCCCCCC%28=O%29NC1C[C@@H]%28O%29[C@H]%28NC%28=O%29C2CN%28C[C@@H]2O%29C%28=O%29[C@@H]%28NC%28=O%29[C@@H]%28NC%28=O%29C2C[C@@H]%28O%29CN2C%28=O%29[C@@H]%28NC1=O%29[C@@H]%28C%29O%29[C@H]%28O%29[C@@H]%28O%29c1ccc%28O%29cc1%29[C@H]%28O%29CCNC%28=O%29[C@@H]%28N%29CN%29OCCN&Similarity=0.9


1.2 Substructure JChemSearch: http://bindingdb.org/bind/searchby_smiles.jsp?submit=Search&startPg=0&Increment=15&SearchType=2&smilesStr=CCC%28C%29CC%28C%29CCCCCCCCC%28=O%29NC1C[C@@H]%28O%29[C@H]%28NC%28=O%29C2CN%28C[C@@H]2O%29C%28=O%29[C@@H]%28NC%28=O%29[C@@H]%28NC%28=O%29C2C[C@@H]%28O%29CN2C%28=O%29[C@@H]%28NC1=O%29[C@@H]%28C%29O%29[C@H]%28O%29[C@@H]%28O%29c1ccc%28O%29cc1%29[C@H]%28O%29CCNC%28=O%29[C@@H]%28N%29CN%29OCCN&molfile=CCC%28C%29CC%28C%29CCCCCCCCC%28=O%29NC1C[C@@H]%28O%29[C@H]%28NC%28=O%29C2CN%28C[C@@H]2O%29C%28=O%29[C@@H]%28NC%28=O%29[C@@H]%28NC%28=O%29C2C[C@@H]%28O%29CN2C%28=O%29[C@@H]%28NC1=O%29[C@@H]%28C%29O%29[C@H]%28O%29[C@@H]%28O%29c1ccc%28O%29cc1%29[C@H]%28O%29CCNC%28=O%29[C@@H]%28N%29CN%29OCCN&Similarity=0.9


On the other hand, the following links are invoked to Tomcat 7, java 7, and SUSE 12


2.4 Exact JChemSearch: http://gilson-xps3.ucsd.edu/bind/searchby_smiles.jsp?submit=Search&startPg=0&Increment=15&SearchType=4&smilesStr=CCC%28C%29CC%28C%29CCCCCCCCC%28=O%29NC1C[C@@H]%28O%29[C@H]%28NC%28=O%29C2CN%28C[C@@H]2O%29C%28=O%29[C@@H]%28NC%28=O%29[C@@H]%28NC%28=O%29C2C[C@@H]%28O%29CN2C%28=O%29[C@@H]%28NC1=O%29[C@@H]%28C%29O%29[C@H]%28O%29[C@@H]%28O%29c1ccc%28O%29cc1%29[C@H]%28O%29CCNC%28=O%29[C@@H]%28N%29CN%29OCCN&molfile=CCC%28C%29CC%28C%29CCCCCCCCC%28=O%29NC1C[C@@H]%28O%29[C@H]%28NC%28=O%29C2CN%28C[C@@H]2O%29C%28=O%29[C@@H]%28NC%28=O%29[C@@H]%28NC%28=O%29C2C[C@@H]%28O%29CN2C%28=O%29[C@@H]%28NC1=O%29[C@@H]%28C%29O%29[C@H]%28O%29[C@@H]%28O%29c1ccc%28O%29cc1%29[C@H]%28O%29CCNC%28=O%29[C@@H]%28N%29CN%29OCCN&Similarity=0.9


2.3 Similarity JChemSearch: http://gilson-xps3.ucsd.edu/bind/searchby_smiles.jsp?submit=Search&startPg=0&Increment=15&SearchType=3&smilesStr=CCC%28C%29CC%28C%29CCCCCCCCC%28=O%29NC1C[C@@H]%28O%29[C@H]%28NC%28=O%29C2CN%28C[C@@H]2O%29C%28=O%29[C@@H]%28NC%28=O%29[C@@H]%28NC%28=O%29C2C[C@@H]%28O%29CN2C%28=O%29[C@@H]%28NC1=O%29[C@@H]%28C%29O%29[C@H]%28O%29[C@@H]%28O%29c1ccc%28O%29cc1%29[C@H]%28O%29CCNC%28=O%29[C@@H]%28N%29CN%29OCCN&molfile=CCC%28C%29CC%28C%29CCCCCCCCC%28=O%29NC1C[C@@H]%28O%29[C@H]%28NC%28=O%29C2CN%28C[C@@H]2O%29C%28=O%29[C@@H]%28NC%28=O%29[C@@H]%28NC%28=O%29C2C[C@@H]%28O%29CN2C%28=O%29[C@@H]%28NC1=O%29[C@@H]%28C%29O%29[C@H]%28O%29[C@@H]%28O%29c1ccc%28O%29cc1%29[C@H]%28O%29CCNC%28=O%29[C@@H]%28N%29CN%29OCCN&Similarity=0.9


2.2 Substructure: http://gilson-xps3.ucsd.edu/bind/searchby_smiles.jsp?submit=Search&startPg=0&Increment=15&SearchType=2&smilesStr=CCC%28C%29CC%28C%29CCCCCCCCC%28=O%29NC1C[C@@H]%28O%29[C@H]%28NC%28=O%29C2CN%28C[C@@H]2O%29C%28=O%29[C@@H]%28NC%28=O%29[C@@H]%28NC%28=O%29C2C[C@@H]%28O%29CN2C%28=O%29[C@@H]%28NC1=O%29[C@@H]%28C%29O%29[C@H]%28O%29[C@@H]%28O%29c1ccc%28O%29cc1%29[C@H]%28O%29CCNC%28=O%29[C@@H]%28N%29CN%29OCCN&molfile=CCC%28C%29CC%28C%29CCCCCCCCC%28=O%29NC1C[C@@H]%28O%29[C@H]%28NC%28=O%29C2CN%28C[C@@H]2O%29C%28=O%29[C@@H]%28NC%28=O%29[C@@H]%28NC%28=O%29C2C[C@@H]%28O%29CN2C%28=O%29[C@@H]%28NC1=O%29[C@@H]%28C%29O%29[C@H]%28O%29[C@@H]%28O%29c1ccc%28O%29cc1%29[C@H]%28O%29CCNC%28=O%29[C@@H]%28N%29CN%29OCCN&Similarity=0.9


1.2 and 2.2 behave the same, 1.4 and 2.4 behave the same, but 1.3 and 2.3 behave differently.


  Thank for your help.  If JChemSearch is invoked from commandline, similarity search works fine.


Tiqing

ChemAxon 9c0afc9aaf

24-07-2012 04:43:22

Hi,


 


Could you please try to run one of our our JSP database example on your problem Tomcat ?


It is located under examples/db_search in the jchem package.


See setup.html for some basic instructions, should not take long.


I have tried it with Java 1.7.0 and Tomcat 7, and there is no problem with similatrity search in our example.


Please note the dissimilarity threshold should be high enough to have results.


I cannot see  "InputStream cannot be null" errors in the log files either.


 


 

ChemAxon d9cc14700b

24-07-2012 09:28:47

Dear Liut,


 


Additionally, could you please attach your catalina.out file, so that we can have a look on that?


 


Thanks and Regards,


Gabor

ChemAxon d9cc14700b

25-07-2012 12:24:23

Hi Tiqing,


Currently I have no access to  a Suse 12, so I tried reproduce this problem on a Windows 7 machine with Tomcat 7 with your code snippets, but it was working. So, as I wrote above, please send us your catalina.out file which may provide more information where to start the investigation.


Thanks and Regards,


Gabor



User 3898c01b63

25-07-2012 22:21:06

---partial output from catalina.out---


InputStream cannot be null
InputStream cannot be null


---partial output from catalina.out---


  I am going to bypass this problem by the following.


1) make a class taking three parameters, SMILES, search option, and similarity, and printing out cd_ids of the match compounds


2) call this class like executing in the commandline through ProcessBuilder.

ChemAxon d9cc14700b

26-07-2012 08:36:52

Hi,


This seems to be an option, but be aware that this means that the cache will have to be initialized everytime because every request is served by a JChemSearch launched in a new process. This could degrade the performance.


May I see the complete catalina.out file? It might contain other suspicious entries which could help to find out the reason of this issue.


Thanks and Regards,


Gabor

User 3898c01b63

26-07-2012 16:41:56

Hi,


  Thank you for the reply.  catalina.out is enclosed for your review.

ChemAxon 9c0afc9aaf

27-07-2012 04:17:04

Please print out the classPath variable in a JSP page using this code snippet:


 



ClassLoader cl = ClassLoader.getSystemClassLoader();




        URL[] urls = ((URLClassLoader)cl).getURLs();

        String classPath = "";

        for(URL url: urls){

            classPath += url.getFile() + "\n";

        }


You need to import the following packages:




java.net.URL;

java.net.URLClassLoader;

I suspect some library in the claaspath interferes with the normal state of things.

ChemAxon d9cc14700b

30-07-2012 11:03:46

Hi,


The 'InputStream cannot be null' error is caused by  the fact that 'regeneration.xml' file is not on the classpath. This xml file is packaged within jchem-jcman.jar, so make sure you package this jar into your application as well.


Best Regards,


Gabor

User 3898c01b63

31-10-2012 23:30:34

The problem is solved.


If all jars, zips are added to SUSE $CATALINA_HOME/lib, then Tomcat won't start.  I found the follwong jars will make BindingDB work fine.


chemaxon-status.jar
commons-logging-1.1.1.jar
dom4j.jar
jchem-db.jar
jchem-descriptors.jar
jchem.jar
jchem-reaction.jar
jchem-sss.jar
MarvinBeans-checkers.jar
MarvinBeans-concurrent.jar
MarvinBeans-diverse-modules.jar
MarvinBeans-enumeration.jar
MarvinBeans-formats.jar
MarvinBeans-formats.mdl.jar
MarvinBeans-formats-smiles.jar
MarvinBeans.jar
MarvinBeans-jep.jar
MarvinBeans-license.jar
MarvinBeans-plugin.jar
MarvinBeans-smarts.jar



But I foundthe Similarity search does not work.


With the examples of JChem (simple_db_search), three more jars should be added


chemaxon-sizeagent.jar
chemaxon-instrumentation.jar
jchem-clustering.jar

ChemAxon d9cc14700b

10-11-2012 11:22:30

Hi,


It's not clear from your post if you managed to make similarity search working, is that also working?


 


Thanks and Regards,


Gabor