question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

I’m using java 9 modules in my project and when I try to use it, I get this compilation error:

> Task :auth:compileJava FAILED
error: the unnamed module reads package io.jsonwebtoken.io from both jjwt.api and jjwt.jackson
error: module reactor.core reads package io.jsonwebtoken.io from both jjwt.api and jjwt.jackson
error: module spring.boot.starter reads package io.jsonwebtoken.io from both jjwt.api and jjwt.jackson
error: module jjwt.jackson reads package io.jsonwebtoken.io from both jjwt.api and jjwt.jackson
error: module com.fasterxml.jackson.databind reads package io.jsonwebtoken.io from both jjwt.api and jjwt.jackson
error: module jjwt.impl reads package io.jsonwebtoken.io from both jjwt.api and jjwt.jackson
...

My gradle file looks like this:

implementation 'io.jsonwebtoken:jjwt-api:0.10.5'
runtime 'io.jsonwebtoken:jjwt-impl:0.10.5','io.jsonwebtoken:jjwt-orgjson:0.10.5'

I couldn’t make it work or find any workaround to this issue.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
jaapcoomanscommented, May 27, 2019

Bumped into this issue as well. Happy to file a PR with a solution for using JJWT on the module-path. But looking at #400 I want to check the best solution path here first. It’s a little bit of a catch 22 because breaking backwards compatibility causes issues for existing users, whereas not solving the issue blocks users wanting to move forward with JPMS.

There are a few options that both solve the split-package issue and keep backwards-compatibility into account:

  1. Deprecate and replace the current jackson and orgjson extensions by new ones. That is, not only the classes, but the whole deliverable. As long as jjwt and its extensions are not fully modular (and thus interpreted as an automatic module), only deprecating the offending classes will not help, as their package will still be exported and cause split-package issues.
  2. Pull the extensions (back) into the main artifact. That of course has an impact on distribution and transitive dependencies.

Non-options:

  1. Go fully modular (and therefore make it possible not to export the offending package). The jjwt extensions have non-modular dependencies. These first need to become proper JPMS modules.
  2. Only rename the packages. This will, as mentioned, break backwards compatibility. A little search on github alone taught me that these classes are indeed directly referenced by some projects.

Bottom line I guess that solution number 1 is the most viable option here.

2reactions
mcgincommented, Dec 5, 2018

The same issue applies to the two classes in jjwt-orgjson

Read more comments on GitHub >

github_iconTop Results From Across the Web

Oracle Java SE Support Roadmap
Oracle provides this Oracle Java SE Support Roadmap, to help you understand maintenance and support options and related timelines.
Read more >
Java/OpenJDK - endoflife.date
Release Released Active Support 19 2 months and 3 weeks ago. (20 Sep 2022) Ends in 3 months. (21 Mar 2023) 18 8 months and...
Read more >
OpenJDK Life Cycle and Support Policy - Red Hat Customer ...
OpenJDK is also shipped as the JDK and JRE in many containers in the Red Hat ... to support Long Term Support Releases...
Read more >
Java version history - Wikipedia
Java 7 is no longer publicly supported. For Java 11, long-term support will not be provided by Oracle for the public; instead, the...
Read more >
New Features in Java 10 - Baeldung
JDK 10, which is an implementation of Java SE 10, was released on ... This new support is enabled by default and can...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found