[ https://issues.apache.org/jira/browse/GERONIMO-6471?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13675527#comment-13675527 ]
Ivan commented on GERONIMO-6471: -------------------------------- Commit the changes to trunk at rev. 1489683 > IllegalStateException : Cause already initialized is thrown while mail > provider failed to connect or sent the messages > ---------------------------------------------------------------------------------------------------------------------- > > Key: GERONIMO-6471 > URL: https://issues.apache.org/jira/browse/GERONIMO-6471 > Project: Geronimo > Issue Type: Bug > Security Level: public(Regular issues) > Components: mail > Affects Versions: 3.0.1 > Reporter: Ivan > Assignee: Ivan > Fix For: 3.0.2 > > > If the Geronimo mail failed to connect or send the messages, it would thrown > the exception below. The most issue here is that, MessagingException uses a > legacy chain throwable, and a next exception is maintained in the codes, > while our codes would call initCause to configure the root cause for the > first time, this may bring issue if the original MessagingException is > initialized with null root cause. > java.lang.IllegalStateException: Cause already initialized > at java.lang.Throwable.initCause(Throwable.java:275) > at > javax.mail.MessagingException.setNextException(MessagingException.java:51) > at javax.mail.Transport.send(Transport.java:109) > at javax.mail.Transport.send(Transport.java:48) > at > com.mybankersbank.gateway.email.GatewayEmailBean.sendEmail(GatewayEmailBean.java:297) > at sun.reflect.GeneratedMethodAccessor1221.invoke(Unknown Source) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:600) > at > org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:158) -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira