Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker errors using javascript template #1771

Open
dom54 opened this issue Jul 13, 2023 · 11 comments
Open

Docker errors using javascript template #1771

dom54 opened this issue Jul 13, 2023 · 11 comments

Comments

@dom54
Copy link

dom54 commented Jul 13, 2023

Describe the issue
Lots of errors in the logs as per below.

I believe the cause is use of JDK 17 which does not have nashorn.

2023-07-12 21:57:17 5.15.0 INFO 1080 jdk/nashorn/api/scripting/ClassFilter 
java.lang.NoClassDefFoundError: jdk/nashorn/api/scripting/ClassFilter
	at org.mockserver.mock.action.http.HttpResponseTemplateActionHandler.getJavaScriptTemplateEngine(HttpResponseTemplateActionHandler.java:68)
	at org.mockserver.mock.action.http.HttpResponseTemplateActionHandler.handle(HttpResponseTemplateActionHandler.java:41)
	at org.mockserver.mock.action.http.HttpActionHandler.lambda$null$3(HttpActionHandler.java:113)
	at org.mockserver.mock.action.http.HttpActionHandler.handleAnyException(HttpActionHandler.java:340)
	at org.mockserver.mock.action.http.HttpActionHandler.lambda$processAction$4(HttpActionHandler.java:112)
	at org.mockserver.scheduler.Scheduler.run(Scheduler.java:94)
	at org.mockserver.scheduler.Scheduler.schedule(Scheduler.java:120)
	at org.mockserver.mock.action.http.HttpActionHandler.processAction(HttpActionHandler.java:112)
	at org.mockserver.netty.HttpRequestHandler.channelRead0(HttpRequestHandler.java:189)
	at org.mockserver.netty.HttpRequestHandler.channelRead0(HttpRequestHandler.java:51)
	at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:99)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
	at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:436)
	at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
	at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:251)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
	at org.mockserver.dashboard.DashboardWebSocketHandler.channelRead(DashboardWebSocketHandler.java:137)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
	at org.mockserver.netty.websocketregistry.CallbackWebSocketServerHandler.channelRead(CallbackWebSocketServerHandler.java:57)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
	at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
	at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
	at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
	at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:436)
	at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:346)
	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:318)
	at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:251)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
	at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
	at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166)
	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:788)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650)
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562)
	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
	at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.lang.ClassNotFoundException: jdk.nashorn.api.scripting.ClassFilter
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
	... 59 more

What you are trying to do
Description of what you are trying to do so we can understand the context of the problem

MockServer version
5.15.0 Docker

To Reproduce
Anything that uses the templateType JAVASCRIPT e.g.

 {
    "id": "f0a2e028-d25e-420e-a1be-3168f90a4aab",
    "priority": 0,
    "httpRequest": {
      "method": "POST",
      "path": "/v1/generate/url",
      "headers": {
        "content-type": ["application/json"]
      }
    },
    "times": {
      "unlimited": true
    },
    "timeToLive": {
      "unlimited": true
    },
    "httpResponseTemplate": {
      "template": "return { statusCode: 200, headers: { \"Content-Type\" : [ \"application/json\" ] }, body: {accessUrl: JSON.parse(request.body.json).externalReference} };",
      "templateType": "JAVASCRIPT"
    }
  },

How you are running MockServer (i.e maven plugin, docker, etc)
Docker

  1. Code you used to create expectations
    As Above

  2. What error you saw
    As above

Expected behaviour
No errors

MockServer Log
As above

@juan-antonio-alba-db
Copy link

I have been forced to migrate to javascript templating because #1773 and now I face this issue as well when I tried to upgrade the version.
Could you please take a look?

@mapwake
Copy link

mapwake commented Aug 11, 2023

seems to be related to #1326 (comment)
i am expiring the same problem

@katzda01
Copy link

I ran into this exact same problem.

@etinquis
Copy link

etinquis commented Dec 15, 2023

I've managed to get it working with the following dockerfile, building nashorn, renaming all the classes into the old namespace with jarjar, and copying the jars over into the mockserver libs directory:

FROM openjdk:12-alpine as jarjar-build

RUN apk add git
RUN mkdir -p /build
WORKDIR /build
RUN git clone --depth 1 --branch fix-jdk11 https://github.com/redcape/jarjar
WORKDIR /build/jarjar
RUN ./gradlew jar

