Skip to content

Mail library included in jetty-jre11 is not compatible with JDK11 #10

Open
@joakime

Description

@joakime

Issue by geoffreyharding
Friday Jul 19, 2019 at 14:28 GMT
Originally opened as appropriate/docker-jetty#108


There is a bug in the jetty:9.4-jre11 docker image.

The following runtime error is thrown when using javax.mail.internet.MimeMessage:

java.lang.NoClassDefFoundError: javax/activation/DataSource

javax.activation was removed from the JDK in Java 11. Adding javax.activation to the WAR file doesn't fix the runtime bug. The reason is that Jetty is bundled with its own mail, which overrides the one in the WAR.

The solution is to delete the mail from the Jetty dockerfile:

USER root
RUN rm -r /usr/local/jetty/lib/mail
USER jetty

This blog post describes the problem in more detail:
https://www.databasesandlife.com/activation-error-jetty-javamail-java11/

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions