<!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>  I had updated current trunk.  The org.jbpm.test.activity.mail.AttachmentTest failed.  The test case reported as below:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </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
    at org.jbpm.pvm.internal.email.impl.MailSessionImpl.send(MailSessionImpl.java:60)
    at org.jbpm.jpdl.internal.activity.MailActivity.perform(MailActivity.java:46)
    at org.jbpm.jpdl.internal.activity.JpdlAutomaticActivity.execute(JpdlAutomaticActivity.java:15)
    at org.jbpm.pvm.internal.model.op.ExecuteActivity.perform(ExecuteActivity.java:60)
    at org.jbpm.pvm.internal.model.ExecutionImpl.performAtomicOperationSync(ExecutionImpl.java:657)
    at org.jbpm.pvm.internal.model.ExecutionImpl.performAtomicOperation(ExecutionImpl.java:617)
    at org.jbpm.pvm.internal.model.ExecutionImpl.start(ExecutionImpl.java:218)
    at org.jbpm.pvm.internal.cmd.StartProcessInstanceInLatestCmd.execute(StartProcessInstanceInLatestCmd.java:65)
    at org.jbpm.pvm.internal.cmd.StartProcessInstanceInLatestCmd.execute(StartProcessInstanceInLatestCmd.java:38)
    at org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42)
    at org.jbpm.pvm.internal.tx.StandardTransactionInterceptor.execute(StandardTransactionInterceptor.java:54)
    at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.executeInNewEnvironment(EnvironmentInterceptor.java:53)
    at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:40)
    at org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:55)
    at org.jbpm.pvm.internal.svc.SkipInterceptor.execute(SkipInterceptor.java:43)
    at org.jbpm.pvm.internal.svc.ExecutionServiceImpl.startProcessInstanceByKey(ExecutionServiceImpl.java:70)
    at org.jbpm.test.activity.mail.AttachmentTest.testVariableAttachment(AttachmentTest.java:84)
    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:585)
    at junit.framework.TestCase.runTest(TestCase.java:164)
    at org.jbpm.test.BaseJbpmTestCase.runTest(BaseJbpmTestCase.java:87)
    at junit.framework.TestCase.runBare(TestCase.java:130)
    at junit.framework.TestResult$1.protect(TestResult.java:106)
    at junit.framework.TestResult.runProtected(TestResult.java:124)
    at junit.framework.TestResult.run(TestResult.java:109)
    at junit.framework.TestCase.run(TestCase.java:120)
    at junit.framework.TestSuite.runTest(TestSuite.java:230)
    at junit.framework.TestSuite.run(TestSuite.java:225)
    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:585)
    at org.apache.maven.surefire.junit.JUnitTestSet.execute(JUnitTestSet.java:213)
    at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
    at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
    at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
    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:585)
    at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)
    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;
  nested exception is:
    javax.activation.UnsupportedDataTypeException: no object DCH <font color="navy"><b>for</b></font> MIME type image/gif
    at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:676)
    at org.jbpm.pvm.internal.email.impl.MailSessionImpl.send(MailSessionImpl.java:51)
    ... 43 more
Caused by: javax.activation.UnsupportedDataTypeException: no object DCH <font color="navy"><b>for</b></font> MIME type image/gif
    at javax.activation.ObjectDataContentHandler.writeTo(DataHandler.java:896)
    at javax.activation.DataHandler.writeTo(DataHandler.java:317)
    at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1403)
    at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:874)
    at javax.mail.internet.MimeMultipart.writeTo(MimeMultipart.java:444)
    at com.sun.mail.handlers.multipart_mixed.writeTo(multipart_mixed.java:102)
    at javax.activation.ObjectDataContentHandler.writeTo(DataHandler.java:894)
    at javax.activation.DataHandler.writeTo(DataHandler.java:317)
    at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1403)
    at javax.mail.internet.MimeMessage.writeTo(MimeMessage.java:1745)
    at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:636)
    ... 44 more
</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>  The activation cannot find DataContentHandler(DCH) for Mime-Type image/gif.  jBPM 4 are using activition-1.1.jar to provider javamail attach.  When I change it to activation-1.1.1.jar,  the attachmenttest could pass successfully.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>  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[],  it will write it to the content directly.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>  I saw there is a mailcap file in the mail-1.4.1.jar at META/mailcap.  Here is the content.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><pre class="jive-pre"><code class="jive-code jive-java">#
# @(#)mailcap    1.8 05/04/20
#
# Default mailcap file <font color="navy"><b>for</b></font> the JavaMail System.
#
# JavaMail content-handlers:
#
text/plain;;        x-java-content-handler=com.sun.mail.handlers.text_plain
text/html;;        x-java-content-handler=com.sun.mail.handlers.text_html
text/xml;;        x-java-content-handler=com.sun.mail.handlers.text_xml
multipart<font color="darkgreen">/*;;        x-java-content-handler=com.sun.mail.handlers.multipart_mixed; x-java-fallback-entry=true
message/rfc822;;    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;;        x-java-content-handler=com.sun.mail.handlers.image_gif
#image/jpeg;;        x-java-content-handler=com.sun.mail.handlers.image_jpeg
</font></code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>  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;"> </p><p>  At the last, how could we solve this exception?  Could we update activation-1.1.jar to activation-1.1.1.jar?  Or we should do some other things to prevent the exception?</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>  Any reply will be appreciate.  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>