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>
    

    在这里插入图片描述

  • 相关阅读:
    C# 系统应用之通过注册表获取USB使用记录(一)
    web项目测试方法总结
    C#面向对象编程实例-猜拳游戏
    c#基础这些你都看过吗?(一)-----仅供初学者使用
    .NET事件监听机制的局限与扩展
    SQL代码
    泛型接口委托
    存储过程
    小操作
    DataGridView
  • 原文地址:https://www.cnblogs.com/paper-man/p/13284582.html
Copyright © 2011-2022 走看看