Uploaded image for project: 'Synapse'
  1. Synapse
  2. SYNAPSE-932

Class Loading issue in Script Mediator

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.1
    • 3.0.0
    • Extension Mediators
    • None
    • Any

    Description

      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.

      Attachments

        1. SYNAPSE-932.patch
          8 kB
          Malith Dhanushka

        Activity

          People

            uswick Udayanga Shaminda Wickramasinghe
            malith Malith Dhanushka
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: