Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Client Error "a is undefined" on asynchronous UI update
Client Error "a is undefined" on asynchronous UI update [message #1176406] Fri, 08 November 2013 10:08 Go to next message
Christian Brugger is currently offline Christian Brugger
Messages: 4
Registered: November 2013
Junior Member
Hi all,

we faced a problem regarding asynchronous ui update calls using display.asyncExec in RAP 2.1.0

Here's a little Snippet, I hope this can demonstrate the problem:

...

public MyComposite() {
        super(...);

        this.label = new Label(...);    
}

public void handleEvent() {
	getDisplay().asyncExec(new Runnable() {
		@Override
		public void run() {
	      		updateUi();
		}
	});
}

private void updateUi() {
	this.label.setImage(this.image);
}

...


handleEvent is called from another thread, so it may be called almost concurrently to the creation of the Label.

When this happens a "Client Error" appears, because obviously the widget is still undefined in the JavaScript context, although the corresponding Java Object already exists.

Client Error
Details:

Error: Error: Operation "set" on target "w1750" of type "null" failed:
a is undefined
Properties:
image = rwt-resources/generated/47476ff0.png,15,15


  Script: {"head":{"requestCounter":79},"operations":[["set","w1750",{"image":["rwt-resources/generated/47476ff0.png",15,15]}], ....


May this be a Bug in the RAP framework or is there any known solution to this?

Thank you!
Christian
Re: Client Error "a is undefined" on asynchronous UI update [message #1176706 is a reply to message #1176406] Fri, 08 November 2013 13:55 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan Furnadjiev
Messages: 1817
Registered: July 2009
Senior Member
Hi Christian,
usually such kind of JavaScript errors are bugs in the framework. Please
open a bugzilla and attach a complete self-running snippet to
demonstrate the issue.
Thanks,
Ivan

On 11/8/2013 3:46 PM, Christian Brugger wrote:
> Hi all,
>
> we faced a problem regarding asynchronous ui update calls using
> display.asyncExec in RAP 2.1.0
>
> Here's a little Snippet, I hope this can demonstrate the problem:
>
>
> ..
>
> public MyComposite() {
> super(...);
>
> this.label = new Label(...); }
>
> public void handleEvent() {
> getDisplay().asyncExec(new Runnable() {
> @Override
> public void run() {
> updateUi();
> }
> });
> }
>
> private void updateUi() {
> this.label.setImage(this.image);
> }
>
> ..
>
>
> handleEvent is called from another thread, so it may be called almost
> concurrently to the creation of the Label.
>
> When this happens a "Client Error" appears, because obviously the
> widget is still undefined in the JavaScript context, although the
> corresponding Java Object already exists.
>
>
> Client Error
> Details:
>
> Error: Error: Operation "set" on target "w1750" of type "null" failed:
> a is undefined
> Properties:
> image = rwt-resources/generated/47476ff0.png,15,15
>
>
> Script:
> {"head":{"requestCounter":79},"operations":[["set","w1750",{"image":["rwt-resources/generated/47476ff0.png",15,15]}],
> ....
>
>
> May this be a Bug in the RAP framework or is there any known solution
> to this?
>
> Thank you!
> Christian

--
Ivan Furnadjiev

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

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: Client Error "a is undefined" on asynchronous UI update [message #1176728 is a reply to message #1176706] Fri, 08 November 2013 14:12 Go to previous messageGo to next message
Christian Brugger is currently offline Christian Brugger
Messages: 4
Registered: November 2013
Junior Member
Hi Ivan,

thanks for your answer.

As the error happens only sporadic, there's no easy way to create a self-running example that can reproduce the error reliably. Seems like the problem is some kind of race condition.
I'll create a Bugzilla issue when I found a way to reprocude the error.

Anyway, do you know of any similar issues, respectively any solution or workaround to prevent this from happening?

Chrisitan
icon5.gif  Re: Client Error "a is undefined" on asynchronous UI update [message #1182627 is a reply to message #1176728] Tue, 12 November 2013 09:59 Go to previous messageGo to next message
Christian Brugger is currently offline Christian Brugger
Messages: 4
Registered: November 2013
Junior Member
Hi again,

I have another assumption, what maybe causes this error.
The system, where the problem occurred several times, is not very powerful, so maybe the performance of the RAP server is quite bad. Also the network connection may be slow from time to time.
Does anyone have some expierience with such kind of "Client errors" occurring on slow systems or with increased network latency?

... When I try to reproduce this error in my development environment (with RAP server on localhost) everything seems to work fine. Confused

Christian
Re: Client Error "a is undefined" on asynchronous UI update [message #1182654 is a reply to message #1182627] Tue, 12 November 2013 10:18 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan Furnadjiev
Messages: 1817
Registered: July 2009
Senior Member
Hi Christian,
is this error reproducible with all browsers - IE08-IE11, Firefox,
Chrome, Opera 17?
Best,
Ivan

On 11/12/2013 11:59 AM, Christian Brugger wrote:
> Hi again,
>
> I have another assumption, what maybe causes this error.
> The system, where the problem occurred several times, is not very
> powerful, so maybe the performance of the RAP server is quite bad.
> Also the network connection may be slow from time to time. Does anyone
> have some expierience with such kind of "Client errors" occurring on
> slow systems or with increased network latency?
>
> .. When I try to reproduce this error in my development environment
> (with RAP server on localhost) everything seems to work fine. :?
> Christian

--
Ivan Furnadjiev

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

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: Client Error "a is undefined" on asynchronous UI update [message #1182739 is a reply to message #1182654] Tue, 12 November 2013 11:34 Go to previous messageGo to next message
Christian Brugger is currently offline Christian Brugger
Messages: 4
Registered: November 2013
Junior Member
Hi Ivan,

it happened with Firefox and Chrome.

And as I cannot reproduce it at all for now, i don't know for other browsers and IE.

I will try to reproduce the error for other browsers, if this information can help you...

Christian
Re: Client Error "a is undefined" on asynchronous UI update [message #1182800 is a reply to message #1182739] Tue, 12 November 2013 12:20 Go to previous message
Ivan Furnadjiev is currently offline Ivan Furnadjiev
Messages: 1817
Registered: July 2009
Senior Member
Hi Christian,
my suspicion was that the "bad guy" is IE.... but as it happens in
Firefox and Chrome that was a wrong direction... Without a snippet to
reproduce it I can't help you much.
Best,
Ivan

On 11/12/2013 1:34 PM, Christian Brugger wrote:
> Hi Ivan,
>
> it happened with Firefox and Chrome.
>
> And as I cannot reproduce it at all for now, i don't know for other
> browsers and IE.
>
> I will try to reproduce the error for other browsers, if this
> information can help you...
>
> Christian

--
Ivan Furnadjiev

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

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Previous Topic:Intercept mnemonic
Next Topic:Calling a client service from RAP
Goto Forum:
  


Current Time: Mon Sep 22 10:13:26 GMT 2014

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

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