-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Runtime errors when updating to jakarta.mail-api 2.1.0 and Angus #37
Comments
Hi @adamretter , Test is passing to me for some reason:
Anyway, this issue you have could be related to: Unfortunately this fix is not in maven central yet. But you can verify it doing the next:
Then update your pom.xml jakarta.mail:jakarta.mail-api to version 2.1.1-SNAPSHOT and run the test. |
@jbescos Okay so just to confirm, I re-ran my original test on a new clean Ubuntu VM that I built, I still see the test failing. So as that is now two different machines failing the test I am certain it is failing. As you suggested I built and installed the 2.2.1-SNAPSHOT of |
I think I may have found something interesting... I noticed that I was only able to build When I run the greenmail tests against either So it seems to me that Jakarta Mail 2.1.0 is incompatible with Java 8, this surprises me as it is currently compiled to target Java 8. I also observe that the previous release version 2.0.1 is compiled with JDK 11 and produces output targeting Java 8, and yet that version works perfectly on Java 8 (and also with greenmail on Java 8). So I guess the question is: Do you intend that version 2.1.0 and newer only support Java 11+ at runtime?
|
So it works when you use JDK 11 in runtime. I was actually using JDK 11 when I run your test. There is an open PR where we move to JDK 11. After this is merged it should be solved, because it will not allow to use JDK8 in runtime. The error is coming from Jakarta Activation. Probably I will not investigate this if previous PR is merged because whatever the error is, it works when using JDK 11. Regarding the compilation questions, I don't know the full story but JDK 8 was to make it work with Android I think. And additionally it was compiled with JDK11 to make it work with modules. |
@jbescos Okay, so if I understand correctly -
If that is the case... can you please document somewhere that version 2.1.0 and newer require Java 11 (even though compiled for Java 8)? I think that would have saved myself, yourself, and likely others, quite some time. Kind regards. |
@adamretter you motivated me to investigate a bit further 😄 The real issue is Angus-Activation has its own definition of this class: https://github.com/eclipse-ee4j/angus-activation/blob/master/activation-registry/src/main/java/com/sun/activation/registries/MailcapFile.java As you can see it implements MailcapRegistry, so no issues here. I am not expert in Activation yet, but it seems this is something to investigate in Activation. I will open an issue there and possibly I will get into the details. Maybe the solution is just to use JDK11, we will see. |
I have the same ProblemI had the same problem. I tried to switch to angus-mail and get the same error message. Our project also uses Java 8, it would be a pity to end the support of Java 8. |
This issue should be solved with this PR: I verified it with the steps provided by @adamretter . You can try it too downloading my branch https://github.com/jbescos/angus-activation/tree/jafIssue103 , compiling it with
Regarding keeping mail to support JDK8, I will update my other PR #36 to still support it. |
loading jakarta.activation-api+angus-activation through endorsed on SE 8 should help. Can you try it, please (either use |
@jbescos Thank you :-) Silly question maybe... but any idea of when angus-activation and angus-mail might see a release version that addresses this (I am not in a rush - just curious). |
I would be interested in that too, I am updating our libs and I would like to use stable versions. Thanks for the effort |
use angus-activation 2.0.0 instead of 1.x |
I believe this is fixed with angus-activation 2.0.0 in master for angus-mail 2.0.0 |
Describe the bug
I am trying to update the dependencies of the Greenmail Java Test library to use jakarta.mail-api 2.1.0 and the Eclipse Angus implementation. My attempt is in this very small Pull Request - greenmail-mail-test/greenmail#496
I am experiencing a problem in my Pull Request branch when I run the Greenmail test suite using
mvn clean test
.I see the following errors (over and over for many tests):
This comes about because
MailcapCommandMap
in the 2.1.0 API importsjakarta.activation.MailcapRegistry
and creates an array of that type at line 180:However, the type added to the
dbv
list at line 172:is of type:
com.sun.activation.registries.MailcapFile
and hence this causes the above error and stacktrace at line 181:NOTE The packages of the two classes are different, i.e.:
jakarta.activation.MailcapRegistry
andcom.sun.activation.registries.MailcapFile
.To Reproduce
Steps to reproduce the behavior:
git clone https://github.com/evolvedbinary/greenmail.git
cd greenmail
git checkout update-jakarta-mail-api-2.1.0
mvn clean verify -Dtest=ImapProtocolTest#testUidSearchTextWithCharset
Expected behavior
I expect the tests to pass.
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: