Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Rhino Script not invoked from Java

49 views
Skip to first unread message

vittal

unread,
Apr 6, 2010, 9:51:27 AM4/6/10
to
We are trying to invoke a rhino code from java, our custom code is not able to execute overriden function in script using Java, rhino version is 1.6 build 5 and jdk1.6.
same custom code is working with 1.6 build 1, JDK 1.4.X.

statements using to make a call
Object func = ScriptableObject.getProperty(thisObj, functionName);
f.call(cx, scope, thisObj, args);

code is passing through call method of function object but not executing script method, not even throwing exception.
what could be reason,


---
frmsrcurl: http://mozilla-xp.com/mozilla.dev.tech.js-engine.rhino

Mark Storer

unread,
Apr 6, 2010, 1:33:22 PM4/6/10
to vittal, dev-tech-js-...@lists.mozilla.org
ScriptableObject.callMethod( cx, thisObj, functionName, args );

> _______________________________________________
> dev-tech-js-engine-rhino mailing list
> dev-tech-js-...@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino
>

--
--Mark Storer
Professional Geek

niclas

unread,
Jun 2, 2010, 3:25:02 AM6/2/10
to
Hi,

I have a question on the same subject as the author of the first post.
What should the args array contain when I don't want to pass on any
arguments?
I've tried the following:

Object[] args = null; (NullPointerException)
Object[] args = {}; (division by zero)

As you can see none of those approaches worked. What am I missing?

On Apr 6, 8:33 pm, Mark Storer <mstorer3...@gmail.com> wrote:
> ScriptableObject.callMethod( cx, thisObj, functionName, args );
>
>
>
> On Tue, Apr 6, 2010 at 6:51 AM, vittal <u...@mozilla-xp.com/> wrote:
> > We are trying to invoke a rhino code from java, our custom code is not able
> > to execute overriden function in script using Java, rhino version is 1.6
> > build 5 and jdk1.6.
> > same  custom code is working with 1.6 build 1, JDK 1.4.X.
>
> > statements using to make a call
> > Object func = ScriptableObject.getProperty(thisObj, functionName);
> > f.call(cx, scope, thisObj, args);
>
> > code is passing through call method of function object but not executing
> > script method, not even throwing exception.
> > what could be reason,
>
> > ---
> > frmsrcurl:http://mozilla-xp.com/mozilla.dev.tech.js-engine.rhino
> > _______________________________________________
> > dev-tech-js-engine-rhino mailing list

> > dev-tech-js-engine-rh...@lists.mozilla.org

0 new messages