-
Notifications
You must be signed in to change notification settings - Fork 46
Mail library included in jetty-jre11 is not compatible with JDK11 #108
Comments
@janbartel what did we do to fix this? |
@gregw in jetty-9.4 we have the mail.mod module, which puts javax.mail.glassfish-1.4.1.v201005082020.jar onto the container classpath. That jar contains both the javax.mail apis and the impl. This is tested and working in jdk-11 and beyond. For jetty-10.0 we have removed the mail.mod module altogether. If users wish to use a javax.mail service the they need to provide their own jar/s, preferably by making their own mail mod file. See also jetty issue jetty/jetty.project#2960. |
Any chances of having some Jetty 10 preview images? I really don't have a workaround without a baseline Docker image that supports Java 11 and doesn't break email. |
Workaround for now:
|
@brunojcm we should be doing an jetty-10-alpha1 release next week, so I'll try to get a docker image going as well.... feel free to hassle me if I forget! |
@gregw, thanks for the update! Let me know if you need some help testing. |
@janbartel Hi. You seem to be saying that Jetty 9.4 fixes the problem on JDK11+. However on the XWiki project we're using the Jetty docker image
Note that we bundle So, is Jetty 9.4 supposed to fix the problem? If so I wonder why it's not working for us. Any idea? Thanks! |
Found a solution thanks to a message from @janbartel :) I've put the following in our
And it worked :) |
@vmassol that's old school syntax (and deprecated) Use ... <Configure class="org.eclipse.jetty.webapp.WebAppContext">
<Get name="systemClasspathPattern">
<Call name="add"><Arg>-javax.mail.</Arg></Call>
</Get>
<Get name="serverClasspathPattern">
<Call name="add"><Arg>javax.mail.</Arg></Call>
</Get> |
@joakime Thanks a lot! I was too happy to have found a working workaround that I didn't notice it ;) |
This issue has been moved to the new Official Eclipse Jetty Docker repository. |
There is a bug in the jetty:9.4-jre11 docker image.
The following runtime error is thrown when using javax.mail.internet.MimeMessage:
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:
This blog post describes the problem in more detail:
https://www.databasesandlife.com/activation-error-jetty-javamail-java11/
The text was updated successfully, but these errors were encountered: