首页 文章

WSO2AM 1.5中的脚本介体错误

提问于
浏览
0

I try to add a sequence which contains a java script mediator as below :

"<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>"
  • Howerver,it occurs a error once I press the Update Button,the whole function stack is shown in the log, I check the jar "bsf-all,3.0.0.wso2v2" and it really contains the missing class and the jar is shown in the bundles info "bsf-all,3.0.0.wso2v2,../plugins/bsf-all_3.0.0.wso2v2.jar,4,true" :* “ com/sun/phobos/script/javascript/RhinoScriptEngineFactory java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39 )在...... Caused by: java.lang.NoClassDefFoundError: com/sun/phobos/script/javascript/RhinoScriptEngineFactory 在org.apache.synapse.mediators.bsf.ScriptMediator.initScriptEngine(ScriptMediator.java:475)在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)在org.apache.synapse.config .gml.AbstractMediatorFactory.createMediator(AbstractMediatorFactory.java:91)org.apache.synapse.config.xml.MediatorFactoryFinder.getMediator(MediatorFactoryFinder.java:223)org.apache.synapse.config.xml.AbstractListMediatorFactory.addChildren(AbstractListMediatorFactory) .java:41)在org.apache.synapse . config.xml.SequenceMediatorFactory.createSpecificMediator(SequenceMediatorFactory.java:87)在org.apache.synapse.config.xml.AbstractMediatorFactory.createMediator(AbstractMediatorFactory.java:91)在org.wso2.carbon.mediation.configadmin.ConfigurationValidator.validateSequence(在org.wso2.carbon.mediation.configadmin.ConfigAdmin.validateConfiguration(ConfigAdmin.java:180)的org.wso2.carbon.mediation.configadmin.ConfigurationValidator.validate(ConfigurationValidator.java:73)上的ConfigurationValidator.java:90).. 61更 Caused by: 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更多“

I look up the solution about the same issue you given to other person https://wso2.org/jira/browse/ESBJAVA-1685 but it doesn't take effect.And I search Google for the question for a long time ,someone said the error has been fixxed or it is something wrong with OSGI Frame when it sets up,but others has the same problem with me still stick in it , so please give us a complete solution about how to use script mediator in WSO2 AM 1.5,tks a lot !

1 回答

  • 0

    我们用来提供脚本引擎的bsf jar有一个问题 . 作为另一种方法,你可以使用enrich / payload工厂中介来实现上述任务

相关问题