[ 
https://issues.apache.org/jira/browse/PIVOT-965?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16354089#comment-16354089
 ] 

Roger Whitcomb commented on PIVOT-965:
--------------------------------------

Still having issues with the context menu scripts in 
"org.apache.pivot.tutorials.layout.table_panes.bxml":

Caused by: javax.script.ScriptException: ReferenceError: "setRowHeight" is not 
defined in nashorn:mozilla_compat.js at line number 67
 at 
jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine.throwAsScriptException(Unknown
 Source)
 at 
jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine.invokeImpl(Unknown
 Source)
 at 
jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine.invokeFunction(Unknown
 Source)
 at 
org.apache.pivot.beans.BXMLSerializer$ElementInvocationHandler.invokeMethod(BXMLSerializer.java:185)
 at 
org.apache.pivot.beans.BXMLSerializer$ElementInvocationHandler.invoke(BXMLSerializer.java:195)
 ... 49 more
Caused by: nashorn:mozilla_compat.js:67 ReferenceError: "setRowHeight" is not 
defined
 at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ECMAErrors.error(Unknown 
Source)
 at 
jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ECMAErrors.referenceError(Unknown
 Source)
 at 
jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ECMAErrors.referenceError(Unknown
 Source)
 at 
jdk.scripting.nashorn/jdk.nashorn.internal.objects.Global.__noSuchProperty__(Unknown
 Source)
 at 
jdk.scripting.nashorn.scripts/jdk.nashorn.internal.scripts.Script$Recompilation$134$1347A$\=nashorn\!mozilla_compat.value-1#__noSuchProperty__(nashor
n:mozilla_compat.js:67)
 at 
jdk.scripting.nashorn.scripts/jdk.nashorn.internal.scripts.Script$Recompilation$133$34AA$\^eval\_/61370247.selectionChanged(<eval>:4)
 at 
jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(Unknown
 Source)
 at 
jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ScriptFunction.invoke(Unknown
 Source)
 at 
jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ScriptRuntime.apply(Unknown 
Source)
 at 
jdk.scripting.nashorn/jdk.nashorn.api.scripting.ScriptObjectMirror.callMember(Unknown
 Source)
 ... 53 more

 

For instance, when right-click and select any of the menu choices, then trying 
to change any settings in the sheet dialogs you get similar errors.  Looks like 
the main script namespace isn't getting transferred to the "child" scripts.

> Java 8 BXML scripting security issues in Apache Pivot RIAs
> ----------------------------------------------------------
>
>                 Key: PIVOT-965
>                 URL: https://issues.apache.org/jira/browse/PIVOT-965
>             Project: Pivot
>          Issue Type: Bug
>          Components: core-serialization
>    Affects Versions: 2.0.4
>         Environment: Windows, Sun JRE 64-bit 1.8.0_31b13
>            Reporter: Karel Hübl
>            Assignee: Roger Whitcomb
>            Priority: Major
>              Labels: java8, jdk8
>             Fix For: 2.1
>
>         Attachments: 965.diffs, BXMLSerializer.patch, jnlpScripting.war
>
>
> We encounter security issues in our pivot application after upgrading to JRE 
> 1.8. The application is deployed as RIA using Java Web Start.
> I found out, that the problem is connected with nashorn script engine which 
> replaced rhino script engine from previous java version. BXMLSerializer is 
> using ScriptEngine to evaluate scripts in BXML files. It seems, that all 
> calls initiated from BXML scripts, are considered untrusted in JRE 1.8 RIA 
> Environment - this means security dialogs and exceptions are thrown, when 
> trying execute privileged actions (network communication, reflection ...).
> Currently, I am not sure, if this is Pivot or Nashorn bug, but it is problem 
> for current Apache Pivot RIAs. To investigate the srcipting behaviour in 
> RIAs, I created testing non Pivot project 
> https://github.com/kaja78/jnlpScripting The project contains testing 
> application, which is deployed as JWS. When you execute the java web start 
> app in JRE 1.8, the security dialog is displayed when testing method is 
> executed from nashorn script engine (if you press cancel button on security 
> dialog, you get SecurityException). When you uncomment 2 lines in 
> Webcontent/jnlpScripting.jnlp file, rhino script engine is used instead of 
> nashorn and no security dialog is displayed. This fix works also for our 
> Pivot RIAs.
> I believe, Pivot should work in JRE 1.8 RIA Environment without security 
> issues by default, so it should be fixed somehow in Pivot - may be, by 
> correct ScriptEngine configuration in BXMLSerializer or by including Rhino 
> libraries in Pivot distribution. Any idea how to "correctly" fix this issue?
> Btw.: I found this bug: http://bugs.java.com/view_bug.do?bug_id=8045075 I am 
> not sure, if it is the same problem. But anyway, it should be fixed in
> 1.8.25.b01 and we are encountering above issues in latest 1.8.0.31.b13.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to