Hi!
I'm currently having serious trouble running our application on the current
Sling Starter 12 snapshot
since we are using ehache 3, which uses sun.misc.Unsafe internally. This works
with Sling Starter 11,
but since it changed to the feature launcher, this class seems to have
disappeared from the
classpath (the class loading of ehcache classes fails with a
java.lang.NoClassDefFoundError: sun/misc/Unsafe).
I tried to add command line arguments
--add-modules=jdk.unsupported
and
--add-opens=jdk.unsupported/sun.misc=ALL-UNNAMED
to the launcher command line, as I've seen that suggested on the net for
similar problems, but it didn't help.
In fact, this doesn't seem to be the problem: even without those flags the
jdk.unsupported module does export sun.misc:
module { name: [email protected], [mandated java.base], exports:
[com.sun.nio.file, sun.misc, sun.reflect], opens: [sun.misc, sun.reflect] }
So it seems the module is loaded, but not used to load the class.
The easiest way to reproduce the problem is to add this to some JSP:
<%
Class clazz = sun.misc.Unsafe.class;
%>
In case that matters: I tried JDK 11 and 13 on MacOS, as well as JDK 11 on an
x86_64 Linux.
This works on Sling Starter 11, but not the current 12 snapshot.
Do you have suggestions what to do to allow sun.misc.Unsafe to be used by the
ehcache 3 bundle?
Any help would be greatly appreciated!
Thank you and best regards,
Hans-Peter