gpt4 book ai didi

javascript - 大负载上的 WSO2ESB js 脚本调解器错误

转载 作者:行者123 更新时间:2023-11-30 00:04:16 28 4
gpt4 key购买 nike

我有一个 seq (WSO2ESb 4.9) 调用 REST 并接收 JSON。然后我通过脚本中介 (JS) 将 JSON 映射到 XML,这是我的配置:

<case regex="urn:mta:navigation:getMarshes">
<property xmlns:ns="http://ws.apache.org/ns/synapse" name="uri.var.service"
value="getMarshes" scope="default" type="STRING" />
<call>
<endpoint key="adapter.navigation.asu.GetData.Endpoint" />
</call>
<script language="js"><![CDATA[
var array = mc.getPayloadJSON();
var payload = <getMarshesRS/>;

for (i = 0; i < array.length; ++i) {
var elem = array[i];
payload.Marshes += <marsh id={elem.mr_id} num={elem.mr_num} title={elem.mr_title} note={elem.mr_note} mt_id={elem.mrt_id} />
}
mc.setPayloadXML(payload);
]]></script>
</case>

如果我从 REST 服务接收到的对象不多(例如 10 个),它工作正常。但是如果我收到了1280个对象,我就异常了

[2016-08-23 16:31:35,799] ERROR - Uncaught exception {org.apache.axis2.transport.base.threads.NativeWorkerPool} java.lang.ClassFormatError: Invalid method Code length 186472 in class file org/mozilla/javascript/gen/c187 at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:763) at org.mozilla.javascript.DefiningClassLoader.defineClass(DefiningClassLoader.java:62) at org.mozilla.javascript.optimizer.Codegen.defineClass(Codegen.java:126) at org.mozilla.javascript.optimizer.Codegen.createScriptObject(Codegen.java:81) at org.mozilla.javascript.Context.compileImpl(Context.java:2361) at org.mozilla.javascript.Context.compileReader(Context.java:1310) at org.mozilla.javascript.Context.compileReader(Context.java:1282) at org.mozilla.javascript.Context.evaluateReader(Context.java:1224) at com.sun.phobos.script.javascript.RhinoScriptEngine.eval(RhinoScriptEngine.java:172) at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:249) at org.apache.synapse.mediators.bsf.ScriptMediator.processJSONPayload(ScriptMediator.java:322) at org.apache.synapse.mediators.bsf.ScriptMediator.mediateForInlineScript(ScriptMediator.java:294) at org.apache.synapse.mediators.bsf.ScriptMediator.invokeScript(ScriptMediator.java:239) at org.apache.synapse.mediators.bsf.ScriptMediator.mediate(ScriptMediator.java:207) at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:81) at org.apache.synapse.mediators.filters.SwitchMediator.mediate(SwitchMediator.java:178) at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:267) at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.mediateFromContinuationStateStack(Axis2SynapseEnvironment.java:679) at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:244) at org.apache.synapse.core.axis2.SynapseCallbackReceiver.handleMessage(SynapseCallbackReceiver.java:529) at org.apache.synapse.core.axis2.SynapseCallbackReceiver.receive(SynapseCallbackReceiver.java:172) at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180) at org.apache.synapse.transport.passthru.ClientWorker.run(ClientWorker.java:247) at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745)

这是一个错误吗?

最佳答案

ESB 中有一个错误,您无法使用脚本中介程序处理大量有效负载,这是来自 underline Rhino 引擎。以下是为此的 JIRA。但是您的堆栈跟踪有些不同。

https://wso2.org/jira/browse/ESBJAVA-4834

关于javascript - 大负载上的 WSO2ESB js 脚本调解器错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39102746/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com