JChem Base FAQ
-
General
-
Installation and configuration
-
JCMAN GUI does not work via X between Linux (server) and Windows (client)
-
How should I set the "JDBC driver" and "URL of database" fields for starting JChemManager?
-
Why do I get SQLException or other error when I use JChemManager?
-
I get exception when I start JChemManager using Oracle's JDBC thin driver.
-
Performance
-
Integration
-
Examples
-
Common issues
-
General
-
Which Java virtual machine should I use with JChem?
JChem requires Oracle Java Runtime Environment (JRE) 1.6 JRE Standard Edition or better. Equivalent JREs from other vendors may work, but not recommended. For maximum performance we recommend to use the latest stable release from Oracle.
-
How can I integrate Apache, Tomcat, and JChem?
-
Install and test Apache Tomcat (before starting, set the JAVA_HOME environmental variable)
See the user guide: <Tomcat home>/doc/index.html -
Follow the instructions for adding JChem into Tomcat
-
Test JChem under Tomcat:
http://localhost:8080/jchem/
http://localhost:8080/jchem/examples/db_search/index.jsp -
Specify Tomcat in Apache's conf/httpd.conf by adding a line like
Include <Tomcat home>/conf/tomcat-apache.conf -
Add mod_jserv into Apache as described in Tomcat's user guide
-
Restart Tomcat and restart Apache
-
Test JChem under Apache:
http://localhost/jchem/
http://localhost/jchem/examples/db_search/index.jsp
-
-
-
I get out of memory error.
Java applications in general:
In the case of most Java Virtual Machines, the default setting of maximum heap size is 64MB. One can increase the maximum heap size of applications running under Oracle's environment by setting the -Xmx parameter. General example for allowing 128 MBytes for an application:
java -Xmx128m my.ApplicationJChem applications:
In the case of the JChem application startup files (Windows Batch Files and Unix Shell Scripts) an application-specific value is specified in the startup file, which can be easily edited. Please click here for further information.Web applications:
If your problem occurs in Tomcat, please see the Tomcat configuration page.
If you use a different servlet server, then please consult the documentation of the software for details.When using a MySQL database, an OutOfMemory Error may occur during a JChem table export of millions of structures. The MySQL database driver causes the problem, which fetches the data set in one batch.
We recommend you use the fetchSize option in the MySQL driver URL. See the example in the FAQ.Please also see the "Memory" section of hardware requirements for more information.
-
I get a warning "Table <table> could not fit into structure cache (out of memory).".
This indicates that the table could not be loaded into the structure cache due to lack of sufficient memory. There should be sufficient memory for the Java Virtual Machine (JVM) to load the structural and fingerprint information of all structure tables.
Please see the section describing how to allocate the memory need for your structure tables.The out of memory section describes how to allocate more memory for the JVM.
-
-
Installation and configuration
-
How to upgrade to a new JChem version?
These are the steps that you should follow at upgrading:
-
Download the latest JChem installation package
-
Make sure no JChem applications are running
-
Replace your old JChem directory with the contents of the new package. (delete/move the old directory and extract the package to the same location)
-
Run the JChemManager (jcman) GUI, or execute the following command to update in text mode:
jcman u
-
The application will automatically prompt you for the upgrades. Some of these changes are quick, however the regeneration of the tables can take for a while. The time requirement for table regeneration is comparable to the time of importing the same number of structures.
-
If you are using JChem from other (standalone or web) applications, make sure you also update the .jar files used by them. These jar files are located under the jchem\lib directory in the unpacked package. You should also restart these applications, so they can load the new code from the updated .jar files
For example if you are running a JSP application in Tomcat:
-
Stop Tomcat
-
Update the .jar files in Tomcat's lib directory.
-
Clearing Tomcat's cache is also recommended. This can be performed by deleting the content of <tomcat_home>/work directory.
-
Start Tomcat
-
-
-
JCMAN GUI does not work via X between Linux (server) and Windows (client)
It is possible that JCMAN GUI does not work on Linux server with Windows client via X sever in some cases. Opening your ssh connection with -Y option may solve the problem.
Related forum topic: http://www.chemaxon.com/forum/viewtopic.php?p=15322#15322
-
-
How should I set the "JDBC driver" and "URL of database" fields for starting JChemManager?
One can find simple examples of JDBC URL and driver strings in the tables below.
(For more complex cases please see the documentation of the JDBC driver.)
-
Notes:
-
ODBC connection is only tested and supported for Microsoft Access. For other databases the native JDBC drivers should be used.
-
For Oracle only the "thin" driver is tested and recommended ("oci" connection is not supported).
-
Supported databases:
Oracle |
|
Driver |
oracle.jdbc.OracleDriver |
URL format |
jdbc:oracle:thin:@[host]:[port]:<SID> |
URL example |
jdbc:oracle:thin:@localhost:1521:XE |
Supported versions |
Oracle 11g, 12c |
Continually tested versions |
Oracle 11g Express Edition (11.2.0.2.0) |
|
MySQL |
|
Driver |
org.mariadb.jdbc.Driver (up to version 17.3.27: com.mysql.jdbc.Driver) |
URL format |
jdbc:mysql://[host]:[port]/<database>[?options] |
URL example |
jdbc:mysql://localhost:3306/mydb?useCursorFetch=true&defaultFetchSize=1000 |
Supported versions |
MySQL 5.x |
Continually tested versions |
MySQL 5.1, 5.5 |
|
IBM DB2 |
|
Driver |
com.ibm.db2.jcc.DB2Driver |
Supported versions |
IBM DB2 8.1, 8.2, 9.1, 9.5, 9.7 |
|
MS SQL Server |
|
Driver |
com.microsoft.sqlserver.jdbc.SQLServerDriver |
URL format |
jdbc:sqlserver://[host]:[port][;databaseName=database][;options] |
URL Example |
jdbc:sqlserver://localhost:1433;databaseName=mydb;selectMethod=cursor Note: schema name cannot be specified; jchem uses the default schema: 'dbo' |
Supported versions |
MS SQL Server 2008, 2012 |
Continually tested versions |
MS SQL Server 2012 |
|
HSQLDB / HXSQL |
|
Driver |
org.hsqldb.jdbcDriver |
URL format |
jdbc:hsqldb:hsql://[host]/[database] |
URL Example |
jdbc:hsqldb:hsql://localhost/ |
Supported versions |
HSQLDB 2.0, 2.2 |
|
MS Access via ODBC |
|
Driver |
sun.jdbc.odbc.JdbcOdbcDriver |
URL format |
jdbc:odbc:[odbc data source][;options] |
URL example |
jdbc:odbc:mydatasource |
Supported versions |
all via odbc |
Derby |
|
Driver |
org.apache.derby.jdbc.EmbeddedDriver |
URL format |
jdbc:derby:[subprotocol]:[database with path][;create=true][;options] |
URL example |
jdbc:derby:/c:/databases/mydb;create=true |
Supported versions |
versions embedded with Java |
Continually tested versions |
versions embedded with Java 1.6 |
|
PostgreSQL |
|
Driver |
org.postgresql.Driver |
URL format |
jdbc:postgresql://[host]:[port]/<database> |
URL example |
jdbc:postgresql://localhost:5432/mydb |
Supported versions |
PostgreSQL 9.1, 9.2, 9.3, 9.4, 9.5 |
Continually tested versions |
PostgreSQL 9.4.8 |
|
Composite |
|
Driver |
cs.jdbc.driver.CompositeDriver |
URL format |
jdbc:compositesw:dbapi@[host]:[port]?domain=<domain name>&dataSource=<database> |
URL example |
jdbc:compositesw:[email protected]:9401?domain=composite&dataSource=virtualdb |
|
InterBase |
|
Driver |
interbase.interclient.Driver |
URL format |
jdbc:interbase:[path to interbase data file (.gdb file)] |
URL example |
jdbc:interbase://localhost/c:/interbase/interbasedb.gdb |
Supported versions |
InterBase 9.0.3, 10.0.2, 10.0.3 |
|
-
Why do I get SQLException or other error when I use JChemManager?
The most probable causes:
-
Incorrect URL to the database (it may occur during login)
-
Inappropriate username / password (it may occur during login)
-
Faulty JDBC or ODBC driver. Try a different one.
-
-
I get exception when I start JChemManager using Oracle's JDBC thin driver.
Make sure that the URL is appropriate (e.g: jdbc:oracle:thin:@myhost:1521:mySID). Check if all needed services run (the listener service is necessary).
-
JChem Manager and chemaxon.jchem.db.Importer fails to import date formats into PostgreSQL tables which otherwise work with psql or other non-JDBC-based clients
If this is a date or time stamp format which works using psql or other non-JDBC-based database clients, you have likely run into this PostgreSQL JDBC issue:
The work-around is to to append stringtype=unspecified to the connection.jdbcUrl:
connection.jdbcUrl=jdbc\:postgresql\://localhost\:5432/jcbtest?stringtype=unspecified
-
Integration
-
How can I use the JChem API from my favorite programming language (C++, C#, .NET, Python, Javascript, Perl)?
-
For users of the .NET API, the JChem API can be integrated into .NET applications by the .NET Packages. Other web service compatible languages (including C++ and C#) can use JChem Web Services.
-
How can I use the JChem tools as a web service?
-
Many of the JChem tools are available as web services. See the JChem Web Services Server for more information
-
Examples
-
Where can I find examples for using JChem?
-
A JSP (Java Server Pages) and ASP examples can be found in the examples directory. Please see {{<jchem dir>/examples/index.html}} for a description.
-
-
How should I set the connection string in the case of ASP or other ADO capable environment?
-
If you would like to call SQL statements using ADO, you may choose between ODBC and OLEDB connections. (ADO can not contact to the databases through JDBC drivers.)
-
Example for an ODBC connection
-
var adoConnectionString=
"DSN="+MyDSN+";"+
"UID="+username+";"+
"PWD="+password;
-
Example for an OLEDB connection to Oracle
-
var adoConnectionString=
"Provider=MSDAORA.1;"+
"Data Source="+myServiceName+";"+
"User ID="+username+";"+
"Password="+password;
(The above examples use the JavaScript syntax)
In the case of Oracle, if an error occurs, please see HOWTO: Troubleshoot an ASP-to-Oracle Connectivity Problem
-
Copy/paste doesn't work with a certain Look and Feel.
Keyboard shortcuts for Copy/Paste/Cut functions may vary by Look and Feel. For example in the case of Windows Look and Feel these are CTRL+C,CTRL+V, and CTRL+X, respectively. In the case of Motif LF the shortcuts for the same commands are: CTRL+INS,SHIFT+INS, and SHIFT+DEL.
-
-
Common issues
-
I get the following exception using MySQL: com.mysql.jdbc.PacketTooBigException: Packet for query is too large
-
Please increase the value of the "max_allowed_packet" variable for MySQL. The following line should be added to the configuration file "my.ini" under the [mysqld] section :
max_allowed_packet = 100M
-
For some structures the database field "cd_smiles" is null . Why?
-
JChem works with the standardized form of imported structures stored in ChemAxon Extended SMILES format. This extended format can represent a wider range of structures than SMILES, but there are still some cases, when this format is not applicable. In these cases the "cd_smiles" field is null , and JChem uses the "cd_structure" field for these rows. (The "cd_structure" represents the structures in the original input format)
Currently the cd_smiles is null in the following cases:
-
Structure contains radicals
-
Structure contains R-groups
-
the SMILES would be too long for the database field (very large molecules).
-
In these cases the search is slower, since the target structures have to be standardized on the fly.
Note: For most databases the size of the "cd_smiles" field can be increased at the table creation dialog (in the SQL text). The increased length is automatically utilized. This can speed up the search if a high percentage of the structures are huge.
-
I get the following error message : " The structure table contains obsolete data. Please regenerate the table. " What does it mean ?
Sometimes there are some changes in the data structure of JChem, which are incompatible with earlier versions. To obtain correct search result, the regeneration of the old structure tables is necessary. For more information and instructions please see the administration guide. -
In DB2 databases, row length of JChem structure tables has been increased
Please, be aware of the increased (by about 1K) row lengths of the JChem structure tables from JChem 6.1.2. It's possible that the new row length will reach the maximum row length allowed in your database. In this case the extended row size support must be enabled or the page size of the tablespace must be increased manually. -
How to check for duplicates in duplicate filtered tables
Because of a bug - fixed in JChem version 17.29.0 - duplicates could have been inserted in tables with duplicate filtering set on if there were too many structures with the same hash code already in the database. Starting from JChem version 17.30.0, a command line tool duplicatecheck is provided for finding the duplicates in a JChem table. This tool is available in the bin folder of JChem. For detailed help please run:duplicatecheck -help
-
If your question is not answered, please check out our forum or contact us.