[keycloak-user] Custom SPI (emailSender) working under Windows, not working in docker image

Lukasz Lech l.lech at ringler.ch
Tue Oct 9 10:21:25 EDT 2018


Hello,

I've created my own version of emailService, deployed it via copying into standalone/deployments and added section in standalone.xml:

            <spi name="emailSender">
                <default-provider>multipart</default-provider>
            </spi>

Under both Windows and docker I get the warning that I'm implementing internal API, and confirmation that module was deployed.

Under Windows: in server-info I see now only my implementation of emailSender, sending emails goes through my sender.

In Docker image, I see BOTH default provider (default) and my own (emailSender), and sending email causes NullPointerException when FreeMarker tries to use the sender:

    protected void send(Map<String, String> config, String subject, String textBody, String htmlBody) throws EmailException {
        EmailSenderProvider emailSender = session.getProvider(EmailSenderProvider.class);
        emailSender.send(config, user, subject, textBody, htmlBody);
    }

In both cases, I'm using keycloak 4.5.0.Final and JDK 8. I don't see any other errors or warnings in log.

What could have gone wrong in docker image? Why keycloak behaves otherwise in both cases, and why switching SPI implementation didn't worked in dockerized version?


Best regards,
Lukasz Lech



More information about the keycloak-user mailing list