You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by josh <jo...@speakeasy.net> on 2002/06/20 01:57:45 UTC

Re[4]: Failed to initialise MIME mail (newbie warning)

Wednesday, June 19, 2002, 4:40:20 PM, you wrote:

DH> --- josh <jo...@speakeasy.net> wrote:
>>   C:\src\nv\main\nv\scripts>echo %CLASSPATH%

DH> Just FYI: You don't need to set an env var -- the 'ant' script picks up
DH> everything in ANT_HOME/lib and adds it to the classpath it uses when it
DH> runs 'java'.

Good tip - thanks!

>> I'd be a lot happier if it was just a little bit more verbose. =/

DH> That was actually going to be my next suggestion -- trying running 'ant'
DH> with the -verbose flag. If that doesn't give enough info, try upping it to
DH> the -debug flag.

-verbose isn't, and the -debug flag got me this:

 Apache Ant version 1.5Beta2 compiled on June 17 2002
 Buildfile: build.xml
 Detected Java version: 1.4 in: c:\jdk\1.4.0\jre
 Detected OS: Windows 2000
 [massive snip]
 +User task: mail     org.apache.tools.ant.taskdefs.email.EmailTask
 [snip]
 +User task: mimemail     org.apache.tools.ant.taskdefs.optional.net.MimeMail
 [snip]
 +Target: application
   +Task: mkdir
   +Task: mail
 Build sequence for target `application' is [application]
 Complete build sequence is [application]

 application:
     [mail] Failed to initialise MIME mail
     [mail] Using UU mail
     [mail] Sending email: build results
     [mail] From joshw@speakeasy.net
     [mail] To [joshw@speakeasy.net]
     [mail] Cc []
     [mail] Bcc []
     [mail] Failed to send email



Harrumph.

There are people using the mail task, right?  It's not some squirrelly
feature no one ever uses, I'd imagine.  I can't figure out what I'm
doing wrong.

- josh


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re[6]: Failed to initialise MIME mail (newbie warning)

Posted by josh <jo...@speakeasy.net>.
Saturday, June 29, 2002, 11:50:26 AM, Diane wrote:

DH> --- Erik Hatcher <ja...@ehatchersolutions.com> wrote:
>> ----- Original Message -----
>> From: "josh" <jo...@speakeasy.net>
>> 
>> > If you mean sticking mail.jar and activation.jar in the
>> > ant/lib/optional directories, then yes.
>> 
>> ant/lib/optional directories????

DH> Yep -- Stephane recently fixed that in the doc. See:
 
DH> http://cvs.apache.org/viewcvs/jakarta-ant/docs/manual/install.html.diff?r1=1.30&r2=1.29.2.7&diff_format=h

DH> Diane

Good - I thought for a minute I hallucinated seeing that entry.

I should say that as a first-time ant user, a ant/lib directory makes
sense as the place to put additional jars, while an ant/lib/optional
directory seems strange and nonstandard.  Just my $0.02.

- josh


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Re[4]: Failed to initialise MIME mail (newbie warning)

Posted by Diane Holt <ho...@yahoo.com>.
--- Erik Hatcher <ja...@ehatchersolutions.com> wrote:
> ----- Original Message -----
> From: "josh" <jo...@speakeasy.net>
> 
> > If you mean sticking mail.jar and activation.jar in the
> > ant/lib/optional directories, then yes.
> 
> ant/lib/optional directories????

Yep -- Stephane recently fixed that in the doc. See:
 
http://cvs.apache.org/viewcvs/jakarta-ant/docs/manual/install.html.diff?r1=1.30&r2=1.29.2.7&diff_format=h

Diane

=====
(holtdl@yahoo.com)



__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Re[4]: Failed to initialise MIME mail (newbie warning)

Posted by Erik Hatcher <ja...@ehatchersolutions.com>.
----- Original Message -----
From: "josh" <jo...@speakeasy.net>

> If you mean sticking mail.jar and activation.jar in the
> ant/lib/optional directories, then yes.

ant/lib/optional directories????

No, only ANT_HOME/lib - no other directory is automatically added to the Ant
CLASSPATH, just this one.

    Erik



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re[4]: Failed to initialise MIME mail (newbie warning)

Posted by josh <jo...@speakeasy.net>.
Friday, June 28, 2002, 11:55:58 PM, you wrote:



>> Instead of NullPointerExceptions, I now get this from ant:
>>   [mail]Failed to initialise MIME mail
>>   [mail]sending email: (my subject)
>>   [mail]sending email with 3 attachments
>>
>> and I get this in my mailbox:
>>
>>   [my message, plus]
>>
>> I can see they're uuencoded, which is a good start, but my mail
>> client doesn't seem to recognize them as attachments.  So I'd have to
>> open up some sort of external uudecoder.  Sub-optimal.
>>
>> Any ideas?  What's the deal with MIME failing to init?

SL> have you read the stuff in the docs about external libraries. And done what
SL> it says

If you mean sticking mail.jar and activation.jar in the
ant/lib/optional directories, then yes.

- josh


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Re[2]: Failed to initialise MIME mail (newbie warning)

Posted by Steve Loughran <st...@iseran.com>.

> Instead of NullPointerExceptions, I now get this from ant:
>   [mail]Failed to initialise MIME mail
>   [mail]sending email: (my subject)
>   [mail]sending email with 3 attachments
>
> and I get this in my mailbox:
>
>   [my message, plus]
>
> I can see they're uuencoded, which is a good start, but my mail
> client doesn't seem to recognize them as attachments.  So I'd have to
> open up some sort of external uudecoder.  Sub-optimal.
>
> Any ideas?  What's the deal with MIME failing to init?

have you read the stuff in the docs about external libraries. And done what
it says


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re[2]: Failed to initialise MIME mail (newbie warning)

Posted by josh <jo...@speakeasy.net>.
Friday, June 28, 2002, 4:16:15 PM, you wrote:

HHw> This is because the Email task is not setting the project variable of
HHw> the message correctly in Beta 2.  Beta 3 has this fixed.

HHw> ----- Original Message -----
HHw> From: "josh" <jo...@speakeasy.net>

>> Hi!
>>
>> I had to put my ant mime mail problem on hold a while back, but it
>> never got solved.  And it's still not.

Well, that's BETTER, anyway.  Same environment as before, but with
Ant1.53b.

Instead of NullPointerExceptions, I now get this from ant:
  [mail]Failed to initialise MIME mail
  [mail]sending email: (my subject)
  [mail]sending email with 3 attachments

and I get this in my mailbox:

  [my message, plus]

I can see they're uuencoded, which is a good start, but my mail
client doesn't seem to recognize them as attachments.  So I'd have to
open up some sort of external uudecoder.  Sub-optimal.

Any ideas?  What's the deal with MIME failing to init?

- josh

Re: Failed to initialise MIME mail (newbie warning)

Posted by "Hal Hildebrand (web)" <Ha...@hellblazer.com>.
This is because the Email task is not setting the project variable of
the message correctly in Beta 2.  Beta 3 has this fixed.

----- Original Message -----
From: "josh" <jo...@speakeasy.net>

> Hi!
>
> I had to put my ant mime mail problem on hold a while back, but it
> never got solved.  And it's still not.
>
> So, again, to recap for those of you who haven't been waiting around
> just *dying* to find out what happened to my ant build problem:
>
> ant -version     = 1.5beta2 (binary release)
> java -version    = 1.4.0_01 Sun Hotspot jdk on Linux
> OS               = Linux, like I said up there ^^^^^
> mail.jar         = in ant/lib/optional
> activation.jar   = likewise
> Sunspot activity = very low
>
> I can send regular mail like this:
>
>   <mail
>     mailhost="localhost"
>     tolist="me@here.com"
>     from="me@localhost"
>     subject="the update task"
>     message="cvs update logs">
>     files="cvs.log"
>   />
>
> That works dandy.  Great.  One might even say it works spectacularly
> well.  However, when I try to get it to send cvs.log as an
> attachment thusly:
>
>   <mail
>     mailhost="localhost"
>     tolist="me@here.com"
>     from="me@localhost"
>     subject="the update task"
>     message="cvs update logs">
>     <fileset dir=".">
>       <include name="*.log"/>
>     </fileset>
>   </mail>
>
> I get a horrible, ugly error, to wit:
>   mail
>   Failed to initialise MIME mail
>   Sending email: nv build
>   java.lang.NullPointerException
>         at
org.apache.tools.ant.taskdefs.email.Message.print(Message.java)
>         at
org.apache.tools.ant.taskdefs.email.PlainMailer.send(PlainMailer.java)
>         at
org.apache.tools.ant.taskdefs.email.EmailTask.execute(EmailTask.java)
>         [...]
>
>
> Ok, that's about it.  I've attached the full error log in case anyone
> cares about it.  Thanks for any enlightenment you may be able to
> provide.
>
> - josh


------------------------------------------------------------------------
--------


> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Failed to initialise MIME mail (newbie warning)

Posted by josh <jo...@speakeasy.net>.
Hi!

I had to put my ant mime mail problem on hold a while back, but it
never got solved.  And it's still not.

So, again, to recap for those of you who haven't been waiting around
just *dying* to find out what happened to my ant build problem:

ant -version     = 1.5beta2 (binary release)
java -version    = 1.4.0_01 Sun Hotspot jdk on Linux
OS               = Linux, like I said up there ^^^^^
mail.jar         = in ant/lib/optional
activation.jar   = likewise
Sunspot activity = very low

I can send regular mail like this:

  <mail
    mailhost="localhost"
    tolist="me@here.com"
    from="me@localhost"
    subject="the update task"
    message="cvs update logs">
    files="cvs.log"
  />

That works dandy.  Great.  One might even say it works spectacularly
well.  However, when I try to get it to send cvs.log as an
attachment thusly:

  <mail
    mailhost="localhost"
    tolist="me@here.com"
    from="me@localhost"
    subject="the update task"
    message="cvs update logs">
    <fileset dir=".">
      <include name="*.log"/>
    </fileset>
  </mail>

I get a horrible, ugly error, to wit:
  mail
  Failed to initialise MIME mail
  Sending email: nv build
  java.lang.NullPointerException
        at org.apache.tools.ant.taskdefs.email.Message.print(Message.java)
        at org.apache.tools.ant.taskdefs.email.PlainMailer.send(PlainMailer.java)
        at org.apache.tools.ant.taskdefs.email.EmailTask.execute(EmailTask.java)
        [...]


Ok, that's about it.  I've attached the full error log in case anyone
cares about it.  Thanks for any enlightenment you may be able to
provide.

- josh

Re: Re[6]: Failed to initialise MIME mail (newbie warning)

Posted by Stefan Bodewig <bo...@apache.org>.
On Wed, 19 Jun 2002, <jo...@speakeasy.net> wrote:

>   C:\src\nv\main\nv\scripts\build.xml:19: IO error sending mail
>     at
>     org.apache.tools.ant.taskdefs.email.PlainMailer.send(PlainMailer.java
>     :124) at

This certainly means Ant doesn't get through to your mailer.

Either it isn't accepting the connection (on port 25) or some problem
occurs during the SMTP conversation - like the server not accepting
the mail as it won't relay.

It works for me (using sendmail as the accepting MTA), we know that MS
Exchange can sometimes cause problems.  This is rather hard to debug
(if the problem occurs during the SMTP conversation) - the best thing
you could do was to scatter logging messages all over the code in the
org.apache.tools.mail package.

The first thing I'd do, though was trying telnet with all the
parameters from your buildfile.  See below: All lines starting with
numbers are roughly what one would expect from a mailserver (the text
doesn't matter at all).  The lines not starting with numbers (the
first one is tzhe HELO line) are supposed to be entered by you.

,----
| prompt> telnet [mailhost attribute or localhost] 25
| Connected to FOO
| Escape character is '^]'.
| 220 FOO
| HELO [whatever your sending box calls itself]
| 250 FOO
| MAIL FROM <[email from your from attribute]>
| 250 2.1.0 <FOO>... Sender ok
| RCPT To: <[on of the emails of your tolist attribute]>
| 250 2.1.5 <FOO>... Recipient ok
| DATA
| 354 Enter mail, end with "." on a line by itself
| Subject: [subject attribute]
| 
| [your message goes here]
| .
| 250 2.0.0 FOO Message accepted for delivery
| quit
| 221 2.0.0 FOO closing connection
| Connection closed by foreign host.
`----

