Strange compile problem with javax.mail
From: Andreas Wollschlaeger (postmaster_at_1.0.0.127.in-addr.arpa)
Date: 01/29/04
- Next message: Jacob: "How to change JFileChooser text elements?"
- Previous message: Thomas Weidenfeller: "Usenet ettitiquette (was: Re: some questions)"
- Next in thread: GaryM: "Re: Strange compile problem with javax.mail"
- Reply: GaryM: "Re: Strange compile problem with javax.mail"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 29 Jan 2004 12:27:26 +0100
Hi folks,
i have a strange problem this morning which is just driving me nuts :-/
I am working on an app, one part is the sending of some email via
javax.mail! Here is a snippet of code:
-- snip --
java.util.Properties p = System.getProperties();
javax.mail.Session s = javax.mail.Session.getDefaultInstance(p);
Message m = new MimeMessage(s);
...
Transport t = s.getTransport("smtp");
t.connect(smtphost, username, password);
t.sendMessage(m, m.getAllRecipients());
t.close();
-- snip --
Nothing special here! Now the problem: From within Netbeans, this
compiles and runs perfectly. But, when i launch ant to build the same
stuff, javac woes:
Compiling 34 source files to C:\work\ELP_BOT\ELP_BOT\__ELP_BOT\build
__ELP_BOT\src\com\elpmedien\backorder_tool\MailHelper.java [40]
getDefaultInstance(java.util.Properties,javax.mail.Authenticator) in
javax.mail.Session cannot be applied to (java.util.Properties)
javax.mail.Session s = javax.mail.Session.getDefaultInstance(p);
^
1 error
The strange thing is, i use the same set of jars both for Netbeans and
Ant! I also tried updating mail.jar and activation.jar with the current
version from java.sun.com, same result.
If i change the invocation of getDefaultInstance() to
javax.mail.Session s = javax.mail.Session.getDefaultInstance(p,null);
the code builds, but throws an exception:
java.lang.NoClassDefFoundError: com/sun/mail/util/MailDateFormat
at com.elpmedien.backorder_tool.MailHelper.sendMail(Unknown Source)
Any ideas?
Cheers
Andreas
- Next message: Jacob: "How to change JFileChooser text elements?"
- Previous message: Thomas Weidenfeller: "Usenet ettitiquette (was: Re: some questions)"
- Next in thread: GaryM: "Re: Strange compile problem with javax.mail"
- Reply: GaryM: "Re: Strange compile problem with javax.mail"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|