[prev in list] [next in list] [prev in thread] [next in thread] 

List:       synapse-dev
Subject:    [jira] [Commented] (SYNAPSE-932) Class Loading issue in Script Mediator
From:       "Malith Dhanushka (JIRA)" <jira () apache ! org>
Date:       2013-04-24 12:33:15
Message-ID: JIRA.12644341.1366805121612.215742.1366806795314 () arcas
[Download RAW message or body]


    [ https://issues.apache.org/jira/browse/SYNAPSE-932?page=com.atlassian.jira.plugin \
.system.issuetabpanels:comment-tabpanel&focusedCommentId=13640382#comment-13640382 ] 

Malith Dhanushka commented on SYNAPSE-932:
------------------------------------------

Reason for the issue is external dependencies inside 'template/lib'  are not visible \
for the Rhino engine (because it loads with the default Rhino context). So fixed it \
by setting up class loader specifically for Rhino engine context, within script \
mediator. Attaching patch Please review & commit.

Thanks,
Malith
                
> Class Loading issue in Script Mediator
> --------------------------------------
> 
> Key: SYNAPSE-932
> URL: https://issues.apache.org/jira/browse/SYNAPSE-932
> Project: Synapse
> Issue Type: Bug
> Components: Extension Mediators
> Affects Versions: 2.1
> Environment: Any
> Reporter: Malith Dhanushka
> Fix For: FUTURE
> 
> Attachments: SYNAPSE-932.patch
> 
> 
> An exception similar to the following is triggered when using jars inside \
> 'template/lib' using the script mediator. ERROR ScriptMediator The script engine \
>                 returned an error executing the inlined js script function mediate
> com.sun.phobos.script.util.ExtendedScriptException: \
> org.mozilla.javascript.EcmaError: ReferenceError: "FedexTrackingClient" is not \
> defined. (<Unknown Source>#11) in <Unknown Source> at line number 11 at \
> com.sun.phobos.script.javascript.RhinoCompiledScript.eval(RhinoCompiledScript.java:68)
>  at javax.script.CompiledScript.eval(CompiledScript.java:75)
> at org.apache.synapse.mediators.bsf.ScriptMediator.mediateForInlineScript(ScriptMediator.java:256)
>  at org.apache.synapse.mediators.bsf.ScriptMediator.invokeScript(ScriptMediator.java:205)
>  at org.apache.synapse.mediators.bsf.ScriptMediator.mediate(ScriptMediator.java:178)
>                 
> ...
> Caused by: org.mozilla.javascript.EcmaError: ReferenceError: "FedexTrackingClient" \
> is not defined. (<Unknown Source>#11) at \
> org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3229) at \
> org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3219) at \
> org.mozilla.javascript.ScriptRuntime.notFoundError(ScriptRuntime.java:3292) at \
> org.mozilla.javascript.ScriptRuntime.name(ScriptRuntime.java:1570) at \
> org.mozilla.javascript.gen.c3._c0(<Unknown Source>:11) It seems it is because of \
> external dependencies inside 'template/lib'  are not visible for the Rhino engine.  \
> 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic