synapse-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rajith Attapattu" <rajit...@gmail.com>
Subject Script mediator problem
Date Fri, 06 Jul 2007 03:11:56 GMT
When I use the script mediator (java script) I got the following error.
Has anybody seen this before?
I have also pasted my synapse.xml.

Regards,
Rajith

Caused by: org.mozilla.javascript.WrappedException: Wrapped
org.apache.axiom.om.OMException: The given child is not of type class
org.apache.axiom.om.impl.dom.ChildNode (<Unknown Source>#4)
    at org.mozilla.javascript.Context.throwAsScriptRuntimeEx(Context.java
:1693)
    at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:160)
    at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java
:204)
    at org.mozilla.javascript.optimizer.OptRuntime.call1(OptRuntime.java:66)
    at org.mozilla.javascript.gen.c9._c0(<Unknown Source>:4)
    at org.mozilla.javascript.gen.c9.call(<Unknown Source>)
    at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java
:340)
    at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java
:2758)
    at org.mozilla.javascript.gen.c9.call(<Unknown Source>)
    at org.mozilla.javascript.gen.c9.exec(<Unknown Source>)
    at com.sun.phobos.script.javascript.RhinoCompiledScript.eval(
RhinoCompiledScript.java:55)
    ... 37 more
Caused by: org.apache.axiom.om.OMException: The given child is not of type
class org.apache.axiom.om.impl.dom.ChildNode
    at org.apache.axiom.om.impl.dom.ChildNode.insertSiblingAfter(
ChildNode.java:160)
    at org.apache.synapse.mediators.bsf.ScriptMessageContext.setPayloadXML(
ScriptMessageContext.java:80)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(
NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(
DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:145)


------------------------------------------------------------------------------------------------------------
<definitions xmlns="http://ws.apache.org/ns/synapse">

   <!-- message transformation -->

    <sequence name="main">
    <log level="full"/>
    <script language="js"><![CDATA[
               var symbol = mc.getPayloadXML()..*::ticker.toString();
               var price = mc.getPayloadXML()..*::value.toString();
               mc.setPayloadXML(
                  <m:stockQuote xmlns:m="http://redhat.com/sample">
                     <m:price>{price}</m:price>
                     <m:symbol>{symbol}</m:symbol>
                  </m:stockQuote>);
        ]]></script>
        <send/>
    </sequence>

</definitions>


 <!-- Will transform the message as follows

 <m:quote xmlns:m="http://redhat.com/sample">
    <m:ticker>RHT</m:ticker>
    <m:value>125</m:value>
 </m:quote>

 <m:stockQuote xmlns:m="http://redhat.com/sample">
    <m:symbol>RHT</m:symbol>
    <m:price>125</m:price>
 </m:stockQuote>

 -->

Mime
View raw message