Stefan

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Re[6]: Failed to initialise MIME mail (newbie warning)

Posted by Steve Loughran <st...@iseran.com>.
----- Original Message ----- 
From: "Diane Holt" <ho...@yahoo.com>
To: "Ant Users List" <an...@jakarta.apache.org>
Sent: Wednesday, June 19, 2002 20:57
Subject: Re: Re[6]: Failed to initialise MIME mail (newbie warning)


> --- Steve Loughran <st...@iseran.com> wrote:
> > maybe, like, you cant talk to the mail server
> 
> But would that also be the cause of the first error about not being able
> to initialise MIME mail?

nope


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Re[6]: Failed to initialise MIME mail (newbie warning)

Posted by Diane Holt <ho...@yahoo.com>.
--- Steve Loughran <st...@iseran.com> wrote:
> maybe, like, you cant talk to the mail server

But would that also be the cause of the first error about not being able
to initialise MIME mail?

Diane

=====
(holtdl@yahoo.com)



__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Re[6]: Failed to initialise MIME mail (newbie warning)

Posted by Steve Loughran <st...@iseran.com>.
----- Original Message -----
From: "josh" <jo...@speakeasy.net>
To: "Ant Users List" <an...@jakarta.apache.org>
Sent: Wednesday, June 19, 2002 17:37
Subject: Re[6]: Failed to initialise MIME mail (newbie warning)


