Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Linux Archive
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-27-2007, 06:48 AM
bbq bbq is offline
Senior Member
 
Join Date: Jun 2007
Posts: 134
bbq is on a distinguished road
java.lang.NoClassDefFoundError: javax/activation/DataSource
I’m trying to learn javamail. I did a web page to test it.
my code:
Code:
import java.util.Properties; import javax.mail.*; import javax.mail.internet.*; public class Sendemail { public static void main(String [] args) { String from="carcaharas@hotmail.com"; String to="carcaharas@yahoo.com"; //String smtpHost = "smtp.auna.com"; Properties props = System.getProperties(); props.put("mail.smtp.host", "smtp.ono.com"); Session sesion = Session.getDefaultInstance(props,null); try { Message message = new MimeMessage(session); message.setSubject("Hello world"); message.setFrom(new InternetAddress(from)); message.addRecipient( Message.RecipientType.TO, new InternetAddress(to)); message.setText("this is the body of the message "); Transport.send(message); } catch (MessagingException e) { System.error.println(e.getMessage()); } } }
and the error is:
Code:
java.lang.NoClassDefFoundError: javax/activation/DataSource Exception in thread "main"
the problem is in the line

Code:
Message message = new MimeMessage(session);
any ideas?
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-05-2007, 06:26 AM
Senior Member
 
Join Date: Jun 2007
Posts: 130
Jack is on a distinguished road
check it
http://java.sun.com/products/javabea...ads/index.html
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
java.lang.NoClassDefFoundError: com.ibm.ws.orb.GlobalORBFactory hawkeye Enterprise JavaBeans 1 06-16-2008 12:56 PM
java.lang.NoClassDefFoundError J_a_y New To Java 2 08-07-2007 01:51 PM
java.lang.NoClassDefFoundError fred Advanced Java 3 08-01-2007 07:00 PM
java.lang.ClassNotFoundException: javax.xml.parsers.SAXParserFactory simon Eclipse 1 07-24-2007 01:54 AM
java.lang.NoClassDefFoundError Exception when I invoke to a class outside projectEJB Daniel Enterprise JavaBeans 1 07-06-2007 08:08 AM


All times are GMT +3. The time now is 04:54 PM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org