RHINO USAGE WARNING: Missed Context.javaToJS() conversion

1,266 views
Skip to first unread message

fergie70

unread,
Feb 9, 2015, 12:42:16 PM2/9/15
to mozill...@googlegroups.com
Hi --

This might have been covered before but not in the context in which I'm asking.  I using iText XFA Workflow engine along with Adobe LiveCycle.  I have written JavaScript into my XML based PDF/XFA forms using LiveCycle.  The PDF/XFA forms are processed by the iText XFA Engine which uses rhino 1.7R4.  Sometimes I'm getting error messages from Rhino as follows....

RHINO USAGE WARNING: Missed Context.javaToJS() conversion:
Rhino runtime detected object [[ ], [ , DataType1]] of class java.util.ArrayList where it expected String, Number, Boolean or Scriptable instance. Please check your code for missing Context.javaToJS() call.
RHINO USAGE WARNING: Missed Context.javaToJS() conversion:
Rhino runtime detected object [[ ], [ , DataType1]] of class java.util.ArrayList where it expected String, Number, Boolean or Scriptable instance. Please check your code for missing Context.javaToJS() call.
RHINO USAGE WARNING: Missed Context.javaToJS() conversion:
Rhino runtime detected object [[ ], [ , DataType1]] of class java.util.ArrayList where it expected String, Number, Boolean or Scriptable instance. Please check your code for missing Context.javaToJS() call.
RHINO USAGE WARNING: Missed Context.javaToJS() conversion:
Rhino runtime detected object [[ ], [ , DataType1]] of class java.util.ArrayList where it expected String, Number, Boolean or Scriptable instance. Please check your code for missing Context.javaToJS() call.
RHINO USAGE WARNING: Missed Context.javaToJS() conversion:
Rhino runtime detected object [[ ], [ , DataType1] of class java.util.ArrayList where it expected String, Number, Boolean or Scriptable instance. Please check your code for missing Context.javaToJS() call.

My JavaScript looks like this

var m = this.rawValue;
if (m != null) {
    var n = parseFloat(m);
    n = n.toFixed(4);
    this.rawValue = n;
}


Any help would be appreciated.

Thanks, Fergie70



Greg Brail

unread,
Feb 9, 2015, 3:39:00 PM2/9/15
to mozill...@googlegroups.com
The problem is likely inside the iText software -- somewhere in there, they have implemented some of their library in Java, probably exposed as a "host object" in Rhino. Their Java code is returning an ArrayList as a value rather than a legitimate JavaScript object, and you are trying to access it. Their Java code needs to convert the object into a valid object like the message says. Otherwise, it's returning you an invalid JS object which will result in strange values.

I'm not sure what to suggest other than to see if the people behind the iText software can explain it.

--
You received this message because you are subscribed to the Google Groups "mozilla-rhino" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mozilla-rhin...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
greg brail | apigee twitter @gbrail

Reply all
Reply to author
Forward
0 new messages