使用SimpleJavaMail时出现的问题:does not match stack map?

之前一直用javax.mail发送Email,但总感觉不太方便,直到发现SimpleJavaMail,是时候放弃自己封装的丑陋的EmailUtil了。

在本地环境(Win10+JDK8)和生产环境(CentOS7+JDK8)都一切正常。

但在部署到阿里的ECS(CentOS8+JDK8)之后,就发现无法发送邮件,错误如下:

java.lang.RuntimeException: java.lang.VerifyError: Instruction type does not match stack map

Exception Details:

Location:

org/simplejavamail/converter/internal/mimemessage/MimeMessageProducer.populateMimeMessage(Lorg/simplejavamail/api/email/Email;Ljakarta/mail/Session;Lorg/simplejavamail/api/mailer/config/Pkcs12Config;)Ljakarta/mail/internet/MimeMessage; @157: aload

Reason:

Type 'org/simplejavamail/converter/internal/mimemessage/ImmutableDelegatingSMTPMessage' (current frame, locals[4]) is not assignable to 'jakarta/mail/internet/MimeMessage' (stack map, locals[4])

Current Frame:

bci: @157

flags: { }

locals: { 'org/simplejavamail/converter/internal/mimemessage/MimeMessageProducer', 'org/simplejavamail/api/email/Email', 'jakarta/mail/Session', 'org/simplejavamail/api/mailer/config/Pkcs12Config', 'org/simplejavamail/converter/internal/mimemessage/ImmutableDelegatingSMTPMessage' }

stack: { }

Stackmap Frame:

bci: @157

flags: { }

locals: { 'org/simplejavamail/converter/internal/mimemessage/MimeMessageProducer', 'org/simplejavamail/api/email/Email', 'jakarta/mail/Session', 'org/simplejavamail/api/mailer/config/Pkcs12Config', 'jakarta/mail/internet/MimeMessage' }

stack: { }

Bytecode:

0x0000000: 2b12 02b8 0003 572c 1204 b800 0357 bb00

0x0000010: 0559 2a2c 2bb7 0006 3a04 2b19 04b8 0007

0x0000020: 2b19 04b8 0008 2b19 04b8 0009 2b19 04b8

0x0000030: 000a 2a19 042b b600 0b2b 1904 b800 0c19

0x0000040: 042b b600 0db8 000e bb00 0f59 b700 10b6

0x0000050: 0011 c000 0fb6 0012 b800 1399 0012 b800

0x0000060: 142c 1904 2b2d b900 1505 003a 042b b600

0x0000070: 16b8 0017 9a00 10b8 0018 1904 2bb9 0019

0x0000080: 0300 3a04 2bb6 001a c600 15bb 001b 5919

0x0000090: 042b b600 1ab6 001c b700 1d3a 0419 04b0

0x00000a0:

Stackmap Table:

append_frame(@109,Object[#63])

same_frame(@132)

same_frame(@157)

我的代码:

String server = "smtp.exmail.qq.com";

Integer port = 587;

String userName = "....@qq.com";

String passWord = "....";

Mailer mailer = MailerBuilder

.withSMTPServer(server, port, userName, passWord)

.withTransportStrategy(TransportStrategy.SMTP_TLS)

.clearEmailValidator()

.buildMailer();

String from = "....@qq.com";

String to = "obj@xxx.com";

String subject = "标题";

String content = "内容";

Email mail = EmailBuilder.startingBlank()

.from("mycomp", from)

.to(to)

.withSubject(subject)

.withPlainText(content)

.withContentTransferEncoding(ContentTransferEncoding.BASE_64)

.buildEmail();

mailer.sendMail(mail);

头一次遇到这种问题,不知道如何下手解决了。

以上是 使用SimpleJavaMail时出现的问题:does not match stack map? 的全部内容, 来源链接: utcz.com/p/944703.html

回到顶部