deploying JChem Web application using JWSDP

User 08026ff1f0

17-02-2005 22:17:17

Hi,





We have deveoped a web application for High throughput screening lab using the functionality of Jchem. It has been developed using Tomcat -3.3.2. We are planning to deploy it on a server that uses Java web services development pack1.3 and tomcat 5.0 as servlet container. I have created a context for the application in server.xml at <jwsdp-home>/conf. I have also copied all the oracle and jchem jar files in <jwsdp-home>/common/lib and also in WEB-INF/lib . The JDBC connectivity is working fine but I have problem using the Jchem classes.. which i use to do structure searching. I am not able to figure out why the JSP pages are not able to acces the Jchem classes when I have copied all the jar files in the appropriate places.As a result I am not able to do structure searching. Do we need to set any classpaths in order to use the Jchem classes?Or do i have to copy the jar files inside the <tomcat-5.0>/common/lib instead of <jwsdp-home>/common/lib. Please help me out. Thanks.





Bhargav

ChemAxon 9c0afc9aaf

18-02-2005 07:21:27

Hi,





You should only copy the .jar files into one directory, otherwise you may forget to replace them all during an upgrade, and different versions can cause conflicts.





We usually recommend <tomcat_home>/shared/lib to store the jar files in.





It is very important, that you should restart Tomcat after copying the jar files.





Best regards,





Szilard

User 08026ff1f0

18-02-2005 20:09:22

Hi ,





I have tried to put the jchem jar files and oracle jar files in that directory but it still is not working. My main question is whether I should place the .jar files in the <jwsdp-home>/shared/lib or <tomcat-home>/shared/lib. I have tried placing in both , but still its not working. The JSP page is used to retrieve structures from the database... The structure is passed from another page to this jsp page








<%@page import="chemaxon.descriptors.* "%>


<%@page import="chemaxon.jchem.db.*, chemaxon.util.*,java.sql.*"%>





try{


ConnectionHandler ch = new ConnectionHandler();


ch.setDriver("oracle.jdbc.driver.OracleDriver");


ch.setUrl("jdbc:oracle:thin:@//129.237.137.38:1521/testjc");


ch.setLoginName("sysman");


ch.setPassword("ight0907");


ch.connect();


String structureTableName = "structures";


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


searcher.setQueryStructure(molfile);


searcher.setConnectionHandler(ch);


searcher.setStructureTable(structureTableName);


searcher.setWaitingForResult(true);


searcher.setSearchType(JChemSearch.SUBSTRUCTURE);


searcher.run();


. ...


...


...


}


catch(SQLException e)


{


System.out.println("database access error");


}





But when it comes to this page.. I get the message 'database access error..' (which is in catch{ }) Does it mean that the connection handler function is not working coz it is not able to access the chemaxon.util.class ?? But while compiling if it is not able to find the appropritate classes for the functions used then I think it ll produce a compilation error.


Here it is not producing compilation error but is not able to access the database . what cud it be that is preventing it from making a connection to the database











Bhargav

User 08026ff1f0

20-02-2005 21:59:15

Hi





I also tried to put this code in a separate java file and to check what was wrong.








try{


ConnectionHandler ch = new ConnectionHandler();


ch.setDriver("oracle.jdbc.driver.OracleDriver");


ch.setUrl("jdbc:oracle:thin:@//129.237.137.38:1521/testjc");


ch.setLoginName("sysman");


ch.setPassword("ight0907");


ch.connect();


}


catch(SQLException e)


{


e.printStackTrace();


}


and compiled it using classpath





javac -classpath ..../jchem/lib/jchem.jar testingdb.java. It complied without error.


when i tried to execute it using





java -classpath .../jchem/lib/jchem.jar testingdb





it give the following error....


Exception in thread "main" java.lang.NoClassDefFoundError: testingdb





I think it is not able to find the class files that is in chemaxon. But I included the jchem.jar in the CLASSPATH and also included a ' . ' in the CLASSPATH. Can u please tell me what cud be wrong with this..If we can figure out this error i think it could solve the problem in the JSP file too.








Bhargav

ChemAxon 9c0afc9aaf

20-02-2005 23:19:51

Hi,





I suggest <tomcat-home>/shared/lib.


You must restart the web server, otherwise it cannot use the new jar file.





Your second problem is not ChemAxon-related at all.


If you specify the classpath for the JVM with "-classpath", it ignores your CLASSPATH environment variable, so you must specify all libraries in this case.





Best regards,





Szilard

ChemAxon 9c0afc9aaf

20-02-2005 23:24:03

Please copy/paste here the full stack trace of the SQLException, so I can give you some advice on that problem too.





Best regards,





Szilard

User 08026ff1f0

21-02-2005 19:32:11

Hi,





I tried to catch the Exception and this is the message





java.sql.SQLException: The SYSMAN.STRUCTURES table doesn't exist or size of fingerprint is not properly set. Check JChemProperties table for structure tables





I have a table called structures in the database . What could be wrong with the fingerprints





bhargav

ChemAxon 9c0afc9aaf

22-02-2005 08:42:18

Hi,





Probably the table wasn't created with JChem, or it was created using an other property table.





Please read this page for further information:





http://www.jchem.com/doc/admin/index.html





If you want to search in non-jchem tables, you can use our cartridge:





http://www.jchem.com/doc/guide/cartridge/index.html





The cartridge provides maximum compatibility (you can update your tables with SQL statements), but it comes at the price of reduced performance.





Best regards,





Szilard

User 08026ff1f0

05-03-2005 19:25:29

Hi,





I am trying to export the results of a query to a file. I am using a JSP that is similar to ../transfer/exporter.jsp. But I am getting the following error in the exporter.jsp file.


SQL error





SQLState: null


Message: The jchemstrucure table doesn't exist or size of fingerprint is not properly set. Check JChemProperties table for structure tables.


Vendor: 0





The table exists and has been created using the property table ' Jchemproperties '.


The stack trace shows the following:





java.sql.SQLException: The jchemstrucure table doesn't exist or size of fingerprint is not properly set. Check JChemProperties table for structure tables.


at chemaxon.jchem.db.FingerprintHandler.getNumberOfBits(FingerprintHandler.java:36)


at chemaxon.jchem.db.TableInfo.(TableInfo.java:63)


at chemaxon.jchem.db.TableInfo.getTableInfo(TableInfo.java:311)


at chemaxon.util.DatabaseTools.getFieldNames(DatabaseTools.java:55)


at transfer.exportconnects_21._jspService(exportconnects_21.java:125)


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


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


at org.apache.tomcat.facade.ServletHandler.doService(ServletHandler.java:534)


at org.apache.tomcat.core.Handler.invoke(Handler.java:280)


at org.apache.tomcat.core.Handler.service(Handler.java:193)


at org.apache.tomcat.facade.ServletHandler.service(ServletHandler.java:445)


at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:874)


at org.apache.tomcat.core.ContextManager.service(ContextManager.java:790)


at org.apache.coyote.tomcat3.Tomcat3Adapter.service(Tomcat3Adapter.java:64)


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


at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:702)


at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:571)


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


at java.lang.Thread.run(Thread.java:534)








Could there be something wrong with the fingerprints size?








Bhargav

ChemAxon 9c0afc9aaf

06-03-2005 09:43:23

Hi,





Please try to specify the structure table in uppercase and together with the schema.





E.g.:





SCOTT.STRUCTURES





Let me know if this helps.





Best regards,





Szilard

User 08026ff1f0

07-03-2005 20:58:34

Hi,





It working now when I am using SCOTT.STRUCTURETABLE instead of


STRUCTURETABLE alone. I have another question. While exporting the query results to a


file , is it possible to add an extra field to the file . For eg : For all the compounds in the hitlist , i' ll take the structure details and finger prints from the STRUCTURETABLE and for each compound I also want to add an extra field called 'activity of the compound ' into the exported file. The 'activity of the compound ' field is taken from another oracle table that


contains the compound id and the activity of the compound as fields. Please let me know if there is any possiblity to accomodate this feature while exporting. Thanks





Bhargav

ChemAxon 9c0afc9aaf

08-03-2005 09:43:29

Hi,





With chemaxon.java.db.Exporter currently you can export only those fields, which are part of the jchem structure table:





http://www.jchem.com/doc/api/chemaxon/jchem/db/Exporter.html#setFieldList(java.lang.String)





In JChem version 3.1 we are planning to


allow the user to specify a CUSTOM SQL query, e.g.:





SELECT STRUCTURES.CD_STRUCTURE, STRUCTURES.CD_ID, BIODATA.TOXICITY FROM STRUCTURES, BIODATA WHERE STRUCTURES.CD=BIODATA.CD_ID AND BIODATA.ACTIVITY<23.4 ORDER BY STRUCTURES.MOLWEIGHT





The field in bold (cd_structure) is mandatory, it must be the first field in the result set.


Probably the user will also be able to specify a string to specify the


name of the exported fields in order as they will appear in the output file:


"ids, measured_Toxicity"





As you see this will enable the following:





1. Export related data from other related tables


2. Specify a WHERE conditions also on fields of the related tables


3. Order the exported structures by any column





Until we implement this, you can use the following solution:


- add a new field to the jchem structure table


- migrate your data from the other table to this field


- now you can export the data with the structure





Szilard

User 08026ff1f0

09-03-2005 06:25:57

Hi





I just wanted to know the range of values that cd_fp can take.( the maximum and minimum values that cd_fp can take).Is it possible to represent those values using an 'int' or should i use a data type that can store bigger values like long or double if I want to query the structures table based on fingerprints.





Thanks











Bhargav

ChemAxon 9c0afc9aaf

09-03-2005 08:37:57

Hi,





They are coming from 'int' during the generation, so it is the appropriate data type to hold them.


(each column represents a 32-bit part of the fingerprint)





Best regards,





Szilard

User 08026ff1f0

25-03-2005 23:54:04

Hi,


I am using the same JchemProperties table for creating different Structure tables. When I am deleting a table , I am also deleting the following entries for the table from the


JchemProperties table





table.SYSMAN.TABLENAME.updateCounter


table.SYSMAN.TABLENAME.version


table.SYSMAN.TABLENAME.absoluteStereo


table.SYSMAN.TABLENAME.fingerprint.numberOfBits


table.SYSMAN.TABLENAME.fingerprint.numberOfOnes


table.SYSMAN.TABLENAME.fingerprint.numberOfEdges





The entries are getting deleted from the JchemProperties table, but when I am creating a new table with the old name 'TABLENAME', using the JchemProperties table, the table is not being created . Is there any other place where the table information is stored other than in JchemProperties table.








Bhargav

ChemAxon 9c0afc9aaf

29-03-2005 06:57:30

Hi,





There are also some database objects to be deleted, they are DB dependent.





We do not recommend altering the property table from your custom code.





Please use our API to create / drop tables, e.g.:





http://www.jchem.com/doc/api/chemaxon/jchem/db/UpdateHandler.html#dropStructureTable(chemaxon.util.ConnectionHandler,%20java.lang.String)





Best regards,





Szilard