• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
author and cow tipper
Posts: 5009
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Surendar,
I'm moving this to our IDEs forum as it has to do with the IDEs classpath (and AspectJ) rather than JDBC.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic