You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@synapse.apache.org by ant elder <an...@gmail.com> on 2006/10/27 14:16:28 UTC

Re: Script mediator using BSF

Moved into trunk now, i'll look at doing some better samples and doc for it.
For now the JavaDoc describes what it does:
https://svn.apache.org/repos/asf/incubator/synapse/trunk/java/modules/extensions/src/org/apache/synapse/mediators/bsf/ScriptMediatorFactory.java

How about deleting the old javascript mediator now as this bsf one provides
the same functionality?

   ...ant

On 10/21/06, ant elder <an...@gmail.com> wrote:
>
> I started a script mediator based on BSF in the scratch area:
> https://svn.apache.org/repos/asf/incubator/synapse/trunk/scratch/ant/BSF/
>
> The basic function works now, there's a simple Synapse config file and
> associate JavaScript program demonstrating it which mediates the messages
> used by the Synapse StockquoteClient sample so it uses the xmethods
> stockquote service:
>
> https://svn.apache.org/repos/asf/incubator/synapse/trunk/scratch/ant/BSF/repository/conf/sample/synapse_sample_script2.xml
>
> https://svn.apache.org/repos/asf/incubator/synapse/trunk/scratch/ant/BSF/repository/conf/sample/xmethodsStockquote.js
>
>
> This uses the Synapse registry and stores the script in a property which
> is different than the JavaScript mediator which  embeds the script  in a
> CDATA within the Synapse config XML file. There's an example of theis at:
> https://svn.apache.org/repos/asf/incubator/synapse/trunk/scratch/ant/BSF/repository/conf/sample/synapse_sample_js.xml
> .
>
> I think i like the registry/property approach better as the embedded
> approach gets a bit hard to read. I guess it could support both but maybe
> that just makes things even more complicated. Does anyone else have a
> preference either way?
>
>    ...ant
>

Re: Script mediator using BSF

Posted by Paul Fremantle <pz...@gmail.com>.
+1 to deleting the old one. This is pretty smart. I especially like
the way you've automatically passed the XML in the native best XML
format. Maybe its time for me to learn Ruby!

Paul

On 10/27/06, ant elder <an...@gmail.com> wrote:
> Moved into trunk now, i'll look at doing some better samples and doc for it.
> For now the JavaDoc describes what it does:
> https://svn.apache.org/repos/asf/incubator/synapse/trunk/java/modules/extensions/src/org/apache/synapse/mediators/bsf/ScriptMediatorFactory.java
>
> How about deleting the old javascript mediator now as this bsf one provides
> the same functionality?
>
>    ...ant
>
>
> On 10/21/06, ant elder <an...@gmail.com> wrote:
> > I started a script mediator based on BSF in the scratch area:
> https://svn.apache.org/repos/asf/incubator/synapse/trunk/scratch/ant/BSF/
> >
> > The basic function works now, there's a simple Synapse config file and
> associate JavaScript program demonstrating it which mediates the messages
> used by the Synapse StockquoteClient sample so it uses the xmethods
> stockquote service:
> >
> >
> https://svn.apache.org/repos/asf/incubator/synapse/trunk/scratch/ant/
> BSF/repository/conf/sample/synapse_sample_script2.xml
> >
> https://svn.apache.org/repos/asf/incubator/synapse/trunk/scratch/ant/
> BSF/repository/conf/sample/xmethodsStockquote.js
> >
> > This uses the Synapse registry and stores the script in a property which
> is different than the JavaScript mediator which  embeds the script  in a
> CDATA within the Synapse config XML file. There's an example of theis at:
> https://svn.apache.org/repos/asf/incubator/synapse/trunk/scratch/ant/
> BSF/repository/conf/sample/synapse_sample_js.xml .
> >
> > I think i like the registry/property approach better as the embedded
> approach gets a bit hard to read. I guess it could support both but maybe
> that just makes things even more complicated. Does anyone else have a
> preference either way?
> >
> >    ...ant
> >
>
>


