ant task mail fails on jdk10

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

ant task mail fails on jdk10

Simon IJskes - QCG
As bugzilla is unreachable for now:

     <target name="_testmail" >
         <mail mailhost="mail" mailport="25" from="[hidden email]"
subject="Testemail"  >
             <to address="[hidden email]" />
         </mail>
     </target>

$ JAVA_HOME=/usr/lib/jvm/java-8-oracle/ ~/opt/apache-ant-1.10.4/bin/ant
_testmail

runs ok.

_testmail:
      [mail] Sending email: Testemail
      [mail] Sent email with 0 attachments


$ JAVA_HOME=/usr/lib/jvm/java-10-oracle/ ~/opt/apache-ant-1.10.4/bin/ant
_testmail

_testmail:
      [mail] Failed to send email: javax.activation.DataHandler

BUILD FAILED
....../build.xml:6: java.lang.ClassNotFoundException:
javax.activation.DataHandler
        at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:466)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:566)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:499)
        at java.base/java.lang.Class.forName0(Native Method)
        at java.base/java.lang.Class.forName(Class.java:291)
        at
org.apache.tools.ant.taskdefs.email.EmailTask.execute(EmailTask.java:457)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
        at
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
        at
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:564)
        at
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)
        at org.apache.tools.ant.Task.perform(Task.java:350)
        at org.apache.tools.ant.Target.execute(Target.java:449)
        at org.apache.tools.ant.Target.performTasks(Target.java:470)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1388)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1361)
        at
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
        at org.apache.tools.ant.Main.runBuild(Main.java:834)
        at org.apache.tools.ant.Main.startAnt(Main.java:223)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:284)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:101)


--
QCG, Software development, 071-5890970, http://www.qcg.nl
Quality Consultancy Group b.v., Leiderdorp, Kvk Den Haag: 28088397

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: ant task mail fails on jdk10

Stefan Bodewig
Thank you, Simon

On 2018-07-02, Simon IJskes - QCG wrote:

> As bugzilla is unreachable for now:

>     <target name="_testmail" >
>         <mail mailhost="mail" mailport="25" from="[hidden email]"
> subject="Testemail"  >
>             <to address="[hidden email]" />
>         </mail>
>     </target>

> $ JAVA_HOME=/usr/lib/jvm/java-8-oracle/
> ~/opt/apache-ant-1.10.4/bin/ant _testmail

> runs ok.

> _testmail:
>      [mail] Sending email: Testemail
>      [mail] Sent email with 0 attachments


> $ JAVA_HOME=/usr/lib/jvm/java-10-oracle/
> ~/opt/apache-ant-1.10.4/bin/ant _testmail

> _testmail:
>      [mail] Failed to send email: javax.activation.DataHandler

JAF has been removed from Java 10, so now you need to provide its
replacement https://github.com/javaee/activation when starting Ant.

I don't really think we need to change anything inside of Ant but should
document the fact and likely add something to the FAQ in addition to the
mail task's manual page.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

AW: ant task mail fails on jdk10

Jan Matèrne (jhm)
We already have something:
mail: "This task may depend on external libraries that are not included in
the Ant distribution. See Library Dependencies for more information."
dependencies:
"mail.jar Mail task with Mime encoding, and the MimeMail task
http://www.oracle.com/technetwork/java/index-138643.html
 activation.jar Mail task with Mime encoding, and the MimeMail task
http://www.oracle.com/technetwork/java/javase/jaf-135115.html"

mail.jar could be downloaded via "ant -f fetch.xml javamail", but activation
has to be installed.


So what changed with Java10?


Jan


> -----Ursprüngliche Nachricht-----
> Von: Stefan Bodewig [mailto:[hidden email]]
> Gesendet: Montag, 2. Juli 2018 18:00
> An: [hidden email]; Simon IJskes - QCG
> Betreff: Re: ant task mail fails on jdk10
>
> Thank you, Simon
>
> On 2018-07-02, Simon IJskes - QCG wrote:
>
> > As bugzilla is unreachable for now:
>
> >     <target name="_testmail" >
> >         <mail mailhost="mail" mailport="25" from="[hidden email]"
> > subject="Testemail"  >
> >             <to address="[hidden email]" />
> >         </mail>
> >     </target>
>
> > $ JAVA_HOME=/usr/lib/jvm/java-8-oracle/
> > ~/opt/apache-ant-1.10.4/bin/ant _testmail
>
> > runs ok.
>
> > _testmail:
> >      [mail] Sending email: Testemail
> >      [mail] Sent email with 0 attachments
>
>
> > $ JAVA_HOME=/usr/lib/jvm/java-10-oracle/
> > ~/opt/apache-ant-1.10.4/bin/ant _testmail
>
> > _testmail:
> >      [mail] Failed to send email: javax.activation.DataHandler
>
> JAF has been removed from Java 10, so now you need to provide its
> replacement https://github.com/javaee/activation when starting Ant.
>
> I don't really think we need to change anything inside of Ant but
> should document the fact and likely add something to the FAQ in
> addition to the mail task's manual page.
>
> Stefan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email] For additional
> commands, e-mail: [hidden email]



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

