Hi everyone,

while writing a DSNBounce mailet that produces RFC3464 conform
Delivery Status Notifications I encountered a problem with the
MIME type "message/delivery-status".
When I try to send a multipart mail with a bodypart having this
MIME type, I get the follwing runtime exception:

javax.activation.UnsupportedDataTypeException: no object DCH for MIME type
message/delivery-status
        at javax.activation.ObjectDataContentHandler.writeTo(DataHandler.java:841)
        at javax.activation.DataHandler.writeTo(DataHandler.java:295)
        at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1089)
        at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:635)
        at javax.mail.internet.MimeMultipart.writeTo(MimeMultipart.java:233)
        at com.sun.mail.handlers.multipart_mixed.writeTo(multipart_mixed.java:68)
        at javax.activation.ObjectDataContentHandler.writeTo(DataHandler.java:839)
        at javax.activation.DataHandler.writeTo(DataHandler.java:295)
        at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1089)
        at javax.mail.internet.MimeMessage.writeTo(MimeMessage.java:1527)
        at javax.mail.internet.MimeMessage.writeTo(MimeMessage.java:1503)
        at org.apache.james.core.MailImpl.writeMessageTo(MailImpl.java:444)
        at
org.apache.james.mailrepository.AvalonMailRepository.store(AvalonMailReposit
ory.java:329)
        at org.apache.james.James.sendMail(James.java:492)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at
org.apache.avalon.phoenix.components.application.BlockInvocationHandler.invo
ke(BlockInvocationHandler.java:92)
        at $Proxy9.sendMail(Unknown Source)
        at org.apache.james.transport.mailets.DSNBounce.service(DSNBounce.java:241)
        at
org.apache.james.transport.LinearProcessor.service(LinearProcessor.java:440)
        at
org.apache.james.transport.JamesSpoolManager.process(JamesSpoolManager.java:
396)
        at
org.apache.james.transport.JamesSpoolManager.run(JamesSpoolManager.java:332)
        at
org.apache.excalibur.thread.impl.ExecutableRunnable.execute(ExecutableRunnab
le.java:90)
        at org.apache.excalibur.thread.impl.WorkerThread.run(WorkerThread.java:136)
exception! javax.mail.MessagingException: Exception spooling message:
Exception caught while storing Message Container:
javax.activation.UnsupportedDataTypeException: no object DCH for MIME type
message/delivery-status;
  nested exception is:
        java.lang.RuntimeException: Exception caught while storing Message
Container: javax.activation.UnsupportedDataTypeException: no object DCH for
MIME type message/delivery-status

This is how I set the MIME type:

MimeBodyPart dsn = new MimeBodyPart();
MimeMessage dsnMessage = new
MimeMessage(Session.getDefaultInstance(System.getProperties(), null));
StringWriter sout = new StringWriter();
[...]
dsnMessage.setText(sout.toString());
dsnMessage.saveChanges();
dsn.setContent(dsnMessage, "message/delivery-status");

I'm using sun's mail.jar version 1.3.1 and activation.jar version 1.0.2
I'm running james-3.0a1 from CVS HEAD on a Win2000 OS


How can I solve this problem? Seems I have to somehow "register"
a DataContentHandler for the MIME type, but I have no idea how/where
to do so. Any help would be appreciated.

Thanks in advance
   Andreas


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to