getsandbox / worker-cli

Sandbox Worker is the core processing component of the Sandbox product
https://getsandbox.com
230 stars 62 forks source link

"Method code too large!" error while running app #20

Closed gitomato closed 8 years ago

gitomato commented 8 years ago

Hello,

I tried using the latest release.

$ wget https://s3.amazonaws.com/sandbox-binaries/runtime-binary.tar
$ tar xvf runtime-binary.tar
$ ./sandbox run
Sandbox ready (build: v1.0.183-479b880 runtime: VERSION_2) --  Running on port: 8080 with path: '/home/xxx'

When I browsing the app at http://localhost:8080/ I get this error:

{"errors":[{"message":"Method code too large!"}]}

The stack trace is:

Error processing request
java.lang.RuntimeException: Method code too large!
    at jdk.internal.org.objectweb.asm.MethodWriter.getSize(MethodWriter.java:2065) ~[na:1.8.0_45]
    at jdk.internal.org.objectweb.asm.ClassWriter.toByteArray(ClassWriter.java:856) ~[na:1.8.0_45]
    at jdk.nashorn.internal.codegen.ClassEmitter.toByteArray(ClassEmitter.java:669) ~[nashorn.jar:na]
    at jdk.nashorn.internal.codegen.CompilationPhase$13.transform(CompilationPhase.java:498) ~[nashorn.jar:na]
    at jdk.nashorn.internal.codegen.CompilationPhase.apply(CompilationPhase.java:728) ~[nashorn.jar:na]
    at jdk.nashorn.internal.codegen.Compiler.compile(Compiler.java:620) ~[nashorn.jar:na]
    at jdk.nashorn.internal.runtime.RecompilableScriptFunctionData.compileTypeSpecialization(RecompilableScriptFunctionData.java:513) ~[nashorn.jar:na]
    at jdk.nashorn.internal.runtime.RecompilableScriptFunctionData.getBest(RecompilableScriptFunctionData.java:730) ~[nashorn.jar:na]
    at jdk.nashorn.internal.runtime.ScriptFunctionData.getBestInvoker(ScriptFunctionData.java:232) ~[nashorn.jar:na]
    at jdk.nashorn.internal.runtime.ScriptFunction.findCallMethod(ScriptFunction.java:586) ~[nashorn.jar:na]
    at jdk.nashorn.internal.runtime.ScriptObject.lookup(ScriptObject.java:1872) ~[nashorn.jar:na]
    at jdk.nashorn.internal.runtime.linker.NashornLinker.getGuardedInvocation(NashornLinker.java:100) ~[nashorn.jar:na]
    at jdk.nashorn.internal.runtime.linker.NashornLinker.getGuardedInvocation(NashornLinker.java:94) ~[nashorn.jar:na]
    at jdk.internal.dynalink.support.CompositeTypeBasedGuardingDynamicLinker.getGuardedInvocation(CompositeTypeBasedGuardingDynamicLinker.java:176) ~[nashorn.jar:na]
    at jdk.internal.dynalink.support.CompositeGuardingDynamicLinker.getGuardedInvocation(CompositeGuardingDynamicLinker.java:124) ~[nashorn.jar:na]
    at jdk.internal.dynalink.support.LinkerServicesImpl.getGuardedInvocation(LinkerServicesImpl.java:149) ~[nashorn.jar:na]
    at jdk.internal.dynalink.DynamicLinker.relink(DynamicLinker.java:233) ~[nashorn.jar:na]
    at jdk.nashorn.internal.scripts.Script$Recompilation$80$140A$faker.L:2(faker.js:5) ~[na:na]
    at jdk.nashorn.internal.scripts.Script$79$faker.:program(faker.js:2) ~[na:na]
    at jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:636) ~[nashorn.jar:na]
    at jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:229) ~[nashorn.jar:na]
    at jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:387) ~[nashorn.jar:na]
    at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:437) ~[nashorn.jar:na]
    at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:401) ~[nashorn.jar:na]
    at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:397) ~[nashorn.jar:na]
    at jdk.nashorn.api.scripting.NashornScriptEngine.eval(NashornScriptEngine.java:152) ~[nashorn.jar:na]
    at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:233) ~[na:1.8.0_45]
    at com.sandbox.runtime.js.services.JSEngineService.loadAndSealScript(JSEngineService.java:167) ~[sandbox:na]
    at com.sandbox.runtime.js.services.JSEngineService.injectLibrariesV2(JSEngineService.java:153) ~[sandbox:na]
    at com.sandbox.runtime.js.services.JSEngineService.injectLibraries(JSEngineService.java:119) ~[sandbox:na]
    at com.sandbox.runtime.js.services.JSEngineService.createEngine(JSEngineService.java:71) ~[sandbox:na]
    at com.sandbox.runtime.js.services.JSEngineService.createOrGetEngine(JSEngineService.java:60) ~[sandbox:na]
    at com.sandbox.runtime.js.services.ServiceManager.createService(ServiceManager.java:81) ~[sandbox:na]
    at com.sandbox.runtime.js.services.ServiceManager.getService(ServiceManager.java:77) ~[sandbox:na]
    at com.sandbox.runtime.HttpRequestHandler.handle(HttpRequestHandler.java:97) ~[sandbox:na]
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97) [sandbox:na]
    at org.eclipse.jetty.server.Server.handle(Server.java:499) [sandbox:na]
    at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:310) [sandbox:na]
    at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257) [sandbox:na]
    at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540) [sandbox:na]
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635) [sandbox:na]
    at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555) [sandbox:na]
    at java.lang.Thread.run(Thread.java:745) [na:1.8.0_45]

Do you have any clue on how to fix this?

nhoughto commented 8 years ago

You are using Java8up45, try up72+, there is a bug in the older version that can cause a "Method code too large" error..

gitomato commented 8 years ago

Thank you! I will try this.