You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by Andreas Göggerle <an...@pansoft.de> on 2003/09/25 18:06:57 UTC
Problem with MIME type message/delivery-status
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: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org
RE: Problem with MIME type message/delivery-status
Posted by "Noel J. Bergman" <no...@devtech.com>.
> in <JAVA_HOME>/jre/lib there is (or there should be) the file mailcap; you
> have to edit it to add the mapping between "message/delivery-status" and a
> handler.
> It should look like:
> message/delivery-status;; x-java-content-handler=my.package.MyClass
I believe that there is also a programmatic way to register a DCH, although
I would have to go back and search.
--- Noel
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org
R: Problem with MIME type message/delivery-status
Posted by Marcello Marangio <m....@tno.it>.
Hi Andreas
in <JAVA_HOME>/jre/lib there is (or there should be) the file mailcap; you
have to edit it to add the mapping between "message/delivery-status" and a
handler.
It should look like:
message/delivery-status;; x-java-content-handler=my.package.MyClass
Cheers
Marcello
> -----Messaggio originale-----
> Da: Andreas Göggerle [mailto:andreas.goeggerle@pansoft.de]
> Inviato: giovedì 25 settembre 2003 18.07
> A: 'James Developers List'
> Cc: werling@pansoft.de
> Oggetto: Problem with MIME type message/delivery-status
>
>
> 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:
>
> [cut]
>
> 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: server-dev-unsubscribe@james.apache.org
> For additional commands, e-mail: server-dev-help@james.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org