Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Client error with Browser.execute function
Client error with Browser.execute function [message #1486366] Tue, 25 November 2014 01:52 Go to next message
Emmanuel Marchal is currently offline Emmanuel MarchalFriend
Messages: 10
Registered: June 2014
Location: Belo Horizonte, Brazil
Junior Member
Hi there,

I got the following error when calling browser.execute("myJavaScriptFunction()");
This only occurs on a deployed version, not in eclipse !

The method is called in

browser.addProgressListener(new ProgressListener() {

@Override
public void completed(ProgressEvent event) {
browser.execute("setData("myJavaScriptFunction()");
}

@Override
public void changed(ProgressEvent event) {}
});

Do you have an idea of the source of the error ??
Thanks,
Emmanuel

---------

Client Error

Details:

Error: Error: Operation "call" on target "w84" of type "rwt.widgets.Browser" failed:
SecurityRestriction:
Browser-Widget can not access "null:-1nullnull" from "XXX.com".
Properties:
script = setData(120,240)


Script: {"head":{"requestCounter":21},"operations":[["set","w10",{"bounds":[0,0,0,0]}],["set","w80",{"bounds":[0,56,1280,445]}],["set","w81",{"bounds":[5,5,1266,431],"clientArea":[0,0,1266,431]}],["set","w82",{"bounds":[0,0,1266,431],"clientArea":[0,0,1266,431]}],["set","w83",{"bounds":[25,25,1216,60]}],["set","w84",{"bounds":[25,90,1216,240]}],["set","w85",{"bounds":[1039,335,202,71]}],["call","w84","evaluate",{"script":"setData(120,240)"}]]}
Stack: Error: Operation "call" on target "w84" of type "rwt.widgets.Browser" failed:
SecurityRestriction:
Browser-Widget can not access "null:-1nullnull" from "XXX.com".
Properties:
script = setData(120,240)

at Object.rwt.remote.MessageProcessor._processError (http://XXX.com/rwt-resources/rap-client.js:231:3811)
at Object.rwt.remote.MessageProcessor.processOperationArray (http://XXX.com/rwt-resources/rap-client.js:231:928)
at Object.rwt.remote.MessageProcessor.processMessage (http://XXX.com/rwt-resources/rap-client.js:231:223)
at rwt.qx.Class.define.members._handleSuccess (http://XXX.com/rwt-resources/rap-client.js:235:3630)
at Object._success (http://XXX.com/rwt-resources/rap-client.js:97:1012)
at Object.rwt.remote.Request._onReadyStateChange (http://XXX.com/rwt-resources/rap-client.js:97:1902)
at XMLHttpRequest.d (http://XXX.com/rwt-resources/rap-client.js:15:522)
Debug: off
Request: {"head":{"requestCounter":20},"operations":[["call","rwt.client.TextSizeMeasurement","storeMeasurements",{"results":{"t-1682727348":[292,58]}}],["notify","w84","Progress",{}],["set","w1",{"cursorLocation":[1156,355]}]]}

[Updated on: Tue, 25 November 2014 01:52]

Report message to a moderator

Re: Client error with Browser.execute function [message #1486642 is a reply to message #1486366] Tue, 25 November 2014 07:17 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2334
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi,
you run into browser security restriction. Obviously, Eclipse internal
(SWT) browser widget does not respect security restrictions like real
browsers. Without the complete picture/snippet (from where you load the
page and what exactly you want to set) I can't help much.
Best,
Ivan

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: Client error with Browser.execute function [message #1486671 is a reply to message #1486366] Tue, 25 November 2014 07:46 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2334
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
.... in any case such security error should not lead to application
crash. Could you please open a bugzilla and attach a snippet to
reproduce the error?
Best,
Ivan

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: Client error with Browser.execute function [message #1487353 is a reply to message #1486671] Tue, 25 November 2014 19:51 Go to previous messageGo to next message
Emmanuel Marchal is currently offline Emmanuel MarchalFriend
Messages: 10
Registered: June 2014
Location: Belo Horizonte, Brazil
Junior Member
Hi Ivan,

The problem occurred only when the URL passed to the browser object was
1. is absolute ("http://server:port/page.html")
2. is build using HttpServletRequest methods (getServerName, etc.)

AND

3. when the HttpServletRequest is stored as an object of my Session class (SingletonUtil.getSessionInstance).

In my previous configuration (only 1. and 2.), it was working properly.

Fortunately, passing only "/page.html" as URL (defined as org.eclipse.equinox.http.registry.resources), solved the problem.

For info, the setData method only pass an argument to a javascript method updating InnerHTML of a div.

Hope that helps to identify the bug.
Cheers,
Emmanuel
Re: Client error with Browser.execute function [message #1487355 is a reply to message #1486366] Tue, 25 November 2014 19:54 Go to previous message
Emmanuel Marchal is currently offline Emmanuel MarchalFriend
Messages: 10
Registered: June 2014
Location: Belo Horizonte, Brazil
Junior Member
No Message Body
Previous Topic:RAP and Cross Site Request Forgery attacks
Next Topic:RAP and org.eclipse.core.runtime.products extension point
Goto Forum:
  


Current Time: Wed Feb 26 17:13:18 GMT 2020

Powered by FUDForum. Page generated in 0.08861 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top