Sending the email to the following server failed : localhost:25 org.apache.commons.mail.EmailException: Sending the email to the following server failed : localhost:25
at org.apache.commons.mail.Email.sendMimeMessage(Email.java:1138)
at org.apache.commons.mail.Email.send(Email.java:1163)
at org.sakaiproject.kernel.email.outgoing.OutgoingEmailMessageListener.onMessage(OutgoingEmailMessageListener.java:158)
at org.apache.activemq.ActiveMQMessageConsumer.dispatch(ActiveMQMessageConsumer.java:1021)
at org.apache.activemq.ActiveMQSessionExecutor.dispatch(ActiveMQSessionExecutor.java:122)
at org.apache.activemq.ActiveMQSessionExecutor.iterate(ActiveMQSessionExecutor.java:192)
at org.apache.activemq.thread.PooledTaskRunner.runTask(PooledTaskRunner.java:122)
at org.apache.activemq.thread.PooledTaskRunner$1.run(PooledTaskRunner.java:43)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
Caused by: javax.mail.MessagingException: IOException while sending message;
nested exception is:
javax.activation.UnsupportedDataTypeException: no object DCH for MIME type text/plain
at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:625)
at javax.mail.Transport.send0(Transport.java:169)
at javax.mail.Transport.send(Transport.java:98)
at org.apache.commons.mail.Email.sendMimeMessage(Email.java:1128)
... 10 more
Caused by: javax.activation.UnsupportedDataTypeException: no object DCH for MIME type text/plain
at javax.activation.ObjectDataContentHandler.writeTo(DataHandler.java:885)
at javax.activation.DataHandler.writeTo(DataHandler.java:316)
at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1350)
at javax.mail.internet.MimeMessage.writeTo(MimeMessage.java:1683)
at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:585)
... 13 more
>
> This matches other things I've found [1]. I've found the code that
> does the loading of mailcap files and it's definitely a classloader
> issue.
>
> We /could/ embed activation.jar in the mail bundle but a few other
> bundles use the activation bundle. I think it's best to leave this
> bundle separate and get the class/resource sharing fixed.
>
> [1] http://forums.sun.com/thread.jspa?threadID=5353050
WT* is Eclipse-BuddyPolicy?
That sounds like a Equinox only hack..... yuck!
I hope there is a generic alternative. I wouldnt want to have to put a
hack in for each OSGi container.
I notice that the activation in this instance is a Spring DM modified
bundle as well.
"
However, editing the manifest.mf file of the activation bundle and
providing a "Eclipse-BuddyPolicy: registered" line as well as a
"Eclipse-RegisterBuddy: com.springsource.javax.activation" to the mail
bundle solved the problem.
"
I'll try making optional the sun.security.* bits and report back. This type of binding does worry me that javax.mail won't work on other JVM's which seems like a really bad move on Sun's part.