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

JDK8: org.json dependency causes java version mistatch #11870

Closed
hasanyildiz opened this issue May 4, 2024 · 4 comments
Closed

JDK8: org.json dependency causes java version mistatch #11870

hasanyildiz opened this issue May 4, 2024 · 4 comments
Assignees
Labels
🐞 defect Bug...Something isn't working
Milestone

Comments

@hasanyildiz
Copy link

Describe the bug

i am using primefaces with running on jdk 8 wtih this dependency of

<dependency> <groupId>org.primefaces</groupId> <artifactId>primefaces</artifactId> <version>13.0.8</version> </dependency>

which contains a dependency of
<dependency> <groupId>org.json</groupId> <artifactId>json</artifactId> <optional>true</optional> </dependency>.

this org.json dependency has this code block

<execution> <id>add-module-infos</id> <phase>package</phase> <goals> <goal>add-module-info</goal> </goals> <configuration> <jvmVersion>9</jvmVersion> <module> <moduleInfoSource> module org.json { exports org.json; } </moduleInfoSource> </module> </configuration> </execution>

which causes my application to run on jdk 8 which causes
java.lang.UnsupportedClassVersionError: Failed to link META-INF/versions/9/module-info (Module "deployment.app.war" from Service Module Loader): META-INF/versions/9/module-info has been compiled by a more recent version of the Java Runtime (class file version 53.0), this version of the Java Runtime only
exception.

this is not happening when using version 13.0.7.

Reproducer

No response

Expected behavior

No response

PrimeFaces edition

Community

PrimeFaces version

13.0.8

Theme

No response

JSF implementation

All

JSF version

2.2

Java version

1.8

Browser(s)

No response

@hasanyildiz hasanyildiz added ‼️ needs-triage Issue needs triaging 🐞 defect Bug...Something isn't working labels May 4, 2024
@melloware melloware removed the ‼️ needs-triage Issue needs triaging label May 4, 2024
@melloware melloware self-assigned this May 4, 2024
@melloware melloware added this to the 13.0.10 milestone May 4, 2024
@melloware
Copy link
Member

We must keep JDK8 compatability for 13.x and I opened a ticket at org.json here: stleary/JSON-java#892

I have an easy workaronud that when we shade the JAR i have to remove that META-INF/versions/ folder.

@GedMarc
Copy link
Contributor

GedMarc commented May 4, 2024

Jdk8 isn't aware of meta-inf/versions, I do not think that would be the issue,

Hmm, it only makes sense if org.json ri is compiled in jdk9 or higher,

Pity about backwards compatibility, when is support for eol jdk8 to end?

melloware added a commit to melloware/primefaces that referenced this issue May 4, 2024
Fix primefaces#11860: 13.0.10 Dialog returnFocus when other dialogs open
melloware added a commit to melloware/primefaces that referenced this issue May 4, 2024
Fix primefaces#11860: 13.0.10 Dialog returnFocus when other dialogs open
@melloware
Copy link
Member

melloware commented May 4, 2024

@GedMarc PrimeFaces 14.0.0 is out and its JDK11 only and JSF 2.3+ only however PF 13 is the last version to support JDK8 and JSF less than 2.3. So I have a feeling the 13.X version will be used for a long time until people can upgrade.

melloware added a commit to melloware/primefaces that referenced this issue May 4, 2024
Fix primefaces#11860: 13.0.10 Dialog returnFocus when other dialogs open
@melloware melloware changed the title org.json dependency causes java version mistatch JDK8: org.json dependency causes java version mistatch May 4, 2024
melloware added a commit that referenced this issue May 4, 2024
Fix #11860: 13.0.10 Dialog returnFocus when other dialogs open
@melloware
Copy link
Member

13.0.10 deployed to Maven Central.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 defect Bug...Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants