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

Can't use Java 17 with 2.9-M6 milestone if application is using ehcache #11852

Open
yle-heikkij opened this issue Jun 28, 2023 · 6 comments
Open

Comments

@yle-heikkij
Copy link

Play Version

2.9.0-M6

API

Scala

Operating System

MacOS 13.4.1 (22F82)

JDK

openjdk version "17.0.6" 2023-01-17
OpenJDK Runtime Environment Temurin-17.0.6+10 (build 17.0.6+10)
OpenJDK 64-Bit Server VM Temurin-17.0.6+10 (build 17.0.6+10, mixed mode)

Expected Behavior

We have small Play Framework application I tried to run with 2.9.0-M6 in Java 17 environment. App uses ehcache. Everything works fine if Java version is 11

Actual Behavior

java.lang.reflect.InaccessibleObjectException: Unable to make field private final byte[] java.lang.String.value accessible: module java.base does not "opens java.lang" to unnamed module @61fbe4c1
	at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)
	at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
	at java.base/java.lang.reflect.Field.checkCanSetAccessible(Field.java:178)
	at java.base/java.lang.reflect.Field.setAccessible(Field.java:172)
	at net.sf.ehcache.pool.sizeof.ObjectGraphWalker.getAllFields(ObjectGraphWalker.java:271)

-->

@xuwei-k
Copy link
Contributor

xuwei-k commented Jul 3, 2023

Maybe playframework should update to ehcache version 3.x 🤔

@ihostage
Copy link
Member

ihostage commented Jul 3, 2023

@yle-heikkij Can you try to add this JVM parameter --add-opens=java.base/java.lang=ALL-UNNAMED to your run application command?

@xuwei-k I agree with you, we should add upgrade Ehcache into our plans 📝

@yle-heikkij
Copy link
Author

yle-heikkij commented Jul 3, 2023

@yle-heikkij Can you try to add this JVM parameter --add-opens=java.base/java.lang=ALL-UNNAMED to your run application command?

Yes, I tested and error went away

@mkurz mkurz added this to the 2.10.0 milestone Jul 16, 2023
@mkurz
Copy link
Member

mkurz commented Jul 16, 2023

Yeah, ehcache should be upgraded, however this will not make it into 2.9 anymore. Tagged for next major release.

@ben-manes
Copy link

fyi ehcache2 is fully end of life (no maintenance or critical/security fixes)

@mkurz
Copy link
Member

mkurz commented Mar 11, 2024

fyi, we are thinking about to remove play ehcache support. You can either provide a pull request to upgrade to ehcache 3 or you can of course also write a Play module and host it in your own repo.
No one from the Play team will work on that however, so if no one steps forward, we will eventually delete the current Play ehcache module which is still based on ehcache 2.

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

No branches or pull requests

5 participants