File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
Author

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
    
    1

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.

http://www.technicalfacilitation.com/get.php?link=classloading

Regards,

-Cameron McKenzie
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30309
    
150

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


[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
 
jQuery in Action, 2nd edition
 
subject: java. lang. NoClassDefFound Error: org /aspectj/ lang/ Signature