AW: ant task mail fails on jdk10

Jan Matèrne (jhm)
Did my own test:

     <mail mailhost="${mail.host}" user="${mail.user}"
password="${mail.pwd}" from="${from}" subject="Testemail">
         <to address="${to}"/>
         <message>
            Ant-Version:  ${ant.version}
            Java-Version: ${java.version}
         </message>
     </mail>

Running with Java8 + Java10, and I got my two mails:

            Ant-Version:  Apache Ant(TM) version 1.10.1 compiled on February
2 2017
            Java-Version: 1.8.0_171

respectively

            Ant-Version:  Apache Ant(TM) version 1.10.1 compiled on February
2 2017
            Java-Version: 10.0.1


I contrast to my last mail, I could install activation via fetch.xml.
I had run "ant -f fetch -Ddest=system" before.


Jan



> -----Ursprüngliche Nachricht-----
> Von: Jan Matèrne (jhm) [mailto:[hidden email]]
> Gesendet: Dienstag, 3. Juli 2018 07:43
> An: 'Ant Developers List'
> Betreff: AW: ant task mail fails on jdk10
>
> We already have something:
> mail: "This task may depend on external libraries that are not included
> in the Ant distribution. See Library Dependencies for more
> information."
> dependencies:
> "mail.jar Mail task with Mime encoding, and the MimeMail task
> http://www.oracle.com/technetwork/java/index-138643.html
>  activation.jar Mail task with Mime encoding, and the MimeMail task
> http://www.oracle.com/technetwork/java/javase/jaf-135115.html"
>
> mail.jar could be downloaded via "ant -f fetch.xml javamail", but
> activation has to be installed.
>
>
> So what changed with Java10?
>
>
> Jan
>
>
> > -----Ursprüngliche Nachricht-----
> > Von: Stefan Bodewig [mailto:[hidden email]]
> > Gesendet: Montag, 2. Juli 2018 18:00
> > An: [hidden email]; Simon IJskes - QCG
> > Betreff: Re: ant task mail fails on jdk10
> >
> > Thank you, Simon
> >
> > On 2018-07-02, Simon IJskes - QCG wrote:
> >
> > > As bugzilla is unreachable for now:
> >
> > >     <target name="_testmail" >
> > >         <mail mailhost="mail" mailport="25" from="[hidden email]"
> > > subject="Testemail"  >
> > >             <to address="[hidden email]" />
> > >         </mail>
> > >     </target>
> >
> > > $ JAVA_HOME=/usr/lib/jvm/java-8-oracle/
> > > ~/opt/apache-ant-1.10.4/bin/ant _testmail
> >
> > > runs ok.
> >
> > > _testmail:
> > >      [mail] Sending email: Testemail
> > >      [mail] Sent email with 0 attachments
> >
> >
> > > $ JAVA_HOME=/usr/lib/jvm/java-10-oracle/
> > > ~/opt/apache-ant-1.10.4/bin/ant _testmail
> >
> > > _testmail:
> > >      [mail] Failed to send email: javax.activation.DataHandler
> >
> > JAF has been removed from Java 10, so now you need to provide its
> > replacement https://github.com/javaee/activation when starting Ant.
> >
> > I don't really think we need to change anything inside of Ant but
> > should document the fact and likely add something to the FAQ in
> > addition to the mail task's manual page.
> >
> > Stefan
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [hidden email] For additional
> > commands, e-mail: [hidden email]
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email] For additional
> commands, e-mail: [hidden email]



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: ant task mail fails on jdk10

Gintautas Grigelionis
libraries.properties for Ant 1.10.x specify javax.mail 1.6.1 which pulls in
activation 1.1

Gintas

On Tue, 3 Jul 2018 at 08:19, Jan Matèrne (jhm) <[hidden email]> wrote:

