Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Java Exception when using RAP Google Maps Widget
Java Exception when using RAP Google Maps Widget [message #1336198] Tue, 06 May 2014 05:24 Go to next message
Richard Skriwanek is currently offline Richard Skriwanek
Messages: 4
Registered: May 2014
Junior Member
Hi,

I have problems with the RAP Google Maps Widget.
When updates in the maps occur (e.g. setting or removing a marker) sometimes an exception occurs.

type Exception report

message Failed to evaluate Javascript expression

description The server encountered an internal error that prevented it from fulfilling this request.

exception

org.eclipse.swt.SWTException: Failed to evaluate Javascript expression
	org.eclipse.swt.browser.Browser.createException(Browser.java:596)
	org.eclipse.swt.browser.Browser.evaluate(Browser.java:335)
	com.eclipsesource.widgets.gmaps.GMap.addMarker(GMap.java:168)
	org.eclipse.rap.demo.gmaps.internal.GMapsExamplePage$8.widgetSelected(GMapsExamplePage.java:204)
	org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:262)
	org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:85)
	org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:699)
	org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:601)
	org.eclipse.swt.widgets.Display.executeNextEvent(Display.java:1208)
	org.eclipse.swt.widgets.Display.runPendingMessages(Display.java:1189)
	org.eclipse.swt.widgets.Display.safeReadAndDispatch(Display.java:1172)
	org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1164)
	org.eclipse.swt.browser.Browser.execute(Browser.java:260)
	org.eclipse.swt.browser.Browser.evaluate(Browser.java:333)
	com.eclipsesource.widgets.gmaps.GMap.addMarker(GMap.java:168)
	org.eclipse.rap.demo.gmaps.internal.GMapsExamplePage$8.widgetSelected(GMapsExamplePage.java:204)
	org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:262)
	org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:85)
	org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:699)
	org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:601)
	org.eclipse.swt.widgets.Display.executeNextEvent(Display.java:1208)
	org.eclipse.swt.widgets.Display.runPendingMessages(Display.java:1189)
	org.eclipse.swt.widgets.Display.safeReadAndDispatch(Display.java:1172)
	org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1164)
	org.eclipse.rap.rwt.application.AbstractEntryPoint.createUI(AbstractEntryPoint.java:62)
	org.eclipse.rap.rwt.internal.lifecycle.RWTLifeCycle.createUI(RWTLifeCycle.java:186)
	org.eclipse.rap.rwt.internal.lifecycle.RWTLifeCycle$UIThreadController.run(RWTLifeCycle.java:298)
	java.lang.Thread.run(Thread.java:722)
	org.eclipse.rap.rwt.internal.lifecycle.UIThread.run(UIThread.java:104)


