<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">

<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>

                                <td>

                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="http://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">Community</a></h1>
                                                                </td>

                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px;  -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
    AttachmentTest failure
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="http://community.jboss.org/people/rebody">Huisheng Xu</a> in <i>jBPM Development</i> - <a href="http://community.jboss.org/message/538887#538887">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p>Hi Alejandro,</p><p>&#160; I had updated current trunk.&#160; The org.jbpm.test.activity.mail.AttachmentTest failed.&#160; The test case reported as below:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code jive-java">### EXCEPTION ###########################################
13:20:12,799 INF | [DefaultCommandService] exception <font color="navy"><b>while</b></font> executing command org.jbpm.pvm.internal.cmd.StartProcessInstanceInLatestCmd@1613b53
org.jbpm.api.JbpmException: could not send email: javax.mail.internet.MimeMessage@1aa0a15
&#160;&#160;&#160; at org.jbpm.pvm.internal.email.impl.MailSessionImpl.send(MailSessionImpl.java:60)
&#160;&#160;&#160; at org.jbpm.jpdl.internal.activity.MailActivity.perform(MailActivity.java:46)
&#160;&#160;&#160; at org.jbpm.jpdl.internal.activity.JpdlAutomaticActivity.execute(JpdlAutomaticActivity.java:15)
&#160;&#160;&#160; at org.jbpm.pvm.internal.model.op.ExecuteActivity.perform(ExecuteActivity.java:60)
&#160;&#160;&#160; at org.jbpm.pvm.internal.model.ExecutionImpl.performAtomicOperationSync(ExecutionImpl.java:657)
&#160;&#160;&#160; at org.jbpm.pvm.internal.model.ExecutionImpl.performAtomicOperation(ExecutionImpl.java:617)
&#160;&#160;&#160; at org.jbpm.pvm.internal.model.ExecutionImpl.start(ExecutionImpl.java:218)
&#160;&#160;&#160; at org.jbpm.pvm.internal.cmd.StartProcessInstanceInLatestCmd.execute(StartProcessInstanceInLatestCmd.java:65)
&#160;&#160;&#160; at org.jbpm.pvm.internal.cmd.StartProcessInstanceInLatestCmd.execute(StartProcessInstanceInLatestCmd.java:38)
&#160;&#160;&#160; at org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42)
&#160;&#160;&#160; at org.jbpm.pvm.internal.tx.StandardTransactionInterceptor.execute(StandardTransactionInterceptor.java:54)
&#160;&#160;&#160; at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.executeInNewEnvironment(EnvironmentInterceptor.java:53)
&#160;&#160;&#160; at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:40)
&#160;&#160;&#160; at org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:55)
&#160;&#160;&#160; at org.jbpm.pvm.internal.svc.SkipInterceptor.execute(SkipInterceptor.java:43)
&#160;&#160;&#160; at org.jbpm.pvm.internal.svc.ExecutionServiceImpl.startProcessInstanceByKey(ExecutionServiceImpl.java:70)
&#160;&#160;&#160; at org.jbpm.test.activity.mail.AttachmentTest.testVariableAttachment(AttachmentTest.java:84)
&#160;&#160;&#160; at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
&#160;&#160;&#160; at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
&#160;&#160;&#160; at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
&#160;&#160;&#160; at java.lang.reflect.Method.invoke(Method.java:585)
&#160;&#160;&#160; at junit.framework.TestCase.runTest(TestCase.java:164)
&#160;&#160;&#160; at org.jbpm.test.BaseJbpmTestCase.runTest(BaseJbpmTestCase.java:87)
&#160;&#160;&#160; at junit.framework.TestCase.runBare(TestCase.java:130)
&#160;&#160;&#160; at junit.framework.TestResult$1.protect(TestResult.java:106)
&#160;&#160;&#160; at junit.framework.TestResult.runProtected(TestResult.java:124)
&#160;&#160;&#160; at junit.framework.TestResult.run(TestResult.java:109)
&#160;&#160;&#160; at junit.framework.TestCase.run(TestCase.java:120)
&#160;&#160;&#160; at junit.framework.TestSuite.runTest(TestSuite.java:230)
&#160;&#160;&#160; at junit.framework.TestSuite.run(TestSuite.java:225)
&#160;&#160;&#160; at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
&#160;&#160;&#160; at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
&#160;&#160;&#160; at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
&#160;&#160;&#160; at java.lang.reflect.Method.invoke(Method.java:585)
&#160;&#160;&#160; at org.apache.maven.surefire.junit.JUnitTestSet.execute(JUnitTestSet.java:213)
&#160;&#160;&#160; at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
&#160;&#160;&#160; at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
&#160;&#160;&#160; at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
&#160;&#160;&#160; at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
&#160;&#160;&#160; at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
&#160;&#160;&#160; at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
&#160;&#160;&#160; at java.lang.reflect.Method.invoke(Method.java:585)
&#160;&#160;&#160; at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)
&#160;&#160;&#160; at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)
Caused by: javax.mail.MessagingException: IOException <font color="navy"><b>while</b></font> sending message;
&#160; nested exception is:
&#160;&#160;&#160; javax.activation.UnsupportedDataTypeException: no object DCH <font color="navy"><b>for</b></font> MIME type image/gif
&#160;&#160;&#160; at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:676)
&#160;&#160;&#160; at org.jbpm.pvm.internal.email.impl.MailSessionImpl.send(MailSessionImpl.java:51)
&#160;&#160;&#160; ... 43 more
Caused by: javax.activation.UnsupportedDataTypeException: no object DCH <font color="navy"><b>for</b></font> MIME type image/gif
&#160;&#160;&#160; at javax.activation.ObjectDataContentHandler.writeTo(DataHandler.java:896)
&#160;&#160;&#160; at javax.activation.DataHandler.writeTo(DataHandler.java:317)
&#160;&#160;&#160; at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1403)
&#160;&#160;&#160; at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:874)
&#160;&#160;&#160; at javax.mail.internet.MimeMultipart.writeTo(MimeMultipart.java:444)
&#160;&#160;&#160; at com.sun.mail.handlers.multipart_mixed.writeTo(multipart_mixed.java:102)
&#160;&#160;&#160; at javax.activation.ObjectDataContentHandler.writeTo(DataHandler.java:894)
&#160;&#160;&#160; at javax.activation.DataHandler.writeTo(DataHandler.java:317)
&#160;&#160;&#160; at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1403)
&#160;&#160;&#160; at javax.mail.internet.MimeMessage.writeTo(MimeMessage.java:1745)
&#160;&#160;&#160; at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:636)
&#160;&#160;&#160; ... 44 more
</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160; The activation cannot find DataContentHandler(DCH) for Mime-Type image/gif.&#160; jBPM 4 are using activition-1.1.jar to provider javamail attach.&#160; When I change it to activation-1.1.1.jar,&#160; the attachmenttest could pass successfully.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160; I digg deeper and find out that activition-1.1.1.jar decide the dataContent's type, when the class of data content is byte[],&#160; it will write it to the content directly.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160; I saw there is a mailcap file in the mail-1.4.1.jar at META/mailcap.&#160; Here is the content.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code jive-java">#
# @(#)mailcap&#160;&#160;&#160; 1.8 05/04/20
#
# Default mailcap file <font color="navy"><b>for</b></font> the JavaMail System.
#
# JavaMail content-handlers:
#
text/plain;;&#160;&#160;&#160;&#160;&#160;&#160;&#160; x-java-content-handler=com.sun.mail.handlers.text_plain
text/html;;&#160;&#160;&#160;&#160;&#160;&#160;&#160; x-java-content-handler=com.sun.mail.handlers.text_html
text/xml;;&#160;&#160;&#160;&#160;&#160;&#160;&#160; x-java-content-handler=com.sun.mail.handlers.text_xml
multipart<font color="darkgreen">/*;;&#160;&#160;&#160;&#160;&#160;&#160;&#160; x-java-content-handler=com.sun.mail.handlers.multipart_mixed; x-java-fallback-entry=true
message/rfc822;;&#160;&#160;&#160; x-java-content-handler=com.sun.mail.handlers.message_rfc822
#
# can't support image types because java.awt.Toolkit doesn't work on servers
#
#image/gif;;&#160;&#160;&#160;&#160;&#160;&#160;&#160; x-java-content-handler=com.sun.mail.handlers.image_gif
#image/jpeg;;&#160;&#160;&#160;&#160;&#160;&#160;&#160; x-java-content-handler=com.sun.mail.handlers.image_jpeg
</font></code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160; As we can see, the image/gif and image/jpeg parts have been commented, so they won't be effect.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160; At the last, how could we solve this exception?&#160; Could we update activation-1.1.jar to activation-1.1.1.jar?&#160; Or we should do some other things to prevent the exception?</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160; Any reply will be appreciate.&#160; Thank you.</p></div>

<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
    <p style="margin: 0;">Reply to this message by <a href="http://community.jboss.org/message/538887#538887">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in jBPM Development at <a href="http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2035">Community</a></p>
</div></td>
                        </tr>
                    </tbody>
                </table>


                </td>
            </tr>
        </tbody>
    </table>

</div>

</body>
</html>