> Did my own test:
>
>      <mail mailhost="${mail.host}" user="${mail.user}"
> password="${mail.pwd}" from="${from}" subject="Testemail">
>          <to address="${to}"/>
>          <message>
>             Ant-Version:  ${ant.version}
>             Java-Version: ${java.version}
>          </message>
>      </mail>
>
> Running with Java8 + Java10, and I got my two mails:
>
>             Ant-Version:  Apache Ant(TM) version 1.10.1 compiled on
> February
> 2 2017
>             Java-Version: 1.8.0_171
>
> respectively
>
>             Ant-Version:  Apache Ant(TM) version 1.10.1 compiled on
> February
> 2 2017
>             Java-Version: 10.0.1
>
>
> I contrast to my last mail, I could install activation via fetch.xml.
> I had run "ant -f fetch -Ddest=system" before.
>
>
> Jan
>
>
>
> > -----Ursprüngliche Nachricht-----
> > Von: Jan Matèrne (jhm) [mailto:[hidden email]]
> > Gesendet: Dienstag, 3. Juli 2018 07:43
> > An: 'Ant Developers List'
> > Betreff: AW: ant task mail fails on jdk10
> >
> > We already have something:
> > mail: "This task may depend on external libraries that are not included
> > in the Ant distribution. See Library Dependencies for more
> > information."
> > dependencies:
> > "mail.jar     Mail task with Mime encoding, and the MimeMail task
> > http://www.oracle.com/technetwork/java/index-138643.html
> >  activation.jar       Mail task with Mime encoding, and the MimeMail task
> > http://www.oracle.com/technetwork/java/javase/jaf-135115.html"
> >
> > mail.jar could be downloaded via "ant -f fetch.xml javamail", but
> > activation has to be installed.
> >
> >
> > So what changed with Java10?
> >
> >
> > Jan
> >
> >
> > > -----Ursprüngliche Nachricht-----
> > > Von: Stefan Bodewig [mailto:[hidden email]]
> > > Gesendet: Montag, 2. Juli 2018 18:00
> > > An: [hidden email]; Simon IJskes - QCG
> > > Betreff: Re: ant task mail fails on jdk10
> > >
> > > Thank you, Simon
> > >
> > > On 2018-07-02, Simon IJskes - QCG wrote:
> > >
> > > > As bugzilla is unreachable for now:
> > >
> > > >     <target name="_testmail" >
> > > >         <mail mailhost="mail" mailport="25" from="[hidden email]"
> > > > subject="Testemail"  >
> > > >             <to address="[hidden email]" />
> > > >         </mail>
> > > >     </target>
> > >
> > > > $ JAVA_HOME=/usr/lib/jvm/java-8-oracle/
> > > > ~/opt/apache-ant-1.10.4/bin/ant _testmail
> > >
> > > > runs ok.
> > >
> > > > _testmail:
> > > >      [mail] Sending email: Testemail
> > > >      [mail] Sent email with 0 attachments
> > >
> > >
> > > > $ JAVA_HOME=/usr/lib/jvm/java-10-oracle/
> > > > ~/opt/apache-ant-1.10.4/bin/ant _testmail
> > >
> > > > _testmail:
> > > >      [mail] Failed to send email: javax.activation.DataHandler
> > >
> > > JAF has been removed from Java 10, so now you need to provide its
> > > replacement https://github.com/javaee/activation when starting Ant.
> > >
> > > I don't really think we need to change anything inside of Ant but
> > > should document the fact and likely add something to the FAQ in
> > > addition to the mail task's manual page.
> > >
> > > Stefan
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [hidden email] For additional
> > > commands, e-mail: [hidden email]
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [hidden email] For additional
> > commands, e-mail: [hidden email]
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

Re: ant task mail fails on jdk10

Stefan Bodewig
In reply to this post by Jan Matèrne (jhm)
On 2018-07-03, Jan Matèrne (jhm) wrote:

> We already have something:
> mail: "This task may depend on external libraries that are not included in
> the Ant distribution. See Library Dependencies for more information."
> dependencies:
> "mail.jar Mail task with Mime encoding, and the MimeMail task
> http://www.oracle.com/technetwork/java/index-138643.html
>  activation.jar Mail task with Mime encoding, and the MimeMail task
> http://www.oracle.com/technetwork/java/javase/jaf-135115.html"

Well at least we should update the links :-)

Given javax.activation has been part of the core lib for a few releases
(IIRC it was added in Java6 and now gets removed again) people will not
have installed it and now are caught by surprise. Therefore I suggest to
create a FAQ entry for it and add an additional hint to the mail task
manual.

> So what changed with Java10?

The blurb about activation.jar being an external library has become true
again. It is false when using Java6 to 9.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]