2014-02-26 35 views
0

我試圖編輯與腳本中介的有效載荷,但它給這個錯誤:腳本中介給「內容識別爲空」的錯誤

TID: [0] [ESB] [2014-02-26 11:55:31,709] ERROR {org.apache.axis2.transport.base.threads.NativeWorkerPool} - Uncaught exception {org.apache.axis2.transport.base.threads.NativeWorkerPool} 
java.lang.RuntimeException: ContentID is null 
    at org.apache.axiom.om.impl.llom.OMTextImpl.getDataHandler(OMTextImpl.java:360) 
    at org.apache.synapse.mediators.bsf.ScriptMediator.prepareExternalScript(ScriptMediator.java:366) 
    at org.apache.synapse.mediators.bsf.ScriptMediator.mediateWithExternalScript(ScriptMediator.java:244) 
    at org.apache.synapse.mediators.bsf.ScriptMediator.invokeScript(ScriptMediator.java:212) 
    at org.apache.synapse.mediators.bsf.ScriptMediator.mediate(ScriptMediator.java:187) 
    at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:71) 
    at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:114) 
    at org.apache.synapse.core.axis2.ProxyServiceMessageReceiver.receive(ProxyServiceMessageReceiver.java:154) 
    at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180) 
    at org.apache.synapse.transport.passthru.ServerWorker.processEntityEnclosingRequest(ServerWorker.java:434) 
    at org.apache.synapse.transport.passthru.ServerWorker.run(ServerWorker.java:219) 
    at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172) 
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) 
    at java.lang.Thread.run(Thread.java:722) 

代碼:

<script language="js" key="conf:SecHeaderGenerator.js" function="getBodyWithSecHeader" /> 

的JavaScript文件:

function getBodyWithSecHeader(mc) 
{ 
    var body = mc.getPayloadXML(); 

    var time = new Date().format("yyyy-MM-dd'T'HH:mm:ss+0300"); 
    var user = 'user'; 
    var domain = 'testdomain'; 
    var password = 'pass'; 
    var encoded = hex_md5(time + hex_md5(password)).toLowerCase(); 

    mc.setPayloadXML(
    <set_message_status> 
     <user> 
     <now>{time}</now> 
     <login>{user}</login> 
     <company>{domain}</company> 
     <auth_string>{encoded}</auth_string> 
     </user> 
     {body} 
    </set_message_status>); 

    return mc.getPayloadXML(); 
} 
[...] 

爲什麼會發生此錯誤? 我正在使用WSO2 ESB 4.6.0。

UPDATE

試圖正好與ESB的另一個副本具有相同的版本相同的情況下,它正常工作。

+0

是的..我也有同樣的感覺.WO2O2 ESB不是一個可靠的產品 – Kaliappan

回答

1

我找到了解決方案。問題是javascript文件的媒體類型是text/plain而不是application/javascript