Add support for org.ehcache:ehcache:3.10.8-jakarta#124
Conversation
558c300 to
d1f272a
Compare
| String libraryVersion = TestUtils.testedLibraryVersion.split("-")[0] | ||
|
|
||
| dependencies { | ||
| testImplementation("org.ehcache:ehcache:$libraryVersion") { | ||
| capabilities { | ||
| requireCapability('org.ehcache:ehcache-jakarta') | ||
| } | ||
| } |
There was a problem hiding this comment.
- I don't know at all whether this can be used normally when the user uses the jakarta variant of ehcache. At least I solved the error of
./gradlew clean test -Pcoordinates=org.ehcache:ehcache:3.10.8-jakartathrough this processing. - Can a friend expand https://github.com/oracle/graalvm-reachability-metadata/blob/master/CONTRIBUTING.md ?
| testImplementation 'ch.qos.logback:logback-classic:1.4.5' | ||
| testImplementation 'ch.qos.logback:logback-core:1.4.5' | ||
| } | ||
|
|
There was a problem hiding this comment.
- Now execute
./gradlew clean test -Pcoordinates=org.ehcache:ehcache:3.10.8-jakarta, we will see a Warning Log. Do I need to do something or ignore it? Refer to Java 11 support ehcache/ehcache3#2671 .
04:12:09.769 [main] WARN org.ehcache.sizeof.ObjectGraphWalker - The JVM is preventing Ehcache from accessing the subgraph beneath 'private final byte[] java.lang.String.value' - cache sizes may be underestimated as a result
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 @3e7dfd44
at java.base@17.0.5/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)
at java.base@17.0.5/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
at java.base@17.0.5/java.lang.reflect.Field.checkCanSetAccessible(Field.java:178)
at java.base@17.0.5/java.lang.reflect.Field.setAccessible(Field.java:172)
at org.ehcache.sizeof.ObjectGraphWalker.getAllFields(ObjectGraphWalker.java:245)
at org.ehcache.sizeof.ObjectGraphWalker.getFilteredFields(ObjectGraphWalker.java:204)
at org.ehcache.sizeof.ObjectGraphWalker.walk(ObjectGraphWalker.java:159)
at org.ehcache.sizeof.SizeOf.deepSizeOf(SizeOf.java:70)
at org.ehcache.impl.internal.sizeof.DefaultSizeOfEngine.sizeof(DefaultSizeOfEngine.java:51)
at org.ehcache.impl.internal.store.heap.OnHeapStore.getSizeOfKeyValuePairs(OnHeapStore.java:981)
at org.ehcache.impl.internal.store.heap.OnHeapStore.makeValue(OnHeapStore.java:1529)
at org.ehcache.impl.internal.store.heap.OnHeapStore.makeValue(OnHeapStore.java:1515)
at org.ehcache.impl.internal.store.heap.OnHeapStore.newCreateValueHolder(OnHeapStore.java:1464)
at org.ehcache.impl.internal.store.heap.OnHeapStore.lambda$put$8(OnHeapStore.java:344)
at org.ehcache.impl.internal.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1934)
at org.ehcache.impl.internal.store.heap.SimpleBackend.compute(SimpleBackend.java:98)|
Many of the entries in |
|
I believe anyone using JAXB may have this problem. As such, I am not sure that it's appropriate for EhCache to provide the reachability metadata that makes it work. It may be that there should be some reachability metadata for JAXB itself. Put another way, depending on Ehcache shouldn't magically make JAXB start working in other places. |
|
|
I suspect that someone should do that, but it doesn't have to be you of course. To proceed here, I think we need to understand how Ehcache is using JAXB. That would give us the information that's needed to determine where the metadata should go. Until that's been done, I think adding it under Ehcache would be the wrong thing to do. |
|
30c1cb7 to
c12b567
Compare
f0ef929 to
042dc54
Compare
a880255 to
deb8fa6
Compare
|
@dnestoro I'm assuming I need to resolve merge conflicts first, right? |
Yes. Sorry, I forgot to ask for that |
# Conflicts: # metadata/index.json # tests/src/index.json
| { | ||
| "name": "com.sun.org.apache.xerces.internal.impl.msg.SAXMessages", | ||
| "locales": [ | ||
| "und", |
There was a problem hiding this comment.
- This is simply generated by Conditional Agent Mode. Do I need to remove it?
|
I will test it tomorrow with https://github.com/spring-projects/spring-aot-smoke-tests. |
Does not work yet, see oracle/graalvm-reachability-metadata#124.
|
@linghengqian I have tested with spring-projects/spring-aot-smoke-tests#160 and had the following error: Could you please add the constructor hints for serializer + related tests and test with the sample from the PR I linked above:
|
{
"condition": {
"typeReachable": "org.ehcache.impl.config.serializer.DefaultSerializationProviderConfiguration"
},
"name": "org.ehcache.impl.serialization.PlainJavaSerializer",
"methods": [
{
"name": "<init>",
"parameterTypes": [
"java.lang.ClassLoader"
]
}
]
}
|
|
Ok I will test again to check how it goes now. |
|
Works as expected on Spring side. @dnestoro You can merge this PR. |

What does this PR do?
org.ehcache:ehcache-jakarta#123 .Checklist before merging