<div dir="ltr"><div class="gmail_default" style="font-family:georgia,serif;color:#20124d">This is my StackTrace.</div><div class="gmail_default" style="font-family:georgia,serif;color:#20124d">Since the line shown is the one trying to load a non existent method, I assumed that was the problem.</div><div class="gmail_default" style="font-family:georgia,serif;color:#20124d">The Exception seems to be NoClassDefFoundError instead…</div><div class="gmail_default" style="font-family:georgia,serif;color:#20124d"><br></div><div class="gmail_default" style="font-family:georgia,serif;color:#20124d">The environement is Wildfly 30 / jdk 17</div><div class="gmail_default" style="font-family:georgia,serif;color:#20124d"><br></div><div class="gmail_default" style="font-family:georgia,serif;color:#20124d"><div style="padding:0px 0px 0px 2px"><div style="color:rgb(0,0,0);font-family:Consolas;font-size:10pt;white-space:pre"><p style="margin:0px">18:31:00,119 ERROR [io.undertow.request] (default task-2) UT005023: Exception handling request to /HNS/HNSAdmin/query.pilot: java.lang.NoClassDefFoundError: sun/misc/Unsafe</p><p style="margin:0px"> at deployment.HNS.war//org.openjdk.nashorn.internal.runtime.Context$AnonymousContextCodeInstaller.lambda$getDefineAnonymousClass$0(<span style="color:rgb(0,102,204);text-decoration-line:underline;text-decoration-style:solid">Context.java:330</span>)</p><p style="margin:0px"> at java.base/java.security.AccessController.doPrivileged(<span style="color:rgb(0,102,204);text-decoration-line:underline;text-decoration-style:solid">AccessController.java:318</span>)</p><p style="margin:0px"> at deployment.HNS.war//org.openjdk.nashorn.internal.runtime.Context$AnonymousContextCodeInstaller.getDefineAnonymousClass(<span style="color:rgb(0,102,204);text-decoration-line:underline;text-decoration-style:solid">Context.java:328</span>)</p><p style="margin:0px"> at deployment.HNS.war//org.openjdk.nashorn.internal.runtime.Context$AnonymousContextCodeInstaller.<clinit>(<span style="color:rgb(0,102,204);text-decoration-line:underline;text-decoration-style:solid">Context.java:317</span>)</p><p style="margin:0px"> at deployment.HNS.war//org.openjdk.nashorn.internal.runtime.Context.lambda$compile$9(<span style="color:rgb(0,102,204);text-decoration-line:underline;text-decoration-style:solid">Context.java:1506</span>)</p><p style="margin:0px"> at deployment.HNS.war//org.openjdk.nashorn.internal.runtime.ScriptEnvironment.useAnonymousClasses(<span style="color:rgb(0,102,204);text-decoration-line:underline;text-decoration-style:solid">ScriptEnvironment.java:491</span>)</p><p style="margin:0px"> at deployment.HNS.war//org.openjdk.nashorn.internal.runtime.Context.compile(<span style="color:rgb(0,102,204);text-decoration-line:underline;text-decoration-style:solid">Context.java:1506</span>)</p><p style="margin:0px"> at deployment.HNS.war//org.openjdk.nashorn.internal.runtime.Context.compileScript(<span style="color:rgb(0,102,204);text-decoration-line:underline;text-decoration-style:solid">Context.java:1451</span>)</p><p style="margin:0px"> at deployment.HNS.war//org.openjdk.nashorn.internal.runtime.Context.compileScript(<span style="color:rgb(0,102,204);text-decoration-line:underline;text-decoration-style:solid">Context.java:761</span>)</p><p style="margin:0px"> at deployment.HNS.war//org.openjdk.nashorn.api.scripting.NashornScriptEngine.compileImpl(<span style="color:rgb(0,102,204);text-decoration-line:underline;text-decoration-style:solid">NashornScriptEngine.java:528</span>)</p><p style="margin:0px"> at deployment.HNS.war//org.openjdk.nashorn.api.scripting.NashornScriptEngine.compileImpl(<span style="color:rgb(0,102,204);text-decoration-line:underline;text-decoration-style:solid">NashornScriptEngine.java:517</span>)</p><p style="margin:0px"> at deployment.HNS.war//org.openjdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(<span style="color:rgb(0,102,204);text-decoration-line:underline;text-decoration-style:solid">NashornScriptEngine.java:395</span>)</p><p style="margin:0px"> at deployment.HNS.war//org.openjdk.nashorn.api.scripting.NashornScriptEngine.eval(<span style="color:rgb(0,102,204);text-decoration-line:underline;text-decoration-style:solid">NashornScriptEngine.java:151</span>)</p><p style="margin:0px"> at java.scripting/javax.script.AbstractScriptEngine.eval(<span style="color:rgb(0,102,204);text-decoration-line:underline;text-decoration-style:solid">AbstractScriptEngine.java:262</span>)</p><p style="margin:0px"><br></p><p style="margin:0px"></p></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le mer. 24 janv. 2024 à 18:20, Attila Szegedi <<a href="mailto:szegedia@gmail.com">szegedia@gmail.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>Hi!<div><br></div><div>Are you experiencing this with Nashorn 15.4 from <a href="https://github.com/openjdk/nashorn" target="_blank">https://github.com/openjdk/nashorn</a>? This issue is supposed to have been fixed since Nashorn 15.3 in this change <a href="https://github.com/openjdk/nashorn/pull/16" target="_blank">https://github.com/openjdk/nashorn/pull/16</a> according to the changelog: <a href="https://github.com/openjdk/nashorn/blob/main/CHANGELOG.md" target="_blank">https://github.com/openjdk/nashorn/blob/main/CHANGELOG.md</a></div><div><br></div><div>You say it fails, but it’s encased in a try-catch specifically for this reason. Can you give me a stack trace of how it fails?</div><div><br></div><div>Attila.</div><div><br><div><br><blockquote type="cite"><div>On 2024. Jan 24., at 13:02, Luc Chapon <<a href="mailto:sxilderik@gmail.com" target="_blank">sxilderik@gmail.com</a>> wrote:</div><br><div><div dir="ltr"><div class="gmail_default" style="font-family:georgia,serif;color:rgb(32,18,77)">Hello all</div><div class="gmail_default" style="font-family:georgia,serif;color:rgb(32,18,77)"><br></div><div class="gmail_default" style="font-family:georgia,serif;color:rgb(32,18,77)">First message here</div><div class="gmail_default" style="font-family:georgia,serif;color:rgb(32,18,77)"><br></div><div class="gmail_default" style="font-family:georgia,serif;color:rgb(32,18,77)">We are facing a problem re Nashorn (latest) and java17</div><div class="gmail_default" style="font-family:georgia,serif;color:rgb(32,18,77)"><br></div><div class="gmail_default" style="font-family:georgia,serif;color:rgb(32,18,77)">In Context.java, line 330, you try to get a handle to a no longer existent method, Unsafe.defineAnonymousClass</div><div class="gmail_default" style="font-family:georgia,serif;color:rgb(32,18,77)"><br></div><div class="gmail_default" style="font-family:georgia,serif;color:rgb(32,18,77)">And fail of course.</div><div class="gmail_default" style="font-family:georgia,serif;color:rgb(32,18,77)"><br></div><div class="gmail_default" style="font-family:georgia,serif;color:rgb(32,18,77)">I’m trying to rewrite this part for our own temporary urgent need according to this.<br><br><a href="https://www.oracle.com/java/technologies/javase/17-relnote-issues.html" target="_blank">https://www.oracle.com/java/technologies/javase/17-relnote-issues.html</a><br></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div class="gmail_default" style="font-family:georgia,serif;color:rgb(32,18,77)"><div style="box-sizing:border-box;margin:0px;padding:0px;list-style:none;background-repeat:no-repeat;font-family:OracleSansVF,OracleSansVFCyGr,OracleSansFB,-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",sans-serif;font-size:14.63px;background-color:rgb(251,249,248)">core-libs</div></div><div class="gmail_default" style="font-family:georgia,serif;color:rgb(32,18,77)"><b style="box-sizing:border-box;margin:0px;padding:0px;list-style:none;background-repeat:no-repeat;font-family:OracleSansVF,OracleSansVFCyGr,OracleSansFB,-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",sans-serif;font-size:14.63px;background-color:rgb(251,249,248)"><a href="https://www.oracle.com/java/technologies/javase/17-relnote-issues.html#JDK-8243287" style="box-sizing:border-box;margin:0px;padding:0px;list-style:none;background-repeat:no-repeat;color:rgb(0,107,143);text-decoration-line:none" target="_blank"><span style="box-sizing:border-box;margin:0px;padding:0px;list-style:none;background-repeat:no-repeat">➜</span></a> Removal of sun.misc.Unsafe::defineAnonymousClass</b></div><div class="gmail_default" style="font-family:georgia,serif;color:rgb(32,18,77)"><p style="box-sizing:border-box;margin:0px 0px 1.1em;padding:0px;list-style:none;background-repeat:no-repeat;line-height:1.55;font-family:OracleSansVF,OracleSansVFCyGr,OracleSansFB,-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",sans-serif;font-size:14.63px;background-color:rgb(251,249,248)"><code style="box-sizing:border-box;margin:0px;padding:0px;list-style:none;background-repeat:no-repeat">sun.misc.Unsafe::defineAnonymousClass</code> API has been removed in JDK 17. The API replacement is <code style="box-sizing:border-box;margin:0px;padding:0px;list-style:none;background-repeat:no-repeat">java.lang.invoke.MethodHandles.Lookup::defineHiddenClass</code> and <code style="box-sizing:border-box;margin:0px;padding:0px;list-style:none;background-repeat:no-repeat">java.lang.invoke.MethodHandles.Lookup::defineHiddenClassWithClassData</code>.</p></div></blockquote><div class="gmail_default" style="font-family:georgia,serif;color:rgb(32,18,77)"><br></div><div class="gmail_default" style="font-family:georgia,serif;color:rgb(32,18,77)">Are you aware of the problem? Is there a fix already available?</div><div class="gmail_default" style="font-family:georgia,serif;color:rgb(32,18,77)"><br></div><div class="gmail_default" style="font-family:georgia,serif;color:rgb(32,18,77)">Thank you!</div><div class="gmail_default" style="font-family:georgia,serif;color:rgb(32,18,77)"><br></div><div class="gmail_default" style="font-family:georgia,serif;color:rgb(32,18,77)">Luc Chapon</div><div class="gmail_default" style="font-family:georgia,serif;color:rgb(32,18,77)">ChapsVision</div><div class="gmail_default" style="font-family:georgia,serif;color:rgb(32,18,77)">Suresnes, France</div><div class="gmail_default" style="font-family:georgia,serif;color:rgb(32,18,77)"><br></div></div>
</div></blockquote></div><br></div></div></blockquote></div>