MYSQL JDBC NoClassDefFoundError: org/aspectj/lang/Signature
843854Apr 15 2005 — edited Apr 23 2007i am trying to connect to a database via java using JDBC i have installed:
jdk1.5.0_01
mysql-connector-java-3.1.8-bin-g.jar
MySQL Server 4.1
Java works fine, MYSQL works fine from the command prompt but when it comes to testing using this simple java program
public class JdbcExample1 {
public static void main(String args[]) {
Connection con = null;
try {
Class.forName("com.mysql.jdbc.Driver").newInstance();
con = DriverManager.getConnection("localhost", "username", "password");
if(!con.isClosed())
System.out.println("Successfully connected to MySQL server...");
} catch(Exception e) {
System.err.println("Exception: " + e.getMessage());
} finally {
try {
if(con != null)
con.close();
} catch(SQLException e) {}
}
}
}
this compiles fine but when run i get the following error message
Exception in thread "main" java.lang.NoClassDefFoundError: org/aspectj/lang/Signature
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:164)
at JdbcExample1.main(JdbcExample1.java:10)
class path is set as .;C:\Program Files\Java\jdk1.5.0_01\jre\lib\ext\mysql-connector-java-3.1.8-bin.java
any help or input on this error would be appreciated
thanks in advanced Neil