>
>   C:\src\nv\main\nv\scripts\build.xml:19: IO error sending mail
>     at
org.apache.tools.ant.taskdefs.email.PlainMailer.send(PlainMailer.java :124)
>     at
org.apache.tools.ant.taskdefs.email.EmailTask.execute(EmailTask.java:507)
>     at org.apache.tools.ant.Task.perform(Task.java:317)
>     at [...]

maybe, like, you cant talk to the mail server


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Re[6]: Failed to initialise MIME mail (newbie warning)

Posted by Stefan Bodewig <bo...@apache.org>.
On Wed, 19 Jun 2002, Diane Holt <ho...@yahoo.com> wrote:

> Yeah, but he says he has the mail.jar file in ANT_HOME/lib -- so if
> it's not finding that, then something's wrong, somewhere along the
> line,

True.  Maybe a self-compiled Ant without the MimeMailer class.

The real problem will be something different though, as Ant tries to
send the mail and fails (or better the one which is causing the task
to fail).

Stefan

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Re[6]: Failed to initialise MIME mail (newbie warning)

Posted by Steve Loughran <st...@iseran.com>.
----- Original Message -----
From: "Diane Holt" <ho...@yahoo.com>
To: "Ant Users List" <an...@jakarta.apache.org>
Sent: Wednesday, June 19, 2002 23:48
Subject: Re: Re[6]: Failed to initialise MIME mail (newbie warning)


> --- Stefan Bodewig <bo...@apache.org> wrote:
> > "Failed to initialise..." says it didn't find the JavaMail stuff, but
> > then Ant falls back to the built-in SMTP implementation and tries to
> > send the mail.
>
> Yeah, but he says he has the mail.jar file in ANT_HOME/lib -- so if it's
> not finding that, then something's wrong, somewhere along the line, and I
> was suggesting that if he could track down what that something was, that
> might actually clear up the succeeding problems. It was just a suggestion,
> though, that may or may not pan out.

activation.jar too right? You need both.

MIME is trouble. It's a woolly spec, makes all implementations complex.
Becomes a big issue in the SOAP world; you can only do binary attachements
with {mail,activation, saaj}.jar, the latter being some spinoff of JAX-RPC.



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Re[6]: Failed to initialise MIME mail (newbie warning)

Posted by Diane Holt <ho...@yahoo.com>.
--- Stefan Bodewig <bo...@apache.org> wrote:
> "Failed to initialise..." says it didn't find the JavaMail stuff, but
> then Ant falls back to the built-in SMTP implementation and tries to
> send the mail.

Yeah, but he says he has the mail.jar file in ANT_HOME/lib -- so if it's
not finding that, then something's wrong, somewhere along the line, and I
was suggesting that if he could track down what that something was, that
might actually clear up the succeeding problems. It was just a suggestion,
though, that may or may not pan out.