-- 
Paul Fremantle
VP/Technology, WSO2 and OASIS WS-RX TC Co-chair

http://bloglines.com/blog/paulfremantle
paul@wso2.com

"Oxygenating the Web Service Platform", www.wso2.com

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


Re: Script mediator using BSF

Posted by Roland Weber <ht...@dubioso.net>.
Hello Asankha,

> The BSF unit tests are failing for me under JDK 1.4.. but works with 1.5..
> 
> The error is "java.lang.NoClassDefFoundError:
> org/mozilla/javascript/EvaluatorException" but I am guessing that the
> root cause is something else..

Did you make sure that all classes were recompiled with JDK 1.4 before
running the test with 1.4? Because if that exception class was compiled
against JDK 1.5 and thereby has some 1.5-only class as a superclass,
you'd see exactly that kind of message. I remember problems like those
from the JDK 1.1 to 1.2 switch.

cheers,
  Roland

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


Re: Script mediator using BSF

Posted by Paul Fremantle <pz...@gmail.com>.
Thanks!

Paul

On 11/9/06, ant elder <an...@gmail.com> wrote:
> I shall go have a look...
>
>    ...ant
>
>
> On 11/9/06, Asankha C. Perera <as...@wso2.com> wrote:
> > Ant
> >
> > The BSF unit tests are failing for me under JDK 1.4.. but works with 1.5..
> >
> > The error is "java.lang.NoClassDefFoundError:
> > org/mozilla/javascript/EvaluatorException" but I am
> guessing that the
> > root cause is something else..
> >
> > thanks
> > asankha
> >
> >
> >
> > ant elder wrote:
> > > Hah no it should be fine with JDK 1.4 I'll go change that. I'm just
> > > copying all this from similar function I've done in Tuscany and
> > > Tuscany is JDK 1.5 is where this came from.
> > >
> > >    ...ant
> > >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> synapse-dev-unsubscribe@ws.apache.org
> > For additional commands, e-mail: synapse-dev-help@ws.apache.org
> >
> >
>
>


-- 
Paul Fremantle
VP/Technology, WSO2 and OASIS WS-RX TC Co-chair

http://bloglines.com/blog/paulfremantle
paul@wso2.com

"Oxygenating the Web Service Platform", www.wso2.com

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


Re: Script mediator using BSF

Posted by ant elder <an...@gmail.com>.
Has anyone else been able to try this with JDK14?

Asankha, could you show the output of java -version so i could try with
exactly the same JDK as you?

   ...ant

On 11/10/06, ant elder <an...@gmail.com> wrote:
>
> I've tried on several JVMs but can't recreate the problem, it all works
> fine for me. Can you say more about your environment? Do the JavaScript
> tests fail as well or is it just the BSF ones? Could you show the complete
> stack trace? Does it work/not work for anyone else?
>
>    ...ant
>
> On 11/9/06, ant elder <an...@gmail.com> wrote:
> >
> > I shall go have a look...
> >
> >    ...ant
> >
> > On 11/9/06, Asankha C. Perera < asankha@wso2.com> wrote:
> > >
> > > Ant
> > >
> > > The BSF unit tests are failing for me under JDK 1.4.. but works with
> > > 1.5..
> > >
> > > The error is "java.lang.NoClassDefFoundError:
> > > org/mozilla/javascript/EvaluatorException" but I am guessing that the
> > > root cause is something else..
> > >
> > > thanks
> > > asankha
> > >
> > >
> > >
> > > ant elder wrote:
> > > > Hah no it should be fine with JDK 1.4 I'll go change that. I'm just
> > > > copying all this from similar function I've done in Tuscany and
> > > > Tuscany is JDK 1.5 is where this came from.
> > > >
> > > >    ...ant
> > > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org
> > > For additional commands, e-mail: synapse-dev-help@ws.apache.org
> > >
> > >
> >
>

Re: Script mediator using BSF

Posted by ant elder <an...@gmail.com>.
I've tried on several JVMs but can't recreate the problem, it all works fine
for me. Can you say more about your environment? Do the JavaScript tests
fail as well or is it just the BSF ones? Could you show the complete stack
trace? Does it work/not work for anyone else?

   ...ant

On 11/9/06, ant elder <an...@gmail.com> wrote:
>
> I shall go have a look...
>
>    ...ant
>
> On 11/9/06, Asankha C. Perera <as...@wso2.com> wrote:
> >
> > Ant
> >
> > The BSF unit tests are failing for me under JDK 1.4.. but works with 1.5
> > ..
> >
> > The error is "java.lang.NoClassDefFoundError:
> > org/mozilla/javascript/EvaluatorException" but I am guessing that the
> > root cause is something else..
> >
> > thanks
> > asankha
> >
> >
> >
> > ant elder wrote:
> > > Hah no it should be fine with JDK 1.4 I'll go change that. I'm just
> > > copying all this from similar function I've done in Tuscany and
> > > Tuscany is JDK 1.5 is where this came from.
> > >
> > >    ...ant
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org
> > For additional commands, e-mail: synapse-dev-help@ws.apache.org
> >
> >
>

Re: Script mediator using BSF

Posted by ant elder <an...@gmail.com>.
I shall go have a look...

   ...ant

On 11/9/06, Asankha C. Perera <as...@wso2.com> wrote:
>
> Ant
>
> The BSF unit tests are failing for me under JDK 1.4.. but works with 1.5..
>
> The error is "java.lang.NoClassDefFoundError:
> org/mozilla/javascript/EvaluatorException" but I am guessing that the
> root cause is something else..
>
> thanks
> asankha
>
>
>
> ant elder wrote:
> > Hah no it should be fine with JDK 1.4 I'll go change that. I'm just
> > copying all this from similar function I've done in Tuscany and
> > Tuscany is JDK 1.5 is where this came from.
> >
> >    ...ant
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: synapse-dev-help@ws.apache.org
>
>

Re: Script mediator using BSF

Posted by "Asankha C. Perera" <as...@wso2.com>.
Ant

The BSF unit tests are failing for me under JDK 1.4.. but works with 1.5..

The error is "java.lang.NoClassDefFoundError: 
org/mozilla/javascript/EvaluatorException" but I am guessing that the 
root cause is something else..

thanks
asankha



ant elder wrote:
> Hah no it should be fine with JDK 1.4 I'll go change that. I'm just 
> copying all this from similar function I've done in Tuscany and 
> Tuscany is JDK 1.5 is where this came from.
>
>    ...ant
>

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


Re: Script mediator using BSF

Posted by ant elder <an...@gmail.com>.
Hah no it should be fine with JDK 1.4 I'll go change that. I'm just copying
all this from similar function I've done in Tuscany and Tuscany is JDK
1.5is where this came from.

   ...ant

On 10/27/06, Asankha C. Perera <as...@wso2.com> wrote:
>
> Hi Ant
> > How about deleting the old javascript mediator now as this bsf one
> > provides the same functionality?
> +1
>
> The RBOMElementConvertor.java class seems to use the StringBuilder from
> JDK 1.5.. Do you know if the BSF requires JDK 1.5, or will it be
> possible for us to refactor the above for now, so that we could contain
> any 1.5 dependencies to a minimum?
>
> thanks
> asankha
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: synapse-dev-help@ws.apache.org
>
>

Re: Script mediator using BSF

Posted by "Asankha C. Perera" <as...@wso2.com>.
Hi Ant
> How about deleting the old javascript mediator now as this bsf one 
> provides the same functionality?
+1

The RBOMElementConvertor.java class seems to use the StringBuilder from 
JDK 1.5.. Do you know if the BSF requires JDK 1.5, or will it be 
possible for us to refactor the above for now, so that we could contain 
any 1.5 dependencies to a minimum?

thanks
asankha

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