zoukankan      html  css  js  c++  java
  • simplejavamail : Batch module not found, make sure it is on the classpath

    org.simplejavamail.internal.modules.ModuleLoaderException: Batch module not found, make sure it is on the classpath (https://github.com/bbottema/simple-java-mail/tree/develop/modules/batch-module)

    今天使用simplejavamail发送邮件报错,只是把同步改为异步发送,然后就从代码入手看:

    public final AsyncResponse sendMail(Email email, boolean async) {
            if (this.validate(email)) {
                SendMailClosure sendMailClosure = new SendMailClosure(this.operationalConfig, this.session, email, this.proxyServer, async, this.operationalConfig.isTransportModeLoggingOnly(), this.smtpConnectionCounter);
                if (!async) {
                    sendMailClosure.run();
                    return null;
                } else {
                // 如果是异步,这里去加载批处理模块了,但是我本地没有引入批处理模块代码
                    return ModuleLoader.loadBatchModule().executeAsync(this.operationalConfig.getExecutorService(), "sendMail process", sendMailClosure);
                }
            } else {
                throw new AssertionError("Email not valid, but no MailException was thrown for it");
            }
        }
    

    加入需要包

    <dependency>
        <groupId>org.simplejavamail</groupId>
        <artifactId>simple-java-mail</artifactId>
        <version>6.0.3</version>
    </dependency>
    
    <dependency>
        <groupId>org.simplejavamail</groupId>
        <artifactId>batch-module</artifactId>
        <version>6.0.3</version>
    </dependency>
    

    在这里插入图片描述

  • 相关阅读:
    Oracle的连接时ORA-12519错误
    MongoDB(4.4)使用
    MongoDB安装
    SpringBoot_加密配置中的敏感信息
    SpringBoot_配置文件详解
    Nginx入门
    SpringBoot+Redis集成简单测试
    Redis安装
    RabbitMQ消息中间件(第四章)第四部分-SpringBoot整合RabbitMQ
    Mysql try restarting transaction怎么解决,排查事务锁表
  • 原文地址:https://www.cnblogs.com/paper-man/p/13284582.html
Copyright © 2011-2022 走看看