FROM alpine as nashorn-build

RUN apk add git openjdk17 apache-ant
RUN mkdir -p /build/
WORKDIR /build/
RUN git clone --depth 1 https://github.com/openjdk/nashorn
WORKDIR /build/nashorn/make/nashorn
RUN ant jar

COPY --from=jarjar-build /build/jarjar/jarjar-command/build/libs/jarjar-command-1.1.1.jar ./jarjar.jar

COPY nashorn.rename.rules .
RUN java -jar jarjar.jar /build/nashorn/build/nashorn/dist/nashorn.jar --rules ./nashorn.rename.rules --output /build/nashorn/build/nashorn/dist/nashorn.renamed.jar

FROM mockserver/mockserver

COPY --from=nashorn-build /build/nashorn/build/nashorn/dist/nashorn.renamed.jar /libs/nashorn.renamed.jar
COPY --from=nashorn-build /build/nashorn/build/nashorn/dependencies/*.jar /libs/.

ARG MOCK_FILE

COPY ${MOCK_FILE} /mockdata/${MOCK_FILE}
ENV MOCKSERVER_INITIALIZATION_JSON_PATH=/mockdata/${MOCK_FILE}

nashorn.rename.rules:

rule org.openjdk.nashorn.** jdk.nashorn.@1

Of particular note, the main branch of jarjar doesn't work, you need to use the fork from shevek/jarjar#23 for that fix, otherwise jarjar won't rename all the classes properly.

(The last 3 lines of the dockerfile aren't relevant to the issue and can be removed)

@eilon-shai
Copy link

I am trying this docker file, getting:

Failed generating bytecode for :3
java.lang.AssertionError: Failed generating bytecode for :3
at jdk.nashorn.internal.codegen.CompilationPhase$BytecodeGenerationPhase.transform(CompilationPhase.java:437)
at jdk.nashorn.internal.codegen.CompilationPhase.apply(CompilationPhase.java:614)
at jdk.nashorn.internal.codegen.Compiler.compile(Compiler.java:641)
at jdk.nashorn.internal.runtime.RecompilableScriptFunctionData.compileTypeSpecialization(RecompilableScriptFunctionData.java:730)
at jdk.nashorn.internal.runtime.RecompilableScriptFunctionData.getBest(RecompilableScriptFunctionData.java:910)
at jdk.nashorn.internal.runtime.ScriptFunctionData.getBest(ScriptFunctionData.java:384)
at jdk.nashorn.internal.runtime.ScriptFunctionData.getBestInvoker(ScriptFunctionData.java:244)
at jdk.nashorn.internal.runtime.ScriptFunction.findCallMethod(ScriptFunction.java:917)
at jdk.nashorn.internal.runtime.ScriptObject.lookup(ScriptObject.java:1881)
at jdk.nashorn.internal.runtime.linker.NashornLinker.getGuardedInvocation(NashornLinker.java:104)
at jdk.nashorn.internal.runtime.linker.NashornLinker.getGuardedInvocation(NashornLinker.java:96)
at jdk.dynalink/jdk.dynalink.linker.support.CompositeTypeBasedGuardingDynamicLinker.getGuardedInvocation(CompositeTypeBasedGuardingDynamicLinker.java:161)
at jdk.dynalink/jdk.dynalink.linker.support.CompositeGuardingDynamicLinker.getGuardedInvocation(CompositeGuardingDynamicLinker.java:109)
at jdk.dynalink/jdk.dynalink.LinkerServicesImpl.lambda$getGuardedInvocation$0(LinkerServicesImpl.java:137)
at jdk.dynalink/jdk.dynalink.LinkerServicesImpl.getWithLookupInternal(LinkerServicesImpl.java:168)
at jdk.dynalink/jdk.dynalink.LinkerServicesImpl.getGuardedInvocation(LinkerServicesImpl.java:135)
at jdk.dynalink/jdk.dynalink.DynamicLinker.relink(DynamicLinker.java:241)
at jdk.nashorn.internal.scripts.Script$Recompilation$1$304A$^eval_.serialise(:4)
at jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:648)
at jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:513)
at jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:520)
at jdk.nashorn.api.scripting.ScriptObjectMirror.call(ScriptObjectMirror.java:111)
at org.mockserver.templates.engine.javascript.JavaScriptTemplateEngine.executeTemplate(JavaScriptTemplateEngine.java:69)
at org.mockserver.mock.action.http.HttpResponseTemplateActionHandler.handle(HttpResponseTemplateActionHandler.java:50)
at org.mockserver.mock.action.http.HttpActionHandler.lambda$null$3(HttpActionHandler.java:113)
at org.mockserver.mock.action.http.HttpActionHandler.handleAnyException(HttpActionHandler.java:340)
at org.mockserver.mock.action.http.HttpActionHandler.lambda$processAction$4(HttpActionHandler.java:112)
at org.mockserver.scheduler.Scheduler.run(Scheduler.java:94)
at org.mockserver.scheduler.Scheduler.schedule(Scheduler.java:120)
at org.mockserver.mock.action.http.HttpActionHandler.processAction(HttpActionHandler.java:112)
at org.mockserver.netty.HttpRequestHandler.channelRead0(HttpRequestHandler.java:189)
at org.mockserver.netty.HttpRequestHandler.channelRead0(HttpRequestHandler.java:51)
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:99)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:436)
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:251)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
at org.mockserver.dashboard.DashboardWebSocketHandler.channelRead(DashboardWebSocketHandler.java:137)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
at org.mockserver.netty.websocketregistry.CallbackWebSocketServerHandler.channelRead(CallbackWebSocketServerHandler.java:57)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:436)
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:346)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:318)
at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:251)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:788)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562)
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.lang.AssertionError: java.lang.ClassNotFoundException: org.openjdk.nashorn.internal.objects.NativeArray
at jdk.nashorn.internal.codegen.types.Type.lambda$typeFor$0(Type.java:255)
at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1708)
at jdk.nashorn.internal.codegen.types.Type.typeFor(Type.java:251)
at jdk.nashorn.internal.codegen.types.Type.getMethodReturnType(Type.java:288)
at jdk.nashorn.internal.codegen.MethodEmitter.fixParamStack(MethodEmitter.java:1433)
at jdk.nashorn.internal.codegen.MethodEmitter.invoke(MethodEmitter.java:1450)
at jdk.nashorn.internal.codegen.MethodEmitter.invokestatic(MethodEmitter.java:1504)
at jdk.nashorn.internal.codegen.CodeGenerator.globalAllocateArray(CodeGenerator.java:4646)
at jdk.nashorn.internal.codegen.CodeGenerator.loadLiteral(CodeGenerator.java:2409)
at jdk.nashorn.internal.codegen.CodeGenerator$2.enterLiteralNode(CodeGenerator.java:1007)
at jdk.nashorn.internal.ir.LiteralNode$ArrayLiteralNode.accept(LiteralNode.java:925)
at jdk.nashorn.internal.ir.LexicalContextNode$Acceptor.accept(LexicalContextNode.java:57)
at jdk.nashorn.internal.ir.LiteralNode$ArrayLiteralNode.accept(LiteralNode.java:920)
at jdk.nashorn.internal.codegen.CodeGenerator.loadExpression(CodeGenerator.java:857)
at jdk.nashorn.internal.codegen.CodeGenerator.loadExpression(CodeGenerator.java:833)
at jdk.nashorn.internal.codegen.CodeGenerator.loadExpressionAsType(CodeGenerator.java:828)
at jdk.nashorn.internal.codegen.CodeGenerator$9.loadValue(CodeGenerator.java:2539)
at jdk.nashorn.internal.codegen.CodeGenerator$9.loadValue(CodeGenerator.java:2535)
at jdk.nashorn.internal.codegen.ObjectCreator.loadTuple(ObjectCreator.java:159)
at jdk.nashorn.internal.codegen.FieldObjectCreator.putField(FieldObjectCreator.java:188)
at jdk.nashorn.internal.codegen.FieldObjectCreator.populateRange(FieldObjectCreator.java:153)
at jdk.nashorn.internal.codegen.ObjectCreator.makeObject(ObjectCreator.java:82)
at jdk.nashorn.internal.codegen.CodeGenerator.loadObjectNode(CodeGenerator.java:2547)
at jdk.nashorn.internal.codegen.CodeGenerator$2.enterObjectNode(CodeGenerator.java:1187)
at jdk.nashorn.internal.ir.ObjectNode.accept(ObjectNode.java:78)
at jdk.nashorn.internal.ir.LexicalContextNode$Acceptor.accept(LexicalContextNode.java:57)
at jdk.nashorn.internal.ir.ObjectNode.accept(ObjectNode.java:73)
at jdk.nashorn.internal.codegen.CodeGenerator.loadExpression(CodeGenerator.java:857)
at jdk.nashorn.internal.codegen.CodeGenerator.loadExpression(CodeGenerator.java:833)
at jdk.nashorn.internal.codegen.CodeGenerator.loadExpressionAsType(CodeGenerator.java:828)
at jdk.nashorn.internal.codegen.CodeGenerator$9.loadValue(CodeGenerator.java:2539)
at jdk.nashorn.internal.codegen.CodeGenerator$9.loadValue(CodeGenerator.java:2535)
at jdk.nashorn.internal.codegen.ObjectCreator.loadTuple(ObjectCreator.java:159)
at jdk.nashorn.internal.codegen.FieldObjectCreator.putField(FieldObjectCreator.java:188)
at jdk.nashorn.internal.codegen.FieldObjectCreator.populateRange(FieldObjectCreator.java:153)
at jdk.nashorn.internal.codegen.ObjectCreator.makeObject(ObjectCreator.java:82)
at jdk.nashorn.internal.codegen.CodeGenerator.loadObjectNode(CodeGenerator.java:2547)
at jdk.nashorn.internal.codegen.CodeGenerator$2.enterObjectNode(CodeGenerator.java:1187)
at jdk.nashorn.internal.ir.ObjectNode.accept(ObjectNode.java:78)
at jdk.nashorn.internal.ir.LexicalContextNode$Acceptor.accept(LexicalContextNode.java:57)
at jdk.nashorn.internal.ir.ObjectNode.accept(ObjectNode.java:73)
at jdk.nashorn.internal.codegen.CodeGenerator.loadExpression(CodeGenerator.java:857)
at jdk.nashorn.internal.codegen.CodeGenerator.loadExpression(CodeGenerator.java:833)
at jdk.nashorn.internal.codegen.CodeGenerator.loadExpressionUnbounded(CodeGenerator.java:568)
at jdk.nashorn.internal.codegen.CodeGenerator.enterReturnNode(CodeGenerator.java:2617)
at jdk.nashorn.internal.ir.ReturnNode.accept(ReturnNode.java:85)
at jdk.nashorn.internal.ir.Node.accept(Node.java:286)
at jdk.nashorn.internal.ir.Block.accept(Block.java:236)
at jdk.nashorn.internal.ir.LexicalContextNode$Acceptor.accept(LexicalContextNode.java:57)
at jdk.nashorn.internal.ir.Block.accept(Block.java:507)
at jdk.nashorn.internal.ir.FunctionNode.accept(FunctionNode.java:405)
at jdk.nashorn.internal.ir.LexicalContextNode$Acceptor.accept(LexicalContextNode.java:57)
at jdk.nashorn.internal.ir.LexicalContextExpression.accept(LexicalContextExpression.java:47)
at jdk.nashorn.internal.ir.FunctionNode.accept(FunctionNode.java:57)
at jdk.nashorn.internal.codegen.CompilationPhase.transformFunction(CompilationPhase.java:618)
at jdk.nashorn.internal.codegen.CompilationPhase$BytecodeGenerationPhase.transform(CompilationPhase.java:424)
... 80 more
Caused by: java.lang.ClassNotFoundException: org.openjdk.nashorn.internal.objects.NativeArray
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:375)
at jdk.nashorn.internal.codegen.types.Type.lambda$typeFor$0(Type.java:253)
... 135 more

any idea?

@etinquis
Copy link

etinquis commented Dec 30, 2023

This and any other string-based references to class paths is my guess. I doubt jarjar will be modifying any strings like that, so short of patching the nashorn code directly I don't really see a workaround with this jarjar renaming method.

My use case is admittedly simple right now: I'm essentially just returning a response that references a single field in the request, so it seems it's not a suitable workaround for anything much more complex than that.

EDIT:
example of a template that's working for me:

        "httpResponseTemplate": {
            "templateType": "JAVASCRIPT",
            "template": "const matches = JSON.parse(request.body).signup.email.match(/^(\\d+).([^@]+)@test/); return { statusCode: parseInt(matches[1]), headers: { 'access-control-allow-origin': '*', 'access-control-allow-methods': 'POST' }, body: { type: 'JSON', json: { error: { code: matches[2] } } } }"
        }

@eilon-shai
Copy link

eilon-shai commented Dec 31, 2023

OK, got it, thank you
does an integrated solution in mockserver is planned?

@eilon-shai
Copy link

eilon-shai commented Feb 1, 2024

HI, ok so I manually created a version of nashorn with the relevant packages changes and added to the mockserver
dependencies lib, I am not getting the ClassNotFoundException but when the actual parse is done I am getting:

Caused by: :3 SyntaxError: Invalid JSON: :1:0 Expected json literal but found u
undefined

this the template I am using:

req = JSON.parse(request.body.json).data[0].siteSyncRecord; return {statusCode:200,headers:{'Content-Type':['application/json']},body:{data:[{siteSyncRecord:{externalId:req.externalId,accountId:req.accountId,displayName:req.displayName,internalId:req.externalId-3252}}]}}

and the request is:

{
"method" : "....",
"path" : "...",
"headers" : {
...
},
...
"body" : {
"contentType" : "application/json",
"type" : "JSON",
"json" : {
"data" : [ {
"siteSyncRecord" : {
"externalId" : 693137481,
"accountId" : 123,
"displayName" : "123.com",
"internalId" : null
}
} ]
}
}
}

full stacktrace:

at org.mockserver.templates.engine.javascript.JavaScriptTemplateEngine.executeTemplate(JavaScriptTemplateEngine.java:109)
at org.mockserver.mock.action.http.HttpResponseTemplateActionHandler.handle(HttpResponseTemplateActionHandler.java:50)
at org.mockserver.mock.action.http.HttpActionHandler.lambda$null$3(HttpActionHandler.java:113)
at org.mockserver.mock.action.http.HttpActionHandler.handleAnyException(HttpActionHandler.java:340)
at org.mockserver.mock.action.http.HttpActionHandler.lambda$processAction$4(HttpActionHandler.java:112)
at org.mockserver.scheduler.Scheduler.run(Scheduler.java:94)
at org.mockserver.scheduler.Scheduler.schedule(Scheduler.java:120)
at org.mockserver.mock.action.http.HttpActionHandler.processAction(HttpActionHandler.java:112)
at org.mockserver.netty.HttpRequestHandler.channelRead0(HttpRequestHandler.java:189)
at org.mockserver.netty.HttpRequestHandler.channelRead0(HttpRequestHandler.java:51)
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:99)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:436)
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:251)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
at org.mockserver.dashboard.DashboardWebSocketHandler.channelRead(DashboardWebSocketHandler.java:137)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
at org.mockserver.netty.websocketregistry.CallbackWebSocketServerHandler.channelRead(CallbackWebSocketServerHandler.java:57)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:436)
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:346)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:318)
at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:251)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:788)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562)
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at java.base/java.lang.Thread.run(Thread.java:840)
Caused by: :3 SyntaxError: Invalid JSON: :1:0 Expected json literal but found u
undefined
^
at jdk.nashorn.internal.runtime.ECMAErrors.error(ECMAErrors.java:57)
at jdk.nashorn.internal.runtime.ECMAErrors.syntaxError(ECMAErrors.java:159)
at jdk.nashorn.internal.runtime.ECMAErrors.syntaxError(ECMAErrors.java:144)
at jdk.nashorn.internal.runtime.JSONFunctions.parse(JSONFunctions.java:74)
at jdk.nashorn.internal.objects.NativeJSON.parse(NativeJSON.java:104)
at jdk.nashorn.internal.scripts.Script$Recompilation$2$^eval_.handle(:3)
at jdk.nashorn.internal.scripts.Script$Recompilation$1$304A$^eval_.serialise(:4)
at jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:648)
at jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:513)
at jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:520)
at jdk.nashorn.api.scripting.ScriptObjectMirror.call(ScriptObjectMirror.java:111)
at org.mockserver.templates.engine.javascript.JavaScriptTemplateEngine.executeTemplate(JavaScriptTemplateEngine.java:69)
... 58 more
Caused by: jdk.nashorn.internal.runtime.ParserException: :1:0 Expected json literal but found u
undefined
^
at jdk.nashorn.internal.parser.JSONParser.error(JSONParser.java:529)
at jdk.nashorn.internal.parser.JSONParser.error(JSONParser.java:533)
at jdk.nashorn.internal.parser.JSONParser.expectedError(JSONParser.java:541)
at jdk.nashorn.internal.parser.JSONParser.parseLiteral(JSONParser.java:182)
at jdk.nashorn.internal.parser.JSONParser.parse(JSONParser.java:148)
at jdk.nashorn.internal.runtime.JSONFunctions.parse(JSONFunctions.java:72)
... 66 more

any idea?
(same is working with previous mockserver version on amd machine)

@eilon-shai
Copy link

Hi, I manage to overcome the issue above, I had to update the json template.
after adding the refactored nashorn jar and dependencies and building the docker image on top arm64 image
(arm64v8/amazoncorretto:17-alpine3.19)
I had to do the following change:

my request structure is:

`{

"body": {
"contentType": "application/json",
"type": "JSON",
"json": {
"data": [
{
"siteSyncRecord": {
"externalId": 693137481,
"accountId": 123,
"displayName": "123.com",
"internalId": null
}
}
]
}
}
}`

the original template (that was working in version 5.5.4:

"httpResponseTemplate": { "template": "req = JSON.parse(request.body.json).data[0].siteSyncRecord; return {statusCode:200,headers:{'Content-Type':['application/json']},body:{data:[{siteSyncRecord:{externalId:req.externalId,accountId:req.accountId,displayName:req.displayName,internalId:req.externalId-3252}}]}}", "templateType": "JAVASCRIPT" }

the updated one:

"httpResponseTemplate": { "template": "req=JSON.parse(request.body).data[0].siteSyncRecord; return {'statusCode':200,'headers':{'Content-Type':['application/json']},'body':{data:[{siteSyncRecord:{'externalId':req.externalId,'accountId':req.accountId,'displayName':req.displayName,'internalId':req.externalId-3252}}]}}", "templateType": "JAVASCRIPT" }

hope it will help others, thanks

@opalenet-adrien
Copy link

Hi! I have the same issue for the following expectation:

  {
    "httpRequest": {
      "method": "GET",
      "path": "/some/click"
    },
    "httpResponseTemplate": {
      "template": "return { statusCode: 301, headers: { 'Location': [ 'http://domain.test?token=' + (request.queryStringParameters['token'] && request.queryStringParameters['token'][0]) ] } };",
      "templateType": "JAVASCRIPT"
    }
  }
With the same error in logs
2024-08-05 19:11:51 5.15.0 INFO 80 jdk/nashorn/api/scripting/ClassFilter 
2024-08-05T19:11:51.879373497Z java.lang.NoClassDefFoundError: jdk/nashorn/api/scripting/ClassFilter
2024-08-05T19:11:51.879376867Z 	at org.mockserver.mock.action.http.HttpResponseTemplateActionHandler.getJavaScriptTemplateEngine(HttpResponseTemplateActionHandler.java:68)
2024-08-05T19:11:51.879379583Z 	at org.mockserver.mock.action.http.HttpResponseTemplateActionHandler.handle(HttpResponseTemplateActionHandler.java:41)
2024-08-05T19:11:51.879382138Z 	at org.mockserver.mock.action.http.HttpActionHandler.lambda$null$3(HttpActionHandler.java:113)
2024-08-05T19:11:51.879384687Z 	at org.mockserver.mock.action.http.HttpActionHandler.handleAnyException(HttpActionHandler.java:340)
2024-08-05T19:11:51.879387287Z 	at org.mockserver.mock.action.http.HttpActionHandler.lambda$processAction$4(HttpActionHandler.java:112)
2024-08-05T19:11:51.879389839Z 	at org.mockserver.scheduler.Scheduler.run(Scheduler.java:94)
2024-08-05T19:11:51.879391349Z 	at org.mockserver.scheduler.Scheduler.schedule(Scheduler.java:120)
2024-08-05T19:11:51.879392858Z 	at org.mockserver.mock.action.http.HttpActionHandler.processAction(HttpActionHandler.java:112)
2024-08-05T19:11:51.879394372Z 	at org.mockserver.netty.HttpRequestHandler.channelRead0(HttpRequestHandler.java:189)
2024-08-05T19:11:51.879395954Z 	at org.mockserver.netty.HttpRequestHandler.channelRead0(HttpRequestHandler.java:51)
2024-08-05T19:11:51.879399582Z 	at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:99)
2024-08-05T19:11:51.879401182Z 	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
2024-08-05T19:11:51.879402792Z 	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
2024-08-05T19:11:51.879404364Z 	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
2024-08-05T19:11:51.879420209Z 	at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:436)
2024-08-05T19:11:51.879422262Z 	at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
2024-08-05T19:11:51.879423823Z 	at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:251)
2024-08-05T19:11:51.879425348Z 	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442)
2024-08-05T19:11:51.879428073Z 	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
2024-08-05T19:11:51.879429674Z 	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
2024-08-05T19:11:51.879431257Z 	at org.mockserver.dashboard.DashboardWebSocketHandler.channelRead(DashboardWebSocketHandler.java:137)
2024-08-05T19:11:51.879433076Z 	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
2024-08-05T19:11:51.879435581Z 	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
2024-08-05T19:11:51.879438257Z 	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
2024-08-05T19:11:51.879440406Z 	at org.mockserver.netty.websocketregistry.CallbackWebSocketServerHandler.channelRead(CallbackWebSocketServerHandler.java:57)
2024-08-05T19:11:51.879442450Z 	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
2024-08-05T19:11:51.879444315Z 	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
2024-08-05T19:11:51.879446368Z 	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
2024-08-05T19:11:51.879448443Z 	at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
2024-08-05T19:11:51.879450730Z 	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
2024-08-05T19:11:51.879452734Z 	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
2024-08-05T19:11:51.879454947Z 	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
2024-08-05T19:11:51.879457129Z 	at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
2024-08-05T19:11:51.879459768Z 	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
2024-08-05T19:11:51.879461848Z 	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
2024-08-05T19:11:51.879463911Z 	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
2024-08-05T19:11:51.879470046Z 	at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
2024-08-05T19:11:51.879472976Z 	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
2024-08-05T19:11:51.879475503Z 	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
2024-08-05T19:11:51.879478370Z 	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
2024-08-05T19:11:51.879480808Z 	at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:436)
2024-08-05T19:11:51.879483268Z 	at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:346)
2024-08-05T19:11:51.879485920Z 	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:318)
2024-08-05T19:11:51.879488052Z 	at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:251)
2024-08-05T19:11:51.879491427Z 	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442)
2024-08-05T19:11:51.879493978Z 	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
2024-08-05T19:11:51.879496054Z 	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
2024-08-05T19:11:51.879498261Z 	at org.mockserver.netty.unification.PortUnificationHandler.switchToHttp(PortUnificationHandler.java:335)
2024-08-05T19:11:51.879500954Z 	at org.mockserver.netty.unification.PortUnificationHandler.decode(PortUnificationHandler.java:173)
2024-08-05T19:11:51.879503702Z 	at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:529)
2024-08-05T19:11:51.879506148Z 	at io.netty.handler.codec.ReplayingDecoder.callDecode(ReplayingDecoder.java:366)
2024-08-05T19:11:51.879508394Z 	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:290)
2024-08-05T19:11:51.879510322Z 	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
2024-08-05T19:11:51.879512612Z 	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
2024-08-05T19:11:51.879514455Z 	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
2024-08-05T19:11:51.879516376Z 	at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
2024-08-05T19:11:51.879518536Z 	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440)
2024-08-05T19:11:51.879521575Z 	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
2024-08-05T19:11:51.879524307Z 	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
2024-08-05T19:11:51.879530341Z 	at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166)
2024-08-05T19:11:51.879533497Z 	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:788)
2024-08-05T19:11:51.879536384Z 	at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724)
2024-08-05T19:11:51.879538613Z 	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650)
2024-08-05T19:11:51.879540435Z 	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562)
2024-08-05T19:11:51.879542407Z 	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
2024-08-05T19:11:51.879544752Z 	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
2024-08-05T19:11:51.879546871Z 	at java.base/java.lang.Thread.run(Thread.java:833)
2024-08-05T19:11:51.879549231Z Caused by: java.lang.ClassNotFoundException: jdk.nashorn.api.scripting.ClassFilter
2024-08-05T19:11:51.879551916Z 	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
2024-08-05T19:11:51.879554085Z 	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
2024-08-05T19:11:51.879556731Z 	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
2024-08-05T19:11:51.879559006Z 	... 67 more

@jakenieto
Copy link

Hi! I also have the same issue, with the exact same stack trace. For now I just had to switch to using the velocity templates and they seem to be stable with the latest docker image (5.15.0). Do we know when this may be resolved?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants