Hi Thomas,

The project I have provided creates a jar. So you have to copy the jar to
/repository/components/lib. Then you have to restart the ESB.

If you want you can add the classes to a CAR project and add a template to
call the class mediator. Once the CAR is deployed you can invoke the class
mediator through the template without restarting the ESB.

Regards,
Asitha

On Mon, Jun 26, 2017 at 1:49 PM, Thomas LEGRAND <
thomas.legr...@versusmind.eu> wrote:

> Hello Asitha,
>
> I tried to use your mediator to test but I have this error when I deploy
> my CAR:
>
> java.lang.ClassNotFoundException: org.wso2.carbon.mediation.
>> mediator.sample.NashornMediator cannot be found by
>> synapse-core_2.1.7.wso2v13 at org.eclipse.osgi.internal.
>> loader.BundleLoader.findClassInternal(BundleLoader.java:501) at
>> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:421)
>> at 
>> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:412)
>> at 
>> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
>> at java.lang.ClassLoader.loadClass(Unknown Source) at
>> org.apache.synapse.config.xml.ClassMediatorFactory.
>> createSpecificMediator(ClassMediatorFactory.java:102) ... 29 more
>
>
> I firstly tried to deploy it via the interface in the ESB artifacts menu.
> Then I tried by I dropping the generated JAR of the mediator in dropins.
> Then in repository/components/lib (directory I had to create). And of
> course, I tried in lib, at the same level of dropins.
>
> What do I miss?
>
> Regards,
>
> Thomas
>
> 2017-06-25 19:16 GMT+02:00 Asitha Nanayakkara <asi...@wso2.com>:
>
>> Hi Thomas,
>>
>> At the moment there is no straightforward way to configure the Script
>> mediator JS engine to use Nashorn.
>>
>> Another option would be to write a class mediator which uses the JDK
>> default JS engine or Nashorn specifically. You can use [1] as a reference
>> point if you are willing to write a class mediator. But you won't get the
>> E4X XML manipulation functionality you get from the Script mediator from
>> this. You might need to load a js library that does XML manipulation.
>>
>> [1] https://github.com/Asitha/nashorn-class-mediator
>>
>> Regards,
>> Asitha
>>
>> On Fri, Jun 23, 2017 at 8:40 PM, Thomas LEGRAND <
>> thomas.legr...@versusmind.eu> wrote:
>>
>>> Hello everybody,
>>>
>>> I encountered the limitation of the Rhino engine because of my heavy
>>> JSON payload. I am using Enterprise Integrator 6.0.0 with Java 8 and I
>>> found out that the default JS engine should be Nashorn for the Data Mapper
>>> mediator.
>>>
>>> Is it possible to configure the EI to use the same JS engine for the
>>> Script mediator?
>>> And, is it possible to configure the Rhino engine to stop the
>>> optimization to prevent this error?
>>>
>>> Regards,
>>>
>>> Thomas
>>>
>>> _______________________________________________
>>> Dev mailing list
>>> Dev@wso2.org
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>>
>>
>>
>> --
>> *Asitha Nanayakkara* <http://asitha.github.io/>
>> Senior Software Engineer
>> WSO2, Inc. <http://wso2.com/>
>> Mob: +94 77 853 0682 <+94%2077%20853%200682>
>> [image: https://wso2.com/signature] <https://wso2.com/signature>
>>
>>
>


-- 
*Asitha Nanayakkara* <http://asitha.github.io/>
Senior Software Engineer
WSO2, Inc. <http://wso2.com/>
Mob: +94 77 853 0682
[image: https://wso2.com/signature] <https://wso2.com/signature>
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to