Skip to content
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

Enhancement: Clarify dependency on Jakarta Activation: DataSources no longer work on Java 9+ #225

Closed
mrj opened this issue Aug 31, 2019 · 8 comments

Comments

@mrj
Copy link

mrj commented Aug 31, 2019

javax.activation, which creates DataSource objects for attachments, is deprecated in Java 9+. Without the interim fix of adding the javax.activation module to the JVM start, the JVM silently hangs looking for it. It was hard tracking down the reason why after moving from Java 8 to 11 my app hung when one of my classes was loaded.

The docs should be updated to warn that withAttachment using a javax.activation DataSource will fail on Java ≥ 9, and that either byte arrays should be used exclusively, or Jakarta Activation used instead.

@bbottema
Copy link
Owner

bbottema commented Sep 1, 2019

Ok, thanks for the forensic work! I'll check the size of the activation library and probably lock it in. Won't be for a few weeks though, currently away from home for two weeks.

@bbottema
Copy link
Owner

Looking into this again I'm getting confused: the activation framework is already included as external dependency by JavaMail:

image

So why is this failing for you in Java ≥ 9?

@mrj
Copy link
Author

mrj commented Sep 27, 2019

Ah. I haven't yet worked out how to use Maven dependencies. I just add libraries to my Eclipse build path that the docs request, plus what prevents compile errors. I guess this is one missing dependency that instead manifests as a run-time hang on Java ≥ 9. Perhaps your docs can mention this stealth dependency.

@bbottema
Copy link
Owner

Well, you made me think now. It comes as a transitive dependency (stealth dependency as you say), but it is also a direct dependency of Simple Java Mail, not just Jakarta JavaMail. That means I should include it as such in the pom.xml and NOTICE.txt.

Would that be enough or are you looking at specific documentation for Simple Java Mail's dependencies?

@mrj
Copy link
Author

mrj commented Sep 27, 2019

Sorry, I'm not familiar with Java's dependency-detection mechanisms. Explicit dependency documentation wouldn't be needed if the missing dependency generated a compilation error that suggested what's missing — though explicit docs would help in this case where a dependency is moving from a Java standard component to a third-party library.

bbottema pushed a commit that referenced this issue Sep 27, 2019
…ava Mail depends on it explicitly besides Jakarta JavaMail
@bbottema
Copy link
Owner

Explicit dependency documentation wouldn't be needed if the missing dependency generated a compilation error that suggested what's missing

That's not possible with jars unfortunately (with modules this works much better).

though explicit docs would help in this case

I'll make sure to mention it somewhere. For now I've included it in both the pom.xml and NOTICE.txt, which is not related to Maven.

bbottema pushed a commit that referenced this issue Sep 27, 2019
@bbottema
Copy link
Owner

I've updated the documentation, but it will only show up once 6.0.0 is released.

@bbottema bbottema changed the title DataSources for attachments no longer work by default on Java 9+ Clarify dependency on Jakarta Activation: DataSources no longer work on Java 9+ Sep 27, 2019
@bbottema bbottema changed the title Clarify dependency on Jakarta Activation: DataSources no longer work on Java 9+ Enhancement: Clarify dependency on Jakarta Activation: DataSources no longer work on Java 9+ Sep 27, 2019
@bbottema bbottema added this to the 5.4.0 milestone Sep 27, 2019
@bbottema
Copy link
Owner

5.4.0 released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants