jQuery in Action, 3rd edition
The moose likes IDEs, Version Control and other tools and the fly likes java. lang. NoClassDefFound Error:   org /aspectj/ lang/ Signature Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "java. lang. NoClassDefFound Error:   org /aspectj/ lang/ Signature" Watch "java. lang. NoClassDefFound Error:   org /aspectj/ lang/ Signature" New topic

java. lang. NoClassDefFound Error: org /aspectj/ lang/ Signature

surendar prabu
Ranch Hand

Joined: Jul 24, 2006
Posts: 102
I am trying to connect with mysql database.my program is having main method. when i am compiling and running the program from the command prompt my program is working fine. I am using netbeans IDE. when i try to run the priogram directly using netbeans i getting this exception during runtime.

java. lang. No Class Def Found Error :

org/ aspectj/ lang/Signature

at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:155)
at DataCheck.main(DataCheck.java:20)
Exception in thread "main"

I know that this is something related to the classpath.But i have tried everything i can do. here is the code that i use to connect with the database.

Class.forName ( "com.mysql.jdbc.Driver" );
Connection con= DriverManager.getConnection ("jdbc:mysql://localhost:3306/myapp" , "root" , "admin");

please help me. I get the same exception when i try to connect using servlets also. but the program is working fine in command prompt.

regards Surendar

SCJP 1.4
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4968

Could be a classloader issue. Those are nasty.

Where is the JAR file on your file system? How have you packaged the JAR file that contains the aspecj classes?

Classpath issues are easy to solve - just put the code on the classpath. The classloaders are the tough ones, because those can generate ClassNotFoundExceptions even when the class IS on the classpath somewhere.

Here's a link from my website on classloaders. It's pretty WebSphere centric, but it gives a pretty good idea on how J2EE classloaders and classloading works.



-Cameron McKenzie
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 33124

I'm moving this to our IDEs forum as it has to do with the IDEs classpath (and AspectJ) rather than JDBC.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
I agree. Here's the link: http://aspose.com/file-tools
subject: java. lang. NoClassDefFound Error: org /aspectj/ lang/ Signature
It's not a secret anymore!