I have been researching this error for a couple of days. No response on the Liferay forum (yet) and even though I have tried several different approaches, I can't figure out the true cause of the error. If I can find the cause I could probably fix it. The error is:
Caused by: java.lang.VerifyError: Bad type on operand stack_Exception Details:_
Location:_
org/bsfinternational/api/core/service/impl/EmailLocalServiceImpl.sendEmail(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V @930: invokevirtual_
Reason:_ Type 'com/sun/mail/smtp/SMTPMessage' (current frame, stack[1]) is not assignable to 'javax/mail/Message'_
Current Frame:_ bci: @930_ flags: { }_ locals: { 'org/bsfinternational/api/core/service/impl/EmailLocalServiceImpl', 'java/lang/String', 'java/lang/String', 'java/lang/String', 'java/lang/String', 'java/lang/String', 'java/lang/String', 'java/lang/String', integer, 'javax/mail/Session', 'org/apache/commons/validator/routines/EmailValidator', 'de/agitos/dkim/DKIMSigner', 'java/lang/String', 'java/lang/String', 'java/lang/String', 'com/sun/mail/smtp/SMTPMessage', integer, 'java/lang/String', 'org/bsfinternational/api/core/model/Email', '[Ljavax/mail/internet/InternetAddress;', 'java/lang/String', '[Ljava/lang/String;', 'java/util/List', '[Ljavax/mail/internet/InternetAddress;', 'java/lang/String', 'java/lang/String', 'java/lang/String', 'java/lang/String', integer, 'javax/mail/Transport' }_ stack: { 'javax/mail/Transport', 'com/sun/mail/smtp/SMTPMessage', '[Ljavax/mail/Address;' }_
So, I get that there is an issue with SMTPMessage not being assignable to Message but I don't know why. The research I have done seems to point to JVM differences but everything have been compiled in the same environment, as far as I know.
The actual code snippet is:
// construct the JavaMail message using the DKIM message type from DKIM for JavaMail
SMTPMessage msg = new SMTPDKIMMessage(session, dkimSigner);
If I try assigning SMTPDKIMMessage to the same type in the code like so:
// construct the JavaMail message using the DKIM message type from DKIM for JavaMail
SMTPDKIMMessage msg = new SMTPDKIMMessage(session, dkimSigner);
Then the compliant is that SMTPDKIMMessage isn't assignable to Message. If I change it to Message, then it complains that SMTPDKIMMessage isn't assignable. Seems like a circle.
So, the first question here is: What is the true cause? What should I look for that is generating the error? I have compiled the DKIMforJavaMail.jar using the same IDE and compiling environment. But someone is unhappy with these assignments. What is it?