Diane

=====
(holtdl@yahoo.com)



__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Re[6]: Failed to initialise MIME mail (newbie warning)

Posted by Stefan Bodewig <bo...@apache.org>.
On Wed, 19 Jun 2002, Diane Holt <ho...@yahoo.com> wrote:

> It might actually meet its end at that point, but your troubles
> begin at the "Failed to initialise..."

I don't think so.

"Failed to initialise..." says it didn't find the JavaMail stuff, but
then Ant falls back to the built-in SMTP implementation and tries to
send the mail.

You don't need JavaMail to use <mail>, it is recommended to do so -
and if you want to send attachments you really better do - but it is
not required.

Stefan

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Re[6]: Failed to initialise MIME mail (newbie warning)

Posted by Diane Holt <ho...@yahoo.com>.
--- josh <jo...@speakeasy.net> wrote:
> Here's the part where it dies, for anyone who's interested:
> 
>   C:\src\nv\main\nv\scripts\build.xml:19: IO error sending mail

It might actually meet its end at that point, but your troubles begin at
the "Failed to initialise..."  If you can find out why that's happening
(maybe looking at EmailTask.java would give you some clue?), the other
errors will probably go away as well.

(BTW: Have you verified that your optional.jar file actually has
MimeMailer.class in it?)

Diane

=====
(holtdl@yahoo.com)



__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re[6]: Failed to initialise MIME mail (newbie warning)

Posted by josh <jo...@speakeasy.net>.
Wednesday, June 19, 2002, 5:18:13 PM, Diane Holt wrote:

DH> So I'd say there has to be something different going on in your setup than
DH> in mine -- I just couldn't say what that difference is.

That certainly seems to be the case.  Thanks for taking the time to
investigate, though - I appreciate it.

Here's the part where it dies, for anyone who's interested:

  C:\src\nv\main\nv\scripts\build.xml:19: IO error sending mail
    at org.apache.tools.ant.taskdefs.email.PlainMailer.send(PlainMailer.java :124)
    at org.apache.tools.ant.taskdefs.email.EmailTask.execute(EmailTask.java:507)
    at org.apache.tools.ant.Task.perform(Task.java:317)
    at [...]

DH> You do have
DH> ant.jar, optional.jar, mail.jar, and activation.jar all in ANT_HOME/lib,
DH> right?

Sure do.

- josh


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Re[4]: Failed to initialise MIME mail (newbie warning)

Posted by Diane Holt <ho...@yahoo.com>.
> There are people using the mail task, right?  It's not some squirrelly
> feature no one ever uses, I'd imagine.  I can't figure out what I'm
> doing wrong.

Well, I don't really know whether it's squirrelly or not -- but people do
use it :)

Unfortunately, I can't figure out what you're doing wrong, either, since I
went ahead and downloaded the two needed jar files, ran your build file,
and got:

application:
     [mail] Sending email: build results

(Of course, then it puked all over its shoes, since I didn't change
anything in your target, including the me@... and the [my machine...]
stuff. Then again, it would have anyway, since I don't have any mail set
up on my machine :)

So I'd say there has to be something different going on in your setup than
in mine -- I just couldn't say what that difference is. You do have
ant.jar, optional.jar, mail.jar, and activation.jar all in ANT_HOME/lib,
right?

Diane 

=====
(holtdl@yahoo.com)



__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>