aspose file tools*
The moose likes IDEs, Version Control and other tools and the fly likes java.lang.NoClassDefFoundError  Using eclipse 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.NoClassDefFoundError  Using eclipse" Watch "java.lang.NoClassDefFoundError  Using eclipse" New topic
Author

java.lang.NoClassDefFoundError Using eclipse

Ind Sans
Greenhorn

Joined: Jan 07, 2010
Posts: 11
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

Joined: Oct 27, 2005
Posts: 19722
    
  20

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.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Ind Sans
Greenhorn

Joined: Jan 07, 2010
Posts: 11
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.


[Thumbnail for config1.jpg]

[Thumbnail for config2.jpg]

[Thumbnail for config.jpg]

Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

That's the build classpath you're showing. What about the execution class path ? Check your libraries in Run/Run Configurations.../Classpath


[My Blog]
All roads lead to JavaRanch
Pradeep Katipamula
Ranch Hand

Joined: May 11, 2010
Posts: 37
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

Joined: Jan 07, 2010
Posts: 11
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


[Thumbnail for config.JPG]

Ind Sans
Greenhorn

Joined: Jan 07, 2010
Posts: 11
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

Joined: Jan 07, 2010
Posts: 11
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
 
wood burning stoves
 
subject: java.lang.NoClassDefFoundError Using eclipse