----- Original Message -----
From: "Stefan Bodewig" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, June 14, 2002 12:07 PM
Subject: Re: DO NOT REPLY [Bug 3836] - Mail task should allow port
specification
> On Fri, 14 Jun 2002, Rob Oxspring <[EMAIL PROTECTED]> wrote:
>
> > Am getting an NPE at Message.java:166 because getProject() is
> > returning null.
>
> Use the 1.5 branch, it contains a bug fix for it.
Okay a little bit lost here - thats what I thought I was doing. I had
checked out ANT_15_BRANCH and have since tried ANT_15_B1 and ANT_15_B2 and
all seem to have the same result (below). Which should I be running from?
I can't see how mailer is ever assigned a project unless
addMessage(Messsage) is called, which is a bit messed up when there are the
setMessage and setMessageFile alternatives. It seems to me that a little
insertion to EmailTask.java would fix this: (although a hack)
494 mailer.setProject( project );
But I don't want to send a patch for it if its I'm running from the wrong
version and its already fixed....
I'll have a fresh look over the weekend but for now I'm confused and
concerned,
Rob
>build -v -f ..\mail.xml -Dport=25
Apache Ant version 1.5Beta2 compiled on June 14 2002
Buildfile: ..\mail.xml
Detected Java version: 1.3 in: C:\JDK1.3.1_01\jre
Detected OS: Windows NT
parsing buildfile ..\mail.xml with URI =
file:E:/jakarta-ant/jakarta-ant/../mail
.xml
Project base dir set to: E:\jakarta-ant
Build sequence for target `all' is [all]
Complete build sequence is [all]
all:
Failed to initialise MIME mail
Using UU mail
Sending email: Hello on 25
>From me
To [me]
Cc []
Bcc []
BUILD FAILED
java.lang.NullPointerException
at
org.apache.tools.ant.taskdefs.email.Message.print(Message.java:166)
at
org.apache.tools.ant.taskdefs.email.PlainMailer.send(PlainMailer.java
:113)
at
org.apache.tools.ant.taskdefs.email.EmailTask.execute(EmailTask.java:
507)
at org.apache.tools.ant.Task.perform(Task.java:317)
at org.apache.tools.ant.Target.execute(Target.java:309)
at org.apache.tools.ant.Target.performTasks(Target.java:334)
at org.apache.tools.ant.Project.executeTarget(Project.java:1216)
at org.apache.tools.ant.Project.executeTargets(Project.java:1160)
at org.apache.tools.ant.Main.runBuild(Main.java:605)
at org.apache.tools.ant.Main.start(Main.java:195)
at org.apache.tools.ant.Main.main(Main.java:234)
Total time: 1 second
mail.xml:
<project default="all" basedir=".">
<target name="all">
<mail
from="me"
tolist="me"
mailhost="server"
mailport="${port}"
subject="Hello on ${port}"
files="build.xml"
/>
</target>
</project>
>
> > Is it just me? has ProjectComponent configuration been changed while
> > I wasn't looking?
>
> No, the Message object created in setMessage and setMessageFile will
> not get the project instance as IntorspectionHelper (which performs
> this magic) will never see this object.
>
> Stefan
>
> --
> To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>
>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>