jcman java.lang.ClassNotFoundException: org.gjt.mm.mysq.Dri

User 26c54ae8b9

06-01-2013 23:04:26

Hi Chemaxon,


jcman command in linux doesn't work. I can't connect to mysql database.


Can you help me please ?


sh /var/www/vhosts/test.com/httpdocs/jchem/bin/jcman u --driver org.gjt.mm.mysql.Driver --dburl jdbc:mysql://localhost/bdmolecule --proptable jchemproperties  -l bdtest -p xxxx --saveconf
Cannot connect:
java.lang.ClassNotFoundException: org.gjt.mm.mysql.Driver
        at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:186)
        at chemaxon.util.ConnectionHandler.setConnected(ConnectionHandler.java:196)
        at chemaxon.util.ConnectionHandler.connect(ConnectionHandler.java:234)
        at chemaxon.jchem.Command.run(Command.java:555)
        at chemaxon.jchem.Command.main(Command.java:201)

ChemAxon abe887c64e

07-01-2013 08:04:54

Hi Karim,


JChem uses the drivers in <jchem home>/lib/jdbc/ directory, by default. In the installed version there must be a mysql driver (com.mysql.jdbc.Driver) as well. In case you prefer org.gjt.mm.mysql.Driver you have to copy it in this directory.


Best regards,


Krisztina



User 26c54ae8b9

07-01-2013 20:05:55

There is no directory "jdbc"....


So i create a ne directory "jdbc" in "jchem/lib" but i have the same error.


I start and stop apache.


An idea ? ;)


Thanks,


Karim.

ChemAxon abe887c64e

08-01-2013 09:33:17

Hi Karim,


Are you sure you've copied the driver in sh /var/www/vhosts/test.com/httpdocs/jchem/lib/jdbc ?


The missing jdbc folder is strange, you should repeat the installation process possibly. Has been this environment ever working?


Best regards,


Krisztina

User 26c54ae8b9

13-01-2013 14:32:58

I use jchem_5_1_04, and there is no "jdbc" directory.


I create jdbc directory, and i copy dirver in jdbc, and lib, and jchem...all directories but it doesn't work...


I have pb since i restore my server. I need initialize a classpath ?


Thanks,Karim.

ChemAxon abe887c64e

14-01-2013 10:23:31

Hi Karim,


The best way would be the uprade to our latest JChem version 5.11.4  https://www.chemaxon.com/download/jchem/


It has many new features, improvements and bugfixes in comparison with version 5.1.04; see history of changes:


https://www.chemaxon.com/jchem/changes.html


Here you find the administration guide: https://www.chemaxon.com/jchem/doc/admin/ 


Best regards,


Krisztina

ChemAxon 9c0afc9aaf

14-01-2013 15:19:09

In such old JChem versions the JDBC drivers were not included in the distribution and had to be set in the system CLASSPATH variable, which is reflected in the local copy of the doumentation, e.g. for me:


file:///C:/jchem514/doc/admin/prepscripts.html


 


 


CLASSPATH / JDBC driver

To allow database access for JChem applications, the appropriate JDBC driver should be included in the CLASSPATH environment variable (create this variable if not already present). This is usually a .jar file, which is either distributed with the database, or can be downloaded from the vendor's site. Please note, that the actual file should be listed in the CLASSPATH, not the directory that contains it.

 


I agree with Krisztina that you should upgrade to the latest version if possible, as such old versions are not genearally supported.


Please always report the sofware version ehen reporting a problem as we ask in the text on the left of the message box.


Best regards,


Szilard