• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java.lang.NoClassDefFoundError Using eclipse

 
Ind Sans
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am using eclipse 3.4.0 version.

I am trying to send a mail through java program, But i get the following error.

exception_name = java.lang.NoClassDefFoundError
exception_message = javax.mail.Session
script_name = Script6
script_id = Script6.java
line_number = 40
exception_stack = at Script6.testMain(Script6.java:40)
at org.eclipse.equinox.internal.app.EclipseAppContainer.callMethodWithException(EclipseAppContainer.java:574)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:195)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:382)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:549)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
at org.eclipse.equinox.launcher.Main.main(Main.java:1212)
at org.eclipse.core.launcher.Main.main(Main.java:30)
at com.rational.test.ft.util.FtClassLoader.loadClass(FtClassLoader.java:160)
at java.lang.ClassLoader.loadClass(ClassLoader.java:609)

I have added the following jar files in

Java->Build Path->classpath variables

activation 1.1.1.jar
dsn.jar
imap.jar
mail.jar
mailapi.jar
pop3.jar
smtp.jar

project->Java Build path
activation1.1.1.jar
imap.jar
mail.jar
smtp.jar

Any help...

thanks in advance

regards
bharat
 
Rob Spoor
Sheriff
Pie
Posts: 20555
57
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ind Sans wrote:exception_name = java.lang.NoClassDefFoundError
exception_message = javax.mail.Session

You must have miss-configured your class path and/or project properties since apparantly mail.jar is not loaded correctly.

Moving to IDEs.
 
Ind Sans
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rob Prime wrote:
Ind Sans wrote:exception_name = java.lang.NoClassDefFoundError
exception_message = javax.mail.Session

You must have miss-configured your class path and/or project properties since apparantly mail.jar is not loaded correctly.

Moving to IDEs.


Hi,

I am attaching the java class path, To my knowledge all the jar files are found in the location.
config1.jpg
[Thumbnail for config1.jpg]
config2.jpg
[Thumbnail for config2.jpg]
config.jpg
[Thumbnail for config.jpg]
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's the build classpath you're showing. What about the execution class path ? Check your libraries in Run/Run Configurations.../Classpath
 
Pradeep Katipamula
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not sure if the code is running as a standalone app. or on a web server.

If the program is a standalone as well as web app, Christophe is absolutely correct.

In addition if its a web app. try doing one or more of the following
1. Try adding the jars to the WEB-INF/lib
2. Goto
[project] -> Properties -> J2EE Module Dependencies. You will find all the dependencies, make sure all the checkboxes are selected. (BTW, I am using a eclipse version provided through Weblogic10.3)

Hope this helps.

Pradeep
 
Ind Sans
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Christophe Verré wrote:That's the build classpath you're showing. What about the execution class path ? Check your libraries in Run/Run Configurations.../Classpath


Hi,
I am attaching the screen shot for run. But run is not highlighted
config.JPG
[Thumbnail for config.JPG]
 
Ind Sans
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pradeep Katipamula wrote:I am not sure if the code is running as a standalone app. or on a web server.

If the program is a standalone as well as web app, Christophe is absolutely correct.

In addition if its a web app. try doing one or more of the following
1. Try adding the jars to the WEB-INF/lib
2. Goto
[project] -> Properties -> J2EE Module Dependencies. You will find all the dependencies, make sure all the checkboxes are selected. (BTW, I am using a eclipse version provided through Weblogic10.3)

Hope this helps.

Pradeep


Hi,
thanks for the reply,

My code is completely a stand alone, just a java file and pasted the code inside it.

regards
bharat.
 
Ind Sans
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Thanks guys, very much. I got it. There is also another folder called customization, Only in this folder the jar files need to be present. The problem is my system has got winserver2k8. And dosen't have documents and settings folder. I had to search in some other place.

Thanks guys got it.

regards
bharat
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic