Skip to content

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

Closed

Description

@mrj

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.

Activity

  1. bbottema commented on Sep 1, 2019

    @bbottema
    Owner

    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.

  2. bbottema commented on Sep 27, 2019

    @bbottema
    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?

  3. mrj commented on Sep 27, 2019

    @mrj
    Author

    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.

  4. bbottema commented on Sep 27, 2019

    @bbottema
    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?

  5. mrj commented on Sep 27, 2019

    @mrj
    Author

    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.

  6. added a commit that references this issue on Sep 27, 2019
  7. bbottema commented on Sep 27, 2019

    @bbottema
    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.

  8. added a commit that references this issue on Sep 27, 2019
  9. bbottema commented on Sep 27, 2019

    @bbottema
    Owner

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

  10. 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+[/+] on Sep 27, 2019
  11. 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+[/+] on Sep 27, 2019
  12. added this to the 5.4.0 milestone on Sep 27, 2019
  13. bbottema commented on Sep 28, 2019

    @bbottema
    Owner

    5.4.0 released.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions