Java:Apache James 内存邮件服务器无法启动?

问题描述 投票:0回答:0

我试图在 Java 应用程序中嵌入 Apache James 的内存实例,但遇到错误。

我在这里遵循这个例子:

GitHub 示例项目

Apache James 网站

我收到的错误是:

Failed to start application (with profile [dev]): org.apache.commons.configuration2.ex.ConfigurationException: You need to configure a Processor with name error

这是我的代码:

private static final Module PROTOCOLS = Modules.combine(
        new IMAPServerModule(),
        new ProtocolHandlerModule(),
        new MailRepositoryTaskSerializationModule(),
        new SMTPServerModule());

private static final Module CUSTOM_SERVER_MODULE = Modules.combine(
        new MailetProcessingModule(),
        new MailboxModule(),
        new MemoryDataModule(),
        new MemoryEventStoreModule(),
        new MemoryUsersRepositoryModule(),
        new MemoryMailboxModule(),
        new MemoryQuotaModule(),
        new MemoryMailQueueModule(),
        new TaskManagerModule(),
        new RawPostDequeueDecoratorModule(),
        binder -> binder.bind(MailetContainerModule.DefaultProcessorsConfigurationSupplier.class)
                .toInstance(BaseHierarchicalConfiguration::new));

private static final Module CUSTOM_SERVER_AGGREGATE_MODULE = Modules.combine(
        CUSTOM_SERVER_MODULE,
        PROTOCOLS);

private final GuiceJamesServer inMemMailServer;

public MailServerImpl() {
    Configuration config = Configuration.builder()
            .workingDirectory(myConfigDir)
            .configurationPath(new Configuration.ConfigurationPath(myConfigDir))
            .build();

    this.inMemMailServer = GuiceJamesServer
            .forConfiguration(config)
            .combineWith(CUSTOM_SERVER_AGGREGATE_MODULE);
}
java guice java-17 james apache-james
最新问题
© www.soinside.com 2019 - 2025. All rights reserved.