This can be reproduced with the demo at
rap.eclipsesource.com/demo/release/rapdemo/examples#gmaps
(sorry I'm not allowed to use links yet)
by clicking "Add Marker" several times quite fast.
Sometimes it occurs on the first few clicks sometimes it takes some seconds of fast clicking.
(BTW fast clicking is not the reason it just raises the chance, it happens also with sporadic update events)

I reproduced this with
Firefox 28.0 on Windows 7
Firefox 18.0.2 on Linux
IE 11.0 on Windows 7

best regards
Richard
Re: Java Exception when using RAP Google Maps Widget [message #1336851 is a reply to message #1336198] Tue, 06 May 2014 11:52 Go to previous messageGo to next message
Tim Buschtoens is currently offline Tim Buschtoens
Messages: 381
Registered: July 2009
Senior Member
Hi.

I could reproduce it in Firefox. It might be a bug in the Browser
widget. We are looking into it. In the meanwhile you could a bug report
here:

https://bugs.eclipse.org/bugs/enter_bug.cgi?product=RAP&rep_platform=All&op_sys=all

Greetings,
Tim


Am 06.05.2014 15:45, schrieb Richard Skriwanek:
> Hi,
>
> I have problems with the RAP Google Maps Widget.
> When updates in the maps occur (e.g. setting or removing a marker)
> sometimes an exception occurs.
>
>
> type Exception report
>
> message Failed to evaluate Javascript expression
>
> description The server encountered an internal error that prevented it
> from fulfilling this request.
>
> exception
>
> org.eclipse.swt.SWTException: Failed to evaluate Javascript expression
> org.eclipse.swt.browser.Browser.createException(Browser.java:596)
> org.eclipse.swt.browser.Browser.evaluate(Browser.java:335)
> com.eclipsesource.widgets.gmaps.GMap.addMarker(GMap.java:168)
> org.eclipse.rap.demo.gmaps.internal.GMapsExamplePage$8.widgetSelected(GMapsExamplePage.java:204)
> org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:262)
> org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:85)
> org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:699)
> org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:601)
> org.eclipse.swt.widgets.Display.executeNextEvent(Display.java:1208)
> org.eclipse.swt.widgets.Display.runPendingMessages(Display.java:1189)
> org.eclipse.swt.widgets.Display.safeReadAndDispatch(Display.java:1172)
> org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1164)
> org.eclipse.swt.browser.Browser.execute(Browser.java:260)
> org.eclipse.swt.browser.Browser.evaluate(Browser.java:333)
> com.eclipsesource.widgets.gmaps.GMap.addMarker(GMap.java:168)
> org.eclipse.rap.demo.gmaps.internal.GMapsExamplePage$8.widgetSelected(GMapsExamplePage.java:204)
> org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:262)
> org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:85)
> org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:699)
> org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:601)
> org.eclipse.swt.widgets.Display.executeNextEvent(Display.java:1208)
> org.eclipse.swt.widgets.Display.runPendingMessages(Display.java:1189)
> org.eclipse.swt.widgets.Display.safeReadAndDispatch(Display.java:1172)
> org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1164)
> org.eclipse.rap.rwt.application.AbstractEntryPoint.createUI(AbstractEntryPoint.java:62)
> org.eclipse.rap.rwt.internal.lifecycle.RWTLifeCycle.createUI(RWTLifeCycle.java:186)
> org.eclipse.rap.rwt.internal.lifecycle.RWTLifeCycle$UIThreadController.run(RWTLifeCycle.java:298)
> java.lang.Thread.run(Thread.java:722)
> org.eclipse.rap.rwt.internal.lifecycle.UIThread.run(UIThread.java:104)
>
>
> This can be reproduced with the demo at
> rap.eclipsesource.com/demo/release/rapdemo/examples#gmaps
> (sorry I'm not allowed to use links yet)
> by clicking "Add Marker" several times quite fast.
> Sometimes it occurs on the first few clicks sometimes it takes some
> seconds of fast clicking.
> (BTW fast clicking is not the reason it just raises the chance, it
> happens also with sporadic update events)
>
> I reproduced this with
> Firefox 28.0 on Windows 7
> Firefox 18.0.2 on Linux
> IE 11.0 on Windows 7
>
> best regards
> Richard
>

--
Tim Buschtöns

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

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: Java Exception when using RAP Google Maps Widget [message #1336994 is a reply to message #1336198] Tue, 06 May 2014 13:19 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan Furnadjiev
Messages: 1794
Registered: July 2009
Senior Member
Hi Richard,
I can reproduce the issue with our Examples Demo -> GMap page too. I did
some debugging and here are the results. addMarker is called in button
selection event. When you click fast it's possible to have more than one
button Selection notify operation in a single protocol message
(request). This schedule multiple Selection events. When first event is
processed -> addMarker is called -> Browser#evaluate is called. Inside
Browser#evaluate the readAndDispatch loop is executed, which trigger the
next Selection event and call addMarker again. This second call
immediately throw SWTException in Browser#evaluate, because another
evaluate operation is already scheduled (Browser#executeScript is not
null) and this second call can't be processed. From my point of view
this behavior is expected - SWTException SWT.ERROR_FAILED_EVALUATE is
thrown. You should always wrap Browser#evaluate in a try/catch clause,
because such exception is expected in case of evaluation failure.
Best,
Ivan

--
Ivan Furnadjiev

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

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: Java Exception when using RAP Google Maps Widget [message #1337028 is a reply to message #1336994] Tue, 06 May 2014 13:37 Go to previous messageGo to next message
Richard Skriwanek is currently offline Richard Skriwanek
Messages: 4
Registered: May 2014
Junior Member
Hi,

Thanks for the analysis.
I have written an application that is based on the demo code. There the marker is modified depending on the value of some database records. These records do currently not change more often than once every 10s. This application never runs any longer than a few hours without generating this exception. Therefore i suspected it to be a timing problem and not a problem of frequeny.
But probably this is another issue. I'll check if i can catch the exception as you mentioned.

Best regards
Richard
Re: Java Exception when using RAP Google Maps Widget [message #1338456 is a reply to message #1337028] Wed, 07 May 2014 04:11 Go to previous messageGo to next message
Richard Skriwanek is currently offline Richard Skriwanek
Messages: 4
Registered: May 2014
Junior Member
Hi,

Wraping Browser#evaluate catches the fast-click induced exceptions. I have it running now with the slow automatic updates and will see if this catches also the exceptions that occured without user interaction.

--Richard
Re: Java Exception when using RAP Google Maps Widget [message #1338515 is a reply to message #1336994] Wed, 07 May 2014 04:47 Go to previous messageGo to next message
Tim Buschtoens is currently offline Tim Buschtoens
Messages: 381
Registered: July 2009
Senior Member
I'm not sure if this should be expected behavior, but for now I will
just adjust the GMap widget.

Am 06.05.2014 19:19, schrieb Ivan Furnadjiev:
> Hi Richard,
> I can reproduce the issue with our Examples Demo -> GMap page too. I did
> some debugging and here are the results. addMarker is called in button
> selection event. When you click fast it's possible to have more than one
> button Selection notify operation in a single protocol message
> (request). This schedule multiple Selection events. When first event is
> processed -> addMarker is called -> Browser#evaluate is called. Inside
> Browser#evaluate the readAndDispatch loop is executed, which trigger the
> next Selection event and call addMarker again. This second call
> immediately throw SWTException in Browser#evaluate, because another
> evaluate operation is already scheduled (Browser#executeScript is not
> null) and this second call can't be processed. From my point of view
> this behavior is expected - SWTException SWT.ERROR_FAILED_EVALUATE is
> thrown. You should always wrap Browser#evaluate in a try/catch clause,
> because such exception is expected in case of evaluation failure.
> Best,
> Ivan
>

--
Tim Buschtöns

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

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: Java Exception when using RAP Google Maps Widget [message #1338979 is a reply to message #1338515] Wed, 07 May 2014 09:08 Go to previous messageGo to next message
Richard Skriwanek is currently offline Richard Skriwanek
Messages: 4
Registered: May 2014
Junior Member
Hi,

I copy your doubts.
As for my aplication lost updates are not acceptable this means I have to implement some queuing mechanism.

--Richard
Re: Java Exception when using RAP Google Maps Widget [message #1339177 is a reply to message #1338979] Wed, 07 May 2014 10:59 Go to previous message
Cole Markham is currently offline Cole Markham
Messages: 133
Registered: July 2009
Senior Member
This seems to be the same case as either [1] or [2]. I created a patch which has been updated to the 2.2 maintenance branch but would need updated for the latest 2.3 milestone. I'll try to get it converted to a Gerrit review.

[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=371133
[2] https://bugs.eclipse.org/bugs/show_bug.cgi?id=371132

-- Cole
Previous Topic:FileUpload , How to check size and format of a file before uploading?
Next Topic:style font-size does not work for Chrome!
Goto Forum:
  


Current Time: Sat Aug 23 11:34:00 EDT 2014

Powered by FUDForum. Page generated in 0.01970 seconds