Exception in thread "main" java.lang.NoClassDefFoundError: org/aspectj/lang
Hi Friends,
I am Ravi. In my application I'm trying to connect my java class file with the DB but it is giving following error:
Exception in thread "main" java.lang.NoClassDefFoundError: org/aspectj/lang/Signature
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at _InfoClient.main(_InfoClient.java:29)
I am now really fedup because from last 3 days i'm trying to over come from this method. I have tried each and every thing what ever suggested in each and every forum but still not working.
Note: One important thing when I'm trying to connect through JSP it is working fine.
Please help me....Any help would be GREATLY appreciated....
Thanx in advance....
Raviji
[774 byte] By [
Ravijia] at [2007-11-26 19:46:35]

# 1
Can u send the code which raised this exception So i can review
# 2
there's a problemein the classpath of your JRE
when you run the main method of your class, the jvm have a different classpath than the JSP
-the jsp is in the a webapp in a server, sio it has everything in the WEB-INF/lib/ directory in it's classpath
-your main method is launched from the command line, no? it's here that you must specify the classpath to a .jar file containing the classes toy need
it's a quite obvious issue, so I guess you're not used to java. I'd recommend you to first learn the basics, to avoid loosing days finding solutions to common problems
# 3
Thanx Alban for your reply......
But I will tell you one thing, It might be basic problem but on each forum you will find the same question posted over there. So according to you no one known the basic?
Anyways
Hi SantoshChandula I'm trying to run only below simple program from command prompt and getting this error:
public class MySQLTestMain
{
public static void main(String[] args)
{
try
{
Class.forName("com.mysql.jdbc.Driver");
System.out.println("Succes!");
}
catch (ClassNotFoundException e)
{
System.out.println("Error");
System.out.println(e.getStackTrace());
}
}
}
# 4
ho not at all
according to me people get easily stuck in this problem, and they think the basic response is not enougth for them..but that's false
(BTW ClassNotFoundException != NoClassDefFoundError (strongly))
the problem is the definition of the class is not found... there can be many reason :
- your class is present twice in the classpath
-a class is referenced somwhere and is not present in the class path (see dependencies)
etc...
It is a problem of CLASSPATH and what it contains
do you know where the the jar containing the Signature class is?
how did you tell the java runtime environement where it is?
# 5
Hi alban.maillere,
Thanx for the reply.....
Actually I tested it from c:\<java_home>\bin folder and it is working fine.....
but when i'm trying to run the same file from c:\<java_home>\bin\Raviji\Connect folder it is not running...
shell i add full path of the file into the classpath?
# 6
You get this error because you are trying to use the debug version of the MySQL driver. Use the production driver instead. http://forums.mysql.com/read.php?39,22579,120168
# 7
I'm not using any debug version....I'm sure that it is only production version of mysql driver.Any other help......
# 8
What is the exact name of the jarfile you are using?If it has "-g" in it, it is the debug version.
# 9
Hi masijade,You should read my post carefully....I wrote that I'm sure that I'm not using debug version.BTW i'm using mysql-connector-java-3.1.10-bin.jar file, and same in the classpath.
# 10
> Hi masijade,
> You should read my post carefully....I wrote that I'm
> sure that I'm not using debug version.
>
> BTW i'm using mysql-connector-java-3.1.10-bin.jar
> file, and same in the classpath.
And how are we suppossed to know that you know that "-g" indicates the debug version when you give no indication of that. I have often seen where someone says "Oh, I'm sure I'm using the right one." and then when I actually looked at it he was using the wrong one.
All you had to do, to avoid my last post, was to say, in your post, I am sure I am using the production version as the name does not contain "-g" (or the name of the jarfile is). That would have demonstrated that you did know. As it is your post is nothing more than you stomping your foot saying "No I'm not!".