starting jcman with an error
User 7499d321e3
22-12-2005 14:33:25
Hi,
I have a problem when I start jcman on a linux box, with suse 9.3, and java.1.4.2 sun I get following error:
./bin/jcman
java.lang.ClassNotFoundException: org.gjt.mm.mysql.Driver
at java.net.URLClassLoader$1.run(URLClassLoader.java:199)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:141)
at chemaxon.util.ConnectionHandler.setConnected(ConnectionHandler.java:205)
at chemaxon.util.ConnectionHandler.connect(ConnectionHandler.java:246)
at chemaxon.jchem.gui.Connector.go(Connector.java:64)
at chemaxon.jchem.gui.JChemFrame.connect(JChemFrame.java:561)
at chemaxon.jchem.JChemManager.init(JChemManager.java:89)
at chemaxon.jchem.JChemManager.main(JChemManager.java:106)
what am I doing wrong? How can I get rid of this error?
Regards,
Marek
ChemAxon 9c0afc9aaf
22-12-2005 16:46:18
Hi,
You should include the JDBC driver in your CLASSPATH environment variable.
The driver can be downloaded from the MySQL website:
http://dev.mysql.com/downloads/connector/j/3.1.html
After unpacking the package, you will find a .jar file, this is the actual driver file (e.g. "mysql-connector-java-3.1.12-bin.jar")
Best regards,
Szilard
ChemAxon 9c0afc9aaf
22-12-2005 17:02:04
User cfaffaaf29
17-02-2006 15:15:16
After installing JChem 3.1.3 I was able to start JChemManager with little difficulty and loaded an SDF file successfully. However, getting the cartridge installed and running took a little longer and in the process I followed your recommendations uninstalling the 1.4.2 JDK and downloading JDK 5.0 Update 6 and setting JAVA_HOME to C:\Program Files\Java, with the JVM at C:\Program Files\Java\jre1.5.0_06. The cartridge works well now with TomCat 5.0, I can run my substructure searches and display hits, but now I can no longer open the JChemManager GUI.
My CLASSPATH environmental seems to be set correctly
>echo %CLASSPATH% -> G:\oracle\product\10.1.0\db_1\jdbc\lib\classes12.jar
But after the login dialog box I get the following
java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at chemaxon.util.ConnectionHandler.setConnected(ConnectionHandler.java:2
05)
at chemaxon.util.ConnectionHandler.connect(ConnectionHandler.java:246)
at chemaxon.jchem.gui.Connector.go(Connector.java:95)
at chemaxon.jchem.gui.JChemFrame.connect(JChemFrame.java:561)
at chemaxon.jchem.JChemManager.init(JChemManager.java:89)
at chemaxon.jchem.JChemManager.main(JChemManager.java:106)
What's missing?
ChemAxon 9c0afc9aaf
17-02-2006 15:26:29
Hi,
Some tips about the possible things I can think of:
- If you have just changed your CLASSPATH you should open a new command-line terminal for starting jcman (so changes can take effect)
- Are you sure the path is correct ?
- Is it on a network drive ? Is it connected ? You may also try to copy it to the local file system and use if from there.
- Is the .jar file intact (can you open it with WinZip or similar tool ?)
Let me know if this helps.
Szilard
User cfaffaaf29
17-02-2006 15:58:19
> If you have just changed your CLASSPATH you should open a new command-line terminal for starting jcman (so changes can take effect)
No, the CLASSPATH env was set long ago
> Are you sure the path is correct ?
> Is it on a network drive ? Is it connected ? You may also try to copy it to the local file system and use if from there.
The file is local and it resides in the same path as set in the env
- Is the .jar file intact (can you open it with WinZip or similar tool ?)
Doesn't the cartridge use this same jdbc? The cartridge is working fine. How does JCHEMMGR find the JVM? Does it use JAVA_HOME?
ChemAxon 9c0afc9aaf
17-02-2006 16:06:16
Quote: |
Doesn't the cartridge use this same jdbc? |
No, it uses a copy.
Tomcat does not care about CLASSPATH, so you must have a copy in Tomcat's lib folder.
(usually under shared\lib ) Quote: |
How does JCHEMMGR find the JVM? Does it use JAVA_HOME? |
No, it only depends on the CLASSPATH.
Do you have read permission on the jar file ?
ChemAxon 9c0afc9aaf
17-02-2006 16:41:21
PS:
Please also paste here the complete output of
User cfaffaaf29
17-02-2006 17:03:52
The entire contents of CLASSPATH are "G:\oracle\product\10.1.0\db_1\jdbc\lib\classes12.jar"
SYSTEM and USERS have read and execute permission on classes12.jar
ChemAxon aa7c50abf8
17-02-2006 17:17:47
This is not likely to make any difference, but could you, please, try using oracle.jdbc.OracleDriver as the driver class instead of oracle.jdbc.driver.OracleDriver?
User cfaffaaf29
17-02-2006 17:27:22
>try using oracle.jdbc.OracleDriver as the driver class instead of oracle.jdbc.driver.OracleDriver?
Nope, that did not make any difference. I'm sorry I should have mentioned the DB and workstation are running on Win Server 2003. Marvin sketch works fine so the problem does not seem to affect all Java GUIs.
ChemAxon aa7c50abf8
17-02-2006 17:41:53
Please, could you try the following command on the command prompt:
Code: |
jar tf G:\oracle\product\10.1.0\db_1\jdbc\lib\classes12.jar | %SystemRoot%\system32\find.exe /N "OracleDriver" |
This command should return something like:
Code: |
[163]oracle/jdbc/driver/OracleDriver.class
[348]oracle/jdbc/OracleDriver.class |
User cfaffaaf29
17-02-2006 18:40:29
I only get back: 'jar' is not recognized as an internal or external command,
operable program or batch file.
I hate to flout my ignorance, but is that a 'PIPE' between classes12.jar and %SystemRoot%? I didn't know you could do that in Win.
I tried installing JChem on a different workstation, set the environmentals, and was able to open JChemMgr and load an SDF into the same DB without incident. I really suspect something happened during the JChem Cartridge installation. I made the same installations on both my Test and Production servers and can no longer open the Mgr GUI on either machine.
ChemAxon aa7c50abf8
17-02-2006 19:15:05
Quote: |
I only get back: 'jar' is not recognized as an internal or external command, operable program or batch file. |
Find the Java installation on your server. Let's assume it is installed in the %JAVA_HOME% directory. Modify the command accordingly:
%JAVA_HOME%\bin\jar tf G:\oracle\product\10.1.0\db_1\jdbc\lib\classes12.jar | %SystemRoot%\system32\find.exe /N "OracleDriver"
Actually, the jcman.bat script (which you probably use to start JChemManager) refers to the java runtime simply with "java", so an appropriate java.exe should be on your executable PATH. A jar.exe is usually also in %JAVA_HOME%\bin. So I would expect jar.exe to be also on your PATH. I wonder which java is found by jcman.bat. Please, could execute the following:
What does it return? Quote: |
I hate to flout my ignorance, but is that a 'PIPE' between classes12.jar and %SystemRoot%? I didn't know you could do that in Win. |
Sure. Windows is crap, but tries hard catching up. :-)
User cfaffaaf29
17-02-2006 19:44:15
>jar tf G:\oracle\product\10.1.0\db_1\jdbc\
lib\classes12.jar | %SystemRoot%\system32\find.exe /N "OracleDriver"
[122]oracle/jdbc/driver/OracleDriver.class
[129]oracle/jdbc/driver/OracleDriverExtension.class
[517]oracle/jdbc/OracleDriver.class
>java -version
java version "1.5.0_06"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode, sharing)
but my %Path% environmental includes no reference to
C:\Program Files\Java\jre1.5.0_06\bin
it does however include the following from the Oracle install
G:\Oracle\product\10.1.0\Client_1\jre\1.4.2\bin\client;
G:\Oracle\product\10.1.0\Client_1\jre\1.4.2\bin;
Conflict?
ChemAxon aa7c50abf8
17-02-2006 20:20:37
Quote: |
but my %Path% environmental includes no reference to
C:\Program Files\Java\jre1.5.0_06\bin |
This is strange. How did you check your %Path%? In the command line, with SET PATH, or in the ControlPanel/System/Advanced/Environment settings?
Anyway, I suggest to edit the jcman.bat file so that it uses Sun Microsystems JDK (C:\Program Files\Java\jre1.5.0_06\bin) for sure. Does it make any difference?
If we're at editing jcman.bat...please, set the echo on (@echo on) just before java is started (at the end of the script) and post the output here. You are running the GUI version -- jcman.bat without command line parameters --, don't you?
User cfaffaaf29
17-02-2006 21:11:33
>How did you check your %Path%? In the command line, with SET PATH, or in the ControlPanel/System/Advanced/Environment settings?
I don't see any difference between the two, here's the output for SET PATH
G:\Oracle\product\10.1.0\Client_1\bin;
G:\Oracle\product\10.1.0\Client_1\jre\1.4.2\bin\client;
G:\Oracle\product\10.1.0\Client_1\jre\1.4.2\bin;
C:\Program Files\ChemOffice2002\Common\DLLs;
C:\Perl\bin\;
C:\Perl\bin;
G:\oracle\product\10.1.0\db_1\bin;
G:\oracle\product\10.1.0\db_1\jre\1.4.2\bin\client;
G:\oracle\product\10.1.0\db_1\jre\1.4.2\bin;
C:\WINDOWS\system32;
C:\WINDOWS;
C:\WINDOWS\System32\Wbem;
C:\jchem\bin;
C:\jchem\bin
Heres JAVA_HOME
C:\Program Files\Java\jdk1.5.0_06
>Anyway, I suggest to edit the jcman.bat file
Okay, I'll be able happy to try, but I'm afraid you'll have to help me out a little bit. I guess I need to add a line like 'set=' but I need help with the rest of the syntax.
>You are running the GUI version -- jcman.bat without command line parameters
Yep.
ChemAxon aa7c50abf8
20-02-2006 10:47:54
Please, do the following:
1.) Save a copy of your current jcman.bat file.
2.) Insert at the beginning of line #156 in jcman.bat
After the modification, this line should read as follows:
Code: |
"%JAVA_HOME%"\bin\java %JAVA_OPTS% chemaxon.jchem.JChemManager |
Note, the double quotes. They are required part of the command.
3.) Insert a new line immediately before line #156 and write the following in it:
This will cause the exact command for starting the Java runtime with JChemManager to be displayed in the Command Propmt window where the jcman.bat has been executed.
4.) Run the modified jcman.bat.
5.) If the problem persists, copy the output of jcman.bat from the Command Prompt window and post it here.
PS: Quote: |
I don't see any difference between the two, here's the output for SET PATH |
This may not be relevant in your case, but in general, the safe way of checking your path is to do it on the command line. In the Control Panel your full executable path is split into two parts: system path and user path. This may be the source of some confusion. (Not to mention that those tiny little editbox capsules are very hard to read.)
User cfaffaaf29
20-02-2006 13:01:43
Thanks for the detailed instructions. I'm still getting the same error, but was able to obtain the following output:
C:\Documents and Settings\Administrator>"C:\Program Files\Java\jdk1.5.0_06"\bin\
java -client -Xmx200m -classpath "C:\jchem\lib\jchem.jar" chemaxon.jchem.JChemManager
java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:164)
at chemaxon.util.ConnectionHandler.setConnected(ConnectionHandler.java:205)
at chemaxon.util.ConnectionHandler.connect(ConnectionHandler.java:246)
at chemaxon.jchem.gui.Connector.go(Connector.java:95)
at chemaxon.jchem.gui.JChemFrame.connect(JChemFrame.java:561)
at chemaxon.jchem.JChemManager.init(JChemManager.java:89)
at chemaxon.jchem.JChemManager.main(JChemManager.java:106)
ChemAxon aa7c50abf8
20-02-2006 13:08:35
Are your 100% sure that your CLASSPATH variable is set to G:\oracle\product\10.1.0\db_1\jdbc\lib\classes12.jar? Please, could you double check with SET CLASSPATH in the Command Prompt?
ChemAxon aa7c50abf8
20-02-2006 13:14:09
By the way, CLASSPATH is used only if JCHEMCLASSPATH is NOT set. Please, could you also check your JCHEMCLASSPATH?
User cfaffaaf29
20-02-2006 14:30:05
I get the following:
C:\Documents and Settings\Administrator>set classpath
CLASSPATH=G:\oracle\product\10.1.0\db_1\jdbc\lib\classes12.jar
C:\Documents and Settings\Administrator>set JCHEMCLASSPATH
JCHEMCLASSPATH=C:\jchem\lib\jchem.jar
ChemAxon aa7c50abf8
20-02-2006 14:46:12
Please, either include G:\oracle\product\10.1.0\db_1\jdbc\lib\classes12.jar in your JCHEMCLASSPATH:
Code: |
SET JCHEMCLASSPATH=C:\jchem\lib\jchem.jar;G:\oracle\product\10.1.0\db_1\jdbc\lib\classes12.jar |
or unset JCHEMCLASSPATH:
Code: |
SET JCHEMCLASSPATH= |
As I wrote in my previous posting: CLASSPATH is used only, if JCHEMCLASSPATH is NOT set. If JCHEMCLASSPATH is set, it is used and CLASSPATH is not used. JCHEMCLASSPATH must therefore include either all Java libraries required or nothing.
User cfaffaaf29
20-02-2006 15:26:51
Thanks, that fixed it. Whew!
I don't have any record in my notes of having explicitly created JCHEMCLASSPATH. Was it created by jchemstreams/install.bat?
ChemAxon aa7c50abf8
20-02-2006 15:36:01
Quote: |
I don't have any record in my notes of having explicitly created JCHEMCLASSPATH. Was it created by jchemstreams/install.bat? |
You mean cartridge/install.bat. No, it doesn't do anything like that.