[Correction]

On Tue, Jul 28, 2015 at 11:52 AM, Viraj Rajaguru <[email protected]> wrote:

> Hi Nuwan,
>
> There is a class loading issue in DevS 3.7.1 on MacOS with Java 7 update
> 55(7u55) and later updates. That's because you are getting the same issue
> irrespective of having CDATA tags or not in the payload.(There shouldn't be
> any issue if you enter the JS script without CDATA tag as Sohani
> mentioned.) Please use Java 7 update 55(7u55) with DevS 3.7.1 on Mac OS to
> avoid this issue.(This issue[1] has been fixed in the DevS master branch)
>

Please use Java 7 update 51(7u51) with DevS 3.7.1 on Mac OS to avoid this
issue

>
> And also we have done an improvement to Script mediator to persist the
> CDATA tag in the source view.[2] This fix is also available in the DevS
> master branch.
>
> Thanks,
> Viraj.
>
> [1] - https://wso2.org/jira/browse/TOOLS-2958
> [2] - https://wso2.org/jira/browse/TOOLS-2730
>
>
> On Tue, Jul 28, 2015 at 8:39 AM, Nuwan Dias <[email protected]> wrote:
>
>> I doubt its due to the CDATA tags. I tried both with and without CDATA
>> tags, but it throws the same error always.
>>
>> I even tried providing the content through the source editor, but saving
>> from the source editor also gives the same error.
>>
>> Please note that an API with the exact configuration can be deployed on
>> ESB 4.8.1 without any issues. However, for the script to execute correctly
>> the CDATA tags are required. If the CDATA tags were missing, it would throw
>> the following exception at runtime (only).
>>
>> *org.mozilla.javascript.EvaluatorException: Can't find method
>> org.apache.synapse.mediators.bsf.ScriptMessageContext.setPayloadXML().*
>>
>> Thanks,
>> NuwanD.
>>
>> On Tue, Jul 28, 2015 at 7:45 AM, Sohani Weerasinghe <[email protected]>
>> wrote:
>>
>>> Hi Jasintha,
>>>
>>> This is the error I am getting
>>>
>>> org.apache.synapse.SynapseException: Exception initializing inline script
>>> at
>>> org.apache.synapse.mediators.bsf.ScriptMediator.initInlineScript(ScriptMediator.java:365)
>>> at
>>> org.apache.synapse.mediators.bsf.ScriptMediator.<init>(ScriptMediator.java:152)
>>> at
>>> org.wso2.developerstudio.eclipse.gmf.esb.internal.persistence.ScriptMediatorTransformer.createScriptMediator(ScriptMediatorTransformer.java:58)
>>> at
>>> org.wso2.developerstudio.eclipse.gmf.esb.internal.persistence.ScriptMediatorTransformer.transformWithinSequence(ScriptMediatorTransformer.java:45)
>>> at
>>> org.wso2.developerstudio.eclipse.gmf.esb.internal.persistence.AbstractEsbNodeTransformer.doTransformWithinSequence(AbstractEsbNodeTransformer.java:118)
>>> at
>>> org.wso2.developerstudio.eclipse.gmf.esb.internal.persistence.SequenceTransformer.transformWithinSequence(SequenceTransformer.java:88)
>>> at
>>> org.wso2.developerstudio.eclipse.gmf.esb.internal.persistence.DefaultEsbModelExporter.transformSequence(DefaultEsbModelExporter.java:193)
>>> at
>>> org.wso2.developerstudio.eclipse.gmf.esb.internal.persistence.DefaultEsbModelExporter.designToSource(DefaultEsbModelExporter.java:349)
>>> at
>>> org.wso2.developerstudio.eclipse.gmf.esb.diagram.part.EsbMultiPageEditor.updateAssociatedXMLFile(EsbMultiPageEditor.java:593)
>>> at
>>> org.wso2.developerstudio.eclipse.gmf.esb.diagram.part.EsbMultiPageEditor.doSave(EsbMultiPageEditor.java:676)
>>> at org.eclipse.ui.internal.SaveableHelper$2.run(SaveableHelper.java:154)
>>> at org.eclipse.ui.internal.SaveableHelper$5.run(SaveableHelper.java:283)
>>> at
>>> org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:466)
>>> at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:374)
>>> at
>>> org.eclipse.ui.internal.WorkbenchWindow$13.run(WorkbenchWindow.java:2157)
>>> at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
>>> at org.eclipse.ui.internal.WorkbenchWindow.run(WorkbenchWindow.java:2153)
>>> at
>>> org.eclipse.ui.internal.SaveableHelper.runProgressMonitorOperation(SaveableHelper.java:291)
>>> at
>>> org.eclipse.ui.internal.SaveableHelper.runProgressMonitorOperation(SaveableHelper.java:269)
>>> at
>>> org.eclipse.ui.internal.SaveableHelper.savePart(SaveableHelper.java:159)
>>> at
>>> org.eclipse.ui.internal.WorkbenchPage.saveSaveable(WorkbenchPage.java:3915)
>>> at
>>> org.eclipse.ui.internal.WorkbenchPage.saveEditor(WorkbenchPage.java:3929)
>>> at
>>> org.eclipse.ui.internal.handlers.SaveHandler.execute(SaveHandler.java:54)
>>> at
>>> org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:294)
>>> at
>>> org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:90)
>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>> at
>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>>> at
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>> at java.lang.reflect.Method.invoke(Method.java:606)
>>> at
>>> org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:55)
>>> at
>>> org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:247)
>>> at
>>> org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:229)
>>> at
>>> org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:132)
>>> at
>>> org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:149)
>>> at org.eclipse.core.commands.Command.executeWithChecks(Command.java:499)
>>> at
>>> org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508)
>>> at
>>> org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:210)
>>> at
>>> org.eclipse.ui.internal.handlers.LegacyHandlerService.executeCommand(LegacyHandlerService.java:343)
>>> at
>>> org.eclipse.ui.internal.actions.CommandAction.runWithEvent(CommandAction.java:159)
>>> at
>>> org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:595)
>>> at
>>> org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:511)
>>> at
>>> org.eclipse.jface.action.ActionContributionItem$6.handleEvent(ActionContributionItem.java:462)
>>> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
>>> at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4454)
>>> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1388)
>>> at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3799)
>>> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3409)
>>> at
>>> org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151)
>>> at
>>> org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
>>> at
>>> org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032)
>>> at
>>> org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148)
>>> at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636)
>>> at
>>> org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
>>> at
>>> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579)
>>> at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
>>> at
>>> org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135)
>>> at
>>> org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
>>> at
>>> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
>>> at
>>> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
>>> at
>>> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)
>>> at
>>> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)
>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>> at
>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>>> at
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>> at java.lang.reflect.Method.invoke(Method.java:606)
>>> at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)
>>> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
>>> at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
>>> at org.eclipse.equinox.launcher.Main.main(Main.java:1438)
>>> Caused by: javax.script.ScriptException:
>>> org.mozilla.javascript.EvaluatorException: illegally formed XML syntax
>>> (<Unknown Source>#14)
>>> at
>>> com.sun.phobos.script.javascript.RhinoScriptEngine.compile(RhinoScriptEngine.java:341)
>>> at
>>> com.sun.phobos.script.javascript.RhinoScriptEngine.compile(RhinoScriptEngine.java:323)
>>> at
>>> org.apache.synapse.mediators.bsf.ScriptMediator.initInlineScript(ScriptMediator.java:354)
>>> ... 68 more
>>> Caused by: org.mozilla.javascript.EvaluatorException: illegally formed
>>> XML syntax (<Unknown Source>#14)
>>> at
>>> org.mozilla.javascript.DefaultErrorReporter.runtimeError(DefaultErrorReporter.java:109)
>>> at
>>> org.mozilla.javascript.DefaultErrorReporter.error(DefaultErrorReporter.java:96)
>>> at org.mozilla.javascript.Parser.addError(Parser.java:140)
>>> at
>>> org.mozilla.javascript.TokenStream.getNextXMLToken(TokenStream.java:1060)
>>> at
>>> org.mozilla.javascript.TokenStream.getFirstXMLToken(TokenStream.java:911)
>>> at org.mozilla.javascript.Parser.xmlInitializer(Parser.java:1607)
>>> at org.mozilla.javascript.Parser.unaryExpr(Parser.java:1584)
>>> at org.mozilla.javascript.Parser.mulExpr(Parser.java:1519)
>>> at org.mozilla.javascript.Parser.addExpr(Parser.java:1500)
>>> at org.mozilla.javascript.Parser.shiftExpr(Parser.java:1480)
>>> at org.mozilla.javascript.Parser.relExpr(Parser.java:1454)
>>> at org.mozilla.javascript.Parser.eqExpr(Parser.java:1410)
>>> at org.mozilla.javascript.Parser.bitAndExpr(Parser.java:1399)
>>> at org.mozilla.javascript.Parser.bitXorExpr(Parser.java:1388)
>>> at org.mozilla.javascript.Parser.bitOrExpr(Parser.java:1377)
>>> at org.mozilla.javascript.Parser.andExpr(Parser.java:1365)
>>> at org.mozilla.javascript.Parser.orExpr(Parser.java:1353)
>>> at org.mozilla.javascript.Parser.condExpr(Parser.java:1336)
>>> at org.mozilla.javascript.Parser.assignExpr(Parser.java:1321)
>>> at org.mozilla.javascript.Parser.expr(Parser.java:1308)
>>> at org.mozilla.javascript.Parser.statementHelper(Parser.java:1205)
>>> at org.mozilla.javascript.Parser.statement(Parser.java:655)
>>> at org.mozilla.javascript.Parser.parse(Parser.java:377)
>>> at org.mozilla.javascript.Parser.parse(Parser.java:336)
>>> at org.mozilla.javascript.Context.compileImpl(Context.java:2322)
>>> at org.mozilla.javascript.Context.compileReader(Context.java:1310)
>>> at org.mozilla.javascript.Context.compileReader(Context.java:1282)
>>> at
>>> com.sun.phobos.script.javascript.RhinoScriptEngine.compile(RhinoScriptEngine.java:337)
>>>
>>>
>>> It seems this is because of using CDATA notations and it seems it is not
>>> a bug according to [1]. Please confirm.
>>>
>>> [1] https://wso2.org/jira/browse/TOOLS-1543
>>>
>>> Thanks,
>>> Sohani
>>>
>>> Sohani Weerasinghe
>>> Software Engineer
>>> WSO2, Inc: http://wso2.com
>>>
>>> Mobile  : +94 716439774
>>> Blog     :http://christinetechtips.blogspot.com/
>>> Twitter  : https://twitter.com/sohanichristine
>>>
>>> On Tue, Jul 28, 2015 at 7:28 AM, Jasintha Dasanayake <[email protected]>
>>> wrote:
>>>
>>>>
>>>>
>>>> On Tue, Jul 28, 2015 at 7:07 AM, Sohani Weerasinghe <[email protected]>
>>>> wrote:
>>>>
>>>>> Hi Nuwan,
>>>>>
>>>>> It seems this exception occurs in ScriptMediator.java (at
>>>>> org.apache.synapse.mediators.bsf - line 354)  when trying to compile the
>>>>> script.
>>>>>
>>>>> *compiledScript = ((Compilable)
>>>>> scriptEngine).compile(scriptSourceCode);*
>>>>>
>>>>
>>>> if this line give an error that mean script has some issue , @Sohani
>>>> what is the error thrown by bsf ?
>>>>
>>>> /Jasintha
>>>>
>>>>>
>>>>>
>>>>> @Jasintha/ Viraj : This can be reproduced even in linux and any idea
>>>>> about this error?
>>>>>
>>>>> @Nuwan: The error log can be found at the workspace of the project at
>>>>>  /.metadata/.log
>>>>>
>>>>> Thanks,
>>>>> Sohani
>>>>>
>>>>> Sohani Weerasinghe
>>>>> Software Engineer
>>>>> WSO2, Inc: http://wso2.com
>>>>>
>>>>> Mobile  : +94 716439774
>>>>> Blog     :http://christinetechtips.blogspot.com/
>>>>> Twitter  : https://twitter.com/sohanichristine
>>>>>
>>>>> On Tue, Jul 28, 2015 at 5:43 AM, Nuwan Dias <[email protected]> wrote:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> I'm using Developer Studio version 3.7.1 on MacOS. When I try to use
>>>>>> the Script Mediator within an API Resource's in-sequence, it doesn't 
>>>>>> allow
>>>>>> me to save the API and gives an error. The following is the error message
>>>>>>
>>>>>> *"Save failed. Following error(s) have been detected. Please see the
>>>>>> error log for more details.*
>>>>>>
>>>>>> *Reason:*
>>>>>> *Exception initializing inline script"*
>>>>>>
>>>>>> And following is the content of the javascript
>>>>>>
>>>>>> *<![CDATA[*
>>>>>> *        var doctorId =
>>>>>> mc.getPayloadJSON().createChannelRecord.doctorId.toString();*
>>>>>> *        var patientName =
>>>>>> mc.getPayloadJSON().createChannelRecord.patientName.toString();*
>>>>>> *        var date =
>>>>>> mc.getPayloadJSON().createChannelRecord.date.toString();*
>>>>>> *        var time =
>>>>>> mc.getPayloadJSON().createChannelRecord.time.toString();*
>>>>>> *        mc.setPayloadXML(*
>>>>>> *            <ser:createChannelRecord
>>>>>> xmlns:ser="http://com.example.service/ <http://com.example.service/>">*
>>>>>> *               <doctorId>{doctorId}</doctorId>*
>>>>>> *               <patientName>{patientName}</patientName>*
>>>>>> *               <date>{date}</date>*
>>>>>> *               <time>{time}</time>*
>>>>>> *            </ser:createChannelRecord>*
>>>>>> *      );*
>>>>>> *]]>*
>>>>>>
>>>>>> Any ideas about this error? Where can I find additional logs? The
>>>>>> same script works fine if I create an API using the management console of
>>>>>> the ESB.
>>>>>>
>>>>>> Thanks,
>>>>>> NuwanD.
>>>>>>
>>>>>> --
>>>>>> Nuwan Dias
>>>>>>
>>>>>> Technical Lead - WSO2, Inc. http://wso2.com
>>>>>> email : [email protected]
>>>>>> Phone : +94 777 775 729
>>>>>>
>>>>>> _______________________________________________
>>>>>> Dev mailing list
>>>>>> [email protected]
>>>>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>>>>
>>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>>
>>>> *Jasintha Dasanayake*
>>>>
>>>> *Senior Software EngineerWSO2 Inc. | http://wso2.com
>>>> <http://wso2.com/>lean . enterprise . middleware*
>>>>
>>>>
>>>> *mobile :- 0711368118 <0711368118>*
>>>>
>>>
>>>
>>
>>
>> --
>> Nuwan Dias
>>
>> Technical Lead - WSO2, Inc. http://wso2.com
>> email : [email protected]
>> Phone : +94 777 775 729
>>
>
>
>
> --
> Viraj Rajaguru
> Senior Software Engineer
> WSO2 Inc. : http://wso2.com
>
> Mobile: +94 77 3683068
>
>
>
>


-- 
Viraj Rajaguru
Senior Software Engineer
WSO2 Inc. : http://wso2.com

Mobile: +94 77 3683068
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to