jetty / jetty/jetty.docker

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

Open
#10 45 comments 1 reaction 0 assignees View on GitHub
Stale
Dominant language
Shell
Stars
23
Forks
17
Avg merge
8d 22h
Merged PRs (30d)
3

Description

**Issue by [geoffreyharding](https://github.com/geoffreyharding)**
_Friday Jul 19, 2019 at 14:28 GMT_
_Originally opened as https://github.com/appropriate/docker-jetty/issues/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/

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.