Java 17 Ehcache issues

58 views
Skip to first unread message

SATNAM SINGH

unread,
Sep 2, 2024, 10:32:25 AM9/2/24
to ehcache-dev
Hi when i am running my code which uses ehcache 3.8.1 it works fine but with JDK 17 the test's are failing with error :

Screenshot 2024-09-02 at 7.59.45 PM.png

Text : 

02.09.2024 14:00:42.530 *INFO* [org.ehcache.impl.internal.resilience.RobustResilienceStrategy] AbstractResilienceStrategy.java:116 Ehcache key agooddevicetoken recovered from
org.ehcache.spi.resilience.StoreAccessException: java.lang.reflect.InaccessibleObjectException: Unable to make field transient java.util.LinkedHashMap$Entry java.util.LinkedHashMap.head accessible:
module java.base does not "opens java.util" to unnamed module @445b84c0
at org.ehcache.core.exceptions.StorePassThroughException.handleException(StorePassThroughException.java:78) ~[ehcache-3.8.1.jar:3.8.1 a19322e8d4b3f7157e878112c2afc0b6e3090fdd]
at org.ehcache.impl.internal.store.heap.OnHeapStore.put(OnHeapStore.java:382) ~[ehcache-3.8.1.jar:3.8.1 a19322e8d4b3f7157e878112c2afc0b6e3090fdd]
at org.ehcache.core.Ehcache.doPut(Ehcache.java:94) ~[ehcache-3.8.1.jar:3.8.1 a19322e8d4b3f7157e878112c2afc0b6e3090fdd]


I have tried to add --add-opens in JVM args as well but that dosn't work.

Any solution or anything i am doing wrong ?

Henri Tremblay

unread,
Sep 2, 2024, 12:56:17 PM9/2/24
to ehcac...@googlegroups.com
The -add-opens should work given the message.
What was the add-open added?

--
You received this message because you are subscribed to the Google Groups "ehcache-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ehcache-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ehcache-dev/3c1148b1-53d8-40d3-99c4-ddb7d5772a1en%40googlegroups.com.

SATNAM SINGH

unread,
Sep 3, 2024, 1:16:00 AM9/3/24
to ehcache-dev
i added in jvmArgs , is version 3.8.1 is compatible with JDK 17 ?? 

--add-opens java.base/java.lang=ALL-UNNAMED

Henri Tremblay

unread,
Sep 3, 2024, 7:02:02 AM9/3/24
to ehcac...@googlegroups.com
the error is about java.util. So you should put --add-opens java.base/java.util=ALL-UNNAMED

SATNAM SINGH

unread,
Sep 9, 2024, 6:57:41 AM9/9/24
to ehcache-dev
Hi Thanks henri,

Issues were resolved when I updated my Ehcache version to 3.9.x from 3.8.x, also warnings were from java.util and got resolved,

Thank you for your help cheers!

Reply all
Reply to author
Forward
0 new messages