Expand my Community achievements bar.

RHINO USAGE WARNING: Missed Context.javaToJS() conversion

Avatar

Level 5

In AEM 6.5 publisher instance, stdout.log file has millions on entries "RHINO Usage" as below. In general it means any value that are coming from Java object is directly use in JavaScript. But, here my question is, how to identify the code in our repository that is causing this issue? there is no hint or linenumber, class name, function name from where this is getting fired.  Any suggestion or input will be highly appreciated. Thank you!

 

RHINO USAGE WARNING: Missed Context.javaToJS() conversion:
Rhino runtime detected object [Ljava.lang.Object;@435ab8dc of class [Ljava.lang.Object; where it expected String, Number, Boolean or Scriptable instance. Please check your code for missing Context.javaToJS() call.

 

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

3 Replies

Avatar

Level 8

Can you check your error logs as well ? There might be some more details present there.
Otherwise, you can try enabling debug log for org.apache.sling.scripting.javascript on some lower environment where the issue is reproducible.
That should ideally give you all the details you need. 

Avatar

Level 7

Hi,

As error suggest Rhino is expecting a String, Number, Boolean, or Scriptable instance, but it received an array of objects ([Ljava.lang.Object;) instead.

You may try to search javaToJS or Scriptable or Rhino in repo and check where  Object[] arrayObj = { "s1", 42, true }; i.e. Array of object is passed

 

Thanks

 

 

Avatar

Administrator

@RashidJorvee Did you find the suggestions from users helpful? Please let us know if you require more information. Otherwise, please mark the answer as correct for posterity. If you've discovered a solution yourself, we would appreciate it if you could share it with the community. Thank you!



Kautuk Sahni