我有一个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]错误 - 未捕获异常{org.apache.axis2.transport.base.threads.NativeWorkerPool} java.lang.ClassFormatError:无效方法类文件中的代码长度为186472 org / mozilla / javascript / gen / c187 at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:763) 在org.mozilla.javascript.DefiningClassLoader.defineClass(DefiningClassLoader.java:62) 在org.mozilla.javascript.optimizer.Codegen.defineClass(Codegen.java:126) 在org.mozilla.javascript.optimizer.Codegen.createScriptObject(Codegen.java:81) 在org.mozilla.javascript.Context.compileImpl(Context.java:2361) 在org.mozilla.javascript.Context.compileReader(Context.java:1310) 在org.mozilla.javascript.Context.compileReader(Context.java:1282) 在org.mozilla.javascript.Context.evaluateReader(Context.java:1224) 在com.sun.phobos.script.javascript.RhinoScriptEngine.eval(RhinoScriptEngine.java:172) 在javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:249) 在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) 在org.apache.synapse.mediators.bsf.ScriptMediator.mediate(ScriptMediator.java:207) 在org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:81) 在org.apache.synapse.mediators.filters.SwitchMediator.mediate(SwitchMediator.java:178) 在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) 在org.apache.synapse.core.axis2.SynapseCallbackReceiver.handleMessage(SynapseCallbackReceiver.java:529) 在org.apache.synapse.core.axis2.SynapseCallbackReceiver.receive(SynapseCallbackReceiver.java:172) 在org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180) 在org.apache.synapse.transport.passthru.ClientWorker.run(ClientWorker.java:247) 在org.apache.axis2.transport.base.threads.NativeWorkerPool $ 1.run(NativeWorkerPool.java:172) 在java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:617) 在java.lang.Thread.run(Thread.java:745)
这是一个错误吗?