So i got nashorn to fire up with the simplest possible configuration possible on jdk17 with tomcat11. I then compared the working environment to to environment that i have the issue on. I basically rigged up tomcat to use log4j2 for logging across the board. That required a smallish change to the setclasspath script and looks like this
windows batch set CLASSHPATH=%CATALINA_HOME%/log4j2/lib/*;%CATALINA_HOME%/log4j2/conf after much tweaking and testing, the following resolved the issue. resolved the issue set CLASSHPATH=%CATALINA_HOME%/log4j2/lib/*;%CATALINA_HOME%/log4j2/conf/* the only change is the /* at the end. thanks for the feedback everyone. maybe this will help someone else in the future On Fri, Nov 22, 2024 at 1:46 PM Leroy Mims <sgt...@gmail.com> wrote: > Did you try this? > > https://stackoverflow.com/questions/74025622/how-to-add-the-nashorn-module-to-tomcat-10 > > > On Fri, Nov 22, 2024 at 12:37 PM Alex O'Ree <alexo...@apache.org> wrote: > > > I do not, checked that already. I'm in the process of bisecting the > > dependency chain to see what's causing the issue. > > > > On Fri, Nov 22, 2024 at 7:46 AM Christopher Schultz < > > ch...@christopherschultz.net> wrote: > > > > > Alex, > > > > > > On 11/21/24 12:14 PM, Alex O'Ree wrote: > > > > could not initialize class > > > > org.openjdk.nashborn.internal.runtime.linker.Bootstrap due to > classdef > > > not > > > > found. However the jar is in place (loaded via the webapp's > > > WEB-INF/lib... > > > > so it should be on the classpath. > > > > > > > > Interestingly, i did attempt to make a simple reproducible example > that > > > can > > > > be shared and i was able to get nashorn to fire up on jdk17 with > tomcat > > > 11. > > > > So i suspect it's some kind of classloading issue on my end or > perhaps > > > some > > > > kind of SPI issue or a class collision or something. I'll keep > > > > investigating. > > > > > > > > Thanks for being my rubber duck! > > > > > > Do you have more than 1 copy of the library laying around anywhere else > > > other than application/WEB-INF/lib? > > > > > > -chris > > > > > > > On Thu, Nov 21, 2024 at 8:01 AM Christopher Schultz < > > > > ch...@christopherschultz.net> wrote: > > > > > > > >> Alex, > > > >> > > > >> On 11/21/24 7:14 AM, Alex O'Ree wrote: > > > >>> I'm running into a bit of a strange problem with attempting to get > a > > > >>> nashorn script working on jdk17 in tomcat 11. it works fine outside > > of > > > >>> tomcat but always fails to start inside tomcat. > > > >> > > > >> Wow, I haven't heard the name Nashorn in forever. > > > >> > > > >>> I suspect it has something to do with the just in time compiler, > but > > > the > > > >>> error messages are so cryptic that it's difficult to tell what's > > going > > > >> on. > > > >> > > > >> Was it too cryptic to copy and paste into this post? > > > >> > > > >>> And of course there's next to no search results on the internet > about > > > >> this. > > > >>> > > > >>> Has anyone out there in the tomcat user community attempted this or > > > have > > > >> an > > > >>> insight as to what the issue could be? > > > >> > > > >> Can you post what you've got? > > > >> > > > >> -chris > > > >> > > > >> > > > >> > --------------------------------------------------------------------- > > > >> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > > > >> For additional commands, e-mail: users-h...@tomcat.apache.org > > > >> > > > >> > > > > > > > > > > > > > --------------------------------------------------------------------- > > > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > > > For additional commands, e-mail: users-h...@tomcat.apache.org > > > > > > > > >