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

Dmitry Telegin dt at acutus.pro
Fri Oct 12 18:33:35 EDT 2018


Hi Lukasz,

In Docker, how do you supply a modified standalone.xml to Keycloak? Do you map the whole $KEYCLOAK/standalone/configuration as a volume?

For testing purposes, could you please "burn" standalone.xml into the image and let us know of the results?

Good luck,
Dmitry Telegin
CTO, Acutus s.r.o.
Keycloak Consulting and Training

Pod lipami street 339/52, 130 00 Prague 3, Czech Republic
+42 (022) 888-30-71
E-mail: info at acutus.pro

On Tue, 2018-10-09 at 14:21 +0000, Lukasz Lech wrote:
> 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
> 
> _______________________________________________
> keycloak-user mailing list
> keycloak-user at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/keycloak-user


More information about the keycloak-user mailing list