Hi All,

We ran in to $subject when trying to use the script mediator in API Manager.

When trying to use script mediator in AM APIs the following error is thrown.

*Caused by: java.lang.NoClassDefFoundError:
com/sun/phobos/script/javascript/RhinoScriptEngineFactory*
* at
org.apache.synapse.mediators.bsf.ScriptMediator.initScriptEngine(ScriptMediator.java:472)*
* at
org.apache.synapse.mediators.bsf.ScriptMediator.initInlineScript(ScriptMediator.java:338)*
* at
org.apache.synapse.mediators.bsf.ScriptMediator.<init>(ScriptMediator.java:148)*


To the best of my understanding, following is whats happening here.

The script mediator depends on the bsf-all_3.0.0.wso2v2, which needs
org.mozilla.javascript; version="1.6.0" or above to function.

Jaggery is built to support org.mozilla.javascript; version="1.7.0" and
above, and the API Manager host object, depends on both jaggery and synapse
to function. When all of this comes together, we believe synapse has a
problem with wiring the correct bundles (package usage conflict), leading
to above quoted error.

To overcome this, there are two options, and both seem to have considerable
consequences

a) Update the BSF jar to use org.mozilla.javascript; version="1.7.0"

b) Update Synapse, restricting it to use org.mozilla.javascript;
version="1.6.0", only and APIM host objects to use 1.7.0 specifically.


Since Option A might require changes to ESB script mediator, as API changes
may be in effect, we went ahead with option (b). This leads to errors in
the API Manager Host objects and the bundle goes in to INSTALLED state. The
following error is thrown, at startup and there are also errors when trying
to invoke the API.

*[2014-05-08 23:56:16,246] ERROR - ModuleManager Error while adding
HostObject : APIStore org.wso2.carbon.apimgt.hostobjects.APIStoreHostObject*
*java.lang.ClassNotFoundException:
org.wso2.carbon.apimgt.hostobjects.APIStoreHostObject*
* at
org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:501)*
* at
org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:421)*


Has anyone encountered such an issue before? How should we go about fixing
this? Your thoughts/ideas/suggestions are welcome.


Thanks and Regards,

Ruwan Yatawara

WSO2 Inc.

email : [email protected]
mobile : +94 77 9110413
blog : http://thoughts.ruwan-ace.com/
www: :http://wso2.com
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to