• 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

Sending an AutoGenerated Email

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying to send an AutoGeneratedEmail from my javaapplication.
The jar files I use are mail.jar and activation.jar. But somehow both are not compatible and my code does not work.
My code is


And when I run without activation.jar it gives following error
Exception in thread "main" java.lang.NoClassDefFoundError: javax/activation/DataSource
at com.vero.vas.email.EmailUtils.sendIfSaleEmail(EmailUtils.java:33)
at com.vero.vas.client.app.TestSendingEmail.main(TestSendingEmail.java:12)

Can someone tell me how to know the dependancy of mail.jar on activation.jar?

Thanks in advance

[edit]Add code tags. CR[/edit]
[ September 09, 2008: Message edited by: Campbell Ritchie ]
 
Sheriff
Posts: 22789
131
Eclipse IDE Spring Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is your classpath set up correctly? Because that class is in activation.jar
 
divya narayan
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, my classpath is set correctly.
Since the program is getting compiled, classpath has to be set properly.

Does the versions of jar files make any difference?
If so please suggest me which versions i can use, my jdk is jdk1.5.0_11 and jre is jre1.5.0_11.

Thanks,
Divya
 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
check the version of Javamail Api and JavaBeans Activation Framework(JAF)which contains mail.jar and activation.jar respectively and must include both jar files in classpath otherwise use JAVA SE6 because it already included the activation.jar
 
divya narayan
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have set classpath for both the jars.
The versions used are javamail-1_4_1.zip and jaf-1_1_1.zip respectively. Since my office uses this jdk version i cant update it to 6.

What else could be the reason?

Thanks,
Divya
 
Ranch Hand
Posts: 378
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can we take a look at your classpath?

And also the path where the jars are contained?

Also how are you executing this program? As a stand alone Java Program or as part of some container based application?
[ September 11, 2008: Message edited by: Gamini Sirisena ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic