• 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.NoClassDefFoundError Using eclipse

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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]
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
reply
    Bookmark Topic Watch Topic
  • New Topic