WSO2AM 1.5中的脚本介体错误

时间:2014-02-24 02:09:22

标签: wso2 mediator

我尝试添加一个包含java脚本调解器的序列,如下所示:

"<sequence name="response">
    <script language="js">
        mc.setPayloadXML(
        &lt;greeting&gt;Hello World&lt;/greeting&gt;
        );
    </script>
    <header name="To" action="remove"/>
    <property name="messageType" value="application/json" scope="axis2"/>       
    <property name="NO_ENTITY_BODY" scope="axis2" action="remove"/>
    <property name="RESPONSE" value="true"/>
    <send/>
    <log level="full"/>
</sequence>"

* 然后,一旦按下更新按钮就会出现错误,整个功能堆栈显示在日志中,我检查了jar&#34; bsf-all,3.0.0.wso2v2&#34;并且它确实包含缺少的类,并且jar显示在包信息&#34; bsf-all,3.0.0.wso2v2,.. / plugins / bsf-all_3.0.0.wso2v2.jar,4,true&#34 ; :*     &#34; com / sun / phobos / script / javascript / RhinoScriptEngineFactory {org.apache.axis2.rpc.receivers.RPCMessageReceiver}     java.lang.reflect.InvocationTargetException     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)     在 ......     引起:java.lang.NoClassDefFoundError:com / sun / phobos / script / javascript / RhinoScriptEngineFactory     at org.apache.synapse.mediators.bsf.ScriptMediator.initScriptEngine(ScriptMediator.java:475)     at org.apache.synapse.mediators.bsf.ScriptMediator.initInlineScript(ScriptMediator.java:341)     在org.apache.synapse.mediators.bsf.ScriptMediator。(ScriptMediator.java:146)     在org.apache.synapse.mediators.bsf.ScriptMediatorFactory.createSpecificMediator(ScriptMediatorFactory.java:105)     at org.apache.synapse.config.xml.AbstractMediatorFactory.createMediator(AbstractMediatorFactory.java:91)     在org.apache.synapse.config.xml.MediatorFactoryFinder.getMediator(MediatorFactoryFinder.java:223)     at org.apache.synapse.config.xml.AbstractListMediatorFactory.addChildren(AbstractListMediatorFactory.java:41)     at org.apache.synapse.config.xml.SequenceMediatorFactory.createSpecificMediator(SequenceMediatorFactory.java:87)     at org.apache.synapse.config.xml.AbstractMediatorFactory.createMediator(AbstractMediatorFactory.java:91)     at org.wso2.carbon.mediation.configadmin.ConfigurationValidator.validateSequence(ConfigurationValidator.java:90)     在org.wso2.carbon.mediation.configadmin.ConfigurationValidator.validate(ConfigurationValidator.java:73)     在org.wso2.carbon.mediation.configadmin.ConfigAdmin.validateConfiguration(ConfigAdmin.java:180)     ......还有61个     引起:java.lang.ClassNotFoundException:com.sun.phobos.script.javascript.RhinoScriptEngineFactory     在org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:501)     在org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:421)     在org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:412)     atorg.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoa ..     在java.lang.ClassLoader.loadClass(ClassLoader.java:248)     ......还有73个&#34;

我查找有关您向其他人https://wso2.org/jira/browse/ESBJAVA-1685提出的同一问题的解决方案,但它没有生效。我长时间在谷歌搜索这个问题,有人说错误已被修复或OSGI Frame设置时出现问题,但是其他人也遇到同样的问题仍然坚持下去,所以请给我们一个关于如何在WSO2 AM 1.5中使用脚本调解器的完整解决方案,tks很多!

1 个答案:

答案 0 :(得分:0)

我们用来提供脚本引擎的bsf jar存在问题。作为替代方法,您可以使用enrich / payload工厂介体来实现上述任务