aspose file tools*
The moose likes JDBC and the fly likes runtime error in jdbc Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "runtime error in jdbc" Watch "runtime error in jdbc" New topic
Author

runtime error in jdbc

preethi Ayyappan
Ranch Hand

Joined: Oct 04, 2007
Posts: 518
Hi,
when i am trying to compile my program,it is compiling well.But when running It is showing the following error:

root@localhost agi-bin]# java -classpath .:/usr/java/jdk1.6.0_04/lib/mysql-connector-java-3.0.17-ga/mysql-connector-java-3.0.17-ga/mysql-connector-java-3.0.17-ga-bin.jar Connect
Exception in thread "main" java.lang.NoClassDefFoundError: while resolving class: com.mysql.jdbc.MysqlIO
at java.lang.VMClassLoader.resolveClass(java.lang.Class) (/usr/lib/libgcj.so.5.0.0)
at java.lang.Class.initializeClass() (/usr/lib/libgcj.so.5.0.0)
at com.mysql.jdbc.Connection.createNewIO(boolean) (Unknown Source)
at com.mysql.jdbc.Connection.Connection(java.lang.String, int, java.util.Properties, java.lang.String, java.lang.String, com.mysql.jdbc.NonRegisteringDriver) (Unknown Source)
at com.mysql.jdbc.NonRegisteringDriver.connect(java.lang.String, java.util.Properties) (Unknown Source)
at java.sql.DriverManager.getConnection(java.lang.String, java.util.Properties) (/usr/lib/libgcj.so.5.0.0)
at java.sql.DriverManager.getConnection(java.lang.String, java.lang.String, java.lang.String) (/usr/lib/libgcj.so.5.0.0)
at Connect.main(java.lang.String[]) (Unknown Source)
Caused by: java.lang.ClassNotFoundException: javax.net.ssl.SSLSocketFactory not found in [file:./, file:/usr/java/jdk1.6.0_04/lib/mysql-connector-java-3.0.17-ga/mysql-connector-java-3.0.17-ga/mysql-connector-java-3.0.17-ga-bin.jar, file:/usr/share/java/libgcj-3.4.3.jar, file:./, core:/]
at java.net.URLClassLoader.findClass(java.lang.String) (/usr/lib/libgcj.so.5.0.0)
at gnu.gcj.runtime.VMClassLoader.findClass(java.lang.String) (/usr/lib/libgcj.so.5.0.0)
at java.lang.ClassLoader.loadClass(java.lang.String, boolean) (/usr/lib/libgcj.so.5.0.0)
at _Jv_FindClass(_Jv_Utf8Const, java.lang.ClassLoader) (/usr/lib/libgcj.so.5.0.0)
at _Jv_PrepareCompiledClass(java.lang.Class) (/usr/lib/libgcj.so.5.0.0)
at _Jv_WaitForState(java.lang.Class, int) (/usr/lib/libgcj.so.5.0.0)
at java.lang.VMClassLoader.linkClass0(java.lang.Class) (/usr/lib/libgcj.so.5.0.0)
at java.lang.VMClassLoader.resolveClass(java.lang.Class) (/usr/lib/libgcj.so.5.0.0)
...7 more

I am unable to find what is the error.my java file is in /var/lib/asterisk/agibin.
my sqljar file is in the path:/usr/java/jdk1.6.0_04/lib/mysql-connector-java-3.0.17-ga/mysql-connector-java-3.0.17-ga/mysql-connector-java-3.0.17-ga-bin.jar
Thanks.
mnadeem chishti
Greenhorn

Joined: Aug 07, 2006
Posts: 11
Please can you past code snipt here you are using to ....
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30929
    
158

Preeti,
You might want to try quotes around the classpath:
java -classpath ".:/usr/java/jdk1.6.0_04/lib/mysql-connector-java-3.0.17-ga/mysql-connector-java-3.0.17-ga/mysql-connector-java-3.0.17-ga-bin.jar"

Also can you make sure the path is correct by running the command:
"ls /usr/java/jdk1.6.0_04/lib/mysql-connector-java-3.0.17-ga/mysql-connector-java-3.0.17-ga/mysql-connector-java-3.0.17-ga-bin.jar"


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
preethi Ayyappan
Ranch Hand

Joined: Oct 04, 2007
Posts: 518
Thank you.my problem is solved.my path was incorrect.Now it is running well.
 
jQuery in Action, 2nd edition
 
subject: runtime error in jdbc