This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Sending an AutoGenerated Email

 
divya narayan
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • 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 ]
 
Rob Spoor
Sheriff
Pie
Posts: 20495
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
Karup Mew
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
Gamini Sirisena
Ranch Hand
Posts: 378
  • Mark post as helpful
  • send pies
  • 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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic