A bit of quick background info: I'm using the compiled JavaScript to
develop a Firefox extension (which is a simple login app). It's been
working relatively well so far, but I've come across a problem when I
implemented Remote Procedure Call (RPC) mechanism. The Java code
compiled without any problems, but when I ran it, I got an error when
executing the (Java) function that actually makes the RPC call.
Surprisingly, the error is not in what I wrote (as far as I can see),
but rather in one of the GWT-generated helper functions. Here's the
function itself:
function java_lang_StringBuffer_
$append__Ljava_lang_StringBuffer_2Ljava_lang_String_2(this$static,
toAppend){
if (toAppend === null) {
toAppend = 'null';
}
var last = this$static.js.length - 1;
var lastLength = this$static.js[last].length;
if (this$static.length > lastLength * lastLength) {
this$static.js[last] = this$static.js[last] + toAppend;
}
else {
this$static.js.push(toAppend);
}
this$static.length += toAppend.length;
return this$static;
}
At some point in execution, toAppend is undefined, which generates an
error when toAppend.length is called.
I'm really having trouble tracking down the source of this problem.
Part of me thinks that my code is not initializing a variable or
something like that correctly, and another part of me wonders why the
GWT-generated code doesn't check that toAppend is undefined and handle
it appropriately.
Can anyone shed any light on this problem? Would be greatly
appreciated.
Which version of GWT do you use? Did you try to run your project in
Hosted mode? Did you call setServiceEntryPoint? If you have FireBug
installed you may try to check where the toAppend value come from...
Olivier.
On 17 mai, 03:25, Dmitri V <dmitri...@gmail.com> wrote:
> A bit of quick background info: I'm using the compiled JavaScript to
> develop a Firefox extension (which is a simple login app). It's been
> working relatively well so far, but I've come across a problem when I
> implemented Remote Procedure Call (RPC) mechanism. The Java code
> compiled without any problems, but when I ran it, I got an error when
> executing the (Java) function that actually makes the RPC call.
> Surprisingly, the error is not in what I wrote (as far as I can see),
> but rather in one of the GWT-generated helper functions. Here's the
> function itself:
> At some point in execution, toAppend is undefined, which generates an
> error when toAppend.length is called.
> I'm really having trouble tracking down the source of this problem.
> Part of me thinks that my code is not initializing a variable or
> something like that correctly, and another part of me wonders why the
> GWT-generated code doesn't check that toAppend is undefined and handle
> it appropriately.
> Can anyone shed any light on this problem? Would be greatly
> appreciated.
I am facing the similar issue. I dont get the append error thou.
The apps is working in hosted env. The screen is blank in a browser.
I commented the portion that has rpc call and I am seeing colorful
panels in the browser.
Upon analyzing through firebug, it looks like only rpc data fetch is
executed. I could see the data pulled from the db and they are valid
data. After the data is fetched, the screen is empty, as thou the rpc
didnt return the control to the screen painting modules. (there is no
error reported by firebug)
setServiceEntryPoint is set as the apps is working in hosted env.
Using gwt 1.4.62
Thanks
Balaji
On May 17, 3:13 pm, Olivier Monaco <olivier.mon...@free.fr> wrote:
> Which version of GWT do you use? Did you try to run your project in
> Hosted mode? Did you call setServiceEntryPoint? If you have FireBug
> installed you may try to check where the toAppend value come from...
> Olivier.
> On 17 mai, 03:25, Dmitri V <dmitri...@gmail.com> wrote:
> > Hi all,
> > A bit of quick background info: I'm using the compiled JavaScript to
> > develop a Firefox extension (which is a simple login app). It's been
> > working relatively well so far, but I've come across a problem when I
> > implemented Remote Procedure Call (RPC) mechanism. The Java code
> > compiled without any problems, but when I ran it, I got an error when
> > executing the (Java) function that actually makes the RPC call.
> > Surprisingly, the error is not in what I wrote (as far as I can see),
> > but rather in one of the GWT-generated helper functions. Here's the
> > function itself:
> > At some point in execution, toAppend is undefined, which generates an
> > error when toAppend.length is called.
> > I'm really having trouble tracking down the source of this problem.
> > Part of me thinks that my code is not initializing a variable or
> > something like that correctly, and another part of me wonders why the
> > GWT-generated code doesn't check that toAppend is undefined and handle
> > it appropriately.
> > Can anyone shed any light on this problem? Would be greatly
> > appreciated.
setServiceEntryPoint() is set, and I tried running it in Hosted mode,
and it actually ran in the sense that the prodecure call executed and
then the onFailure callback method was called. I'm having other issues
with exceptions in Hosted mode (thread here:
http://groups.google.com/group/Google-Web-Toolkit/browse_thread/threa...)
right now, so I haven't even tried running the new code in non-hosted
mode. When I do, I'll bump this thread with whether or not the error
persists.
On May 17, 6:13 am, Olivier Monaco <olivier.mon...@free.fr> wrote:
> Which version of GWT do you use? Did you try to run your project in
> Hosted mode? Did you call setServiceEntryPoint? If you have FireBug
> installed you may try to check where the toAppend value come from...
> Olivier.
> On 17 mai, 03:25, Dmitri V <dmitri...@gmail.com> wrote:
> > Hi all,
> > A bit of quick background info: I'm using the compiled JavaScript to
> > develop a Firefox extension (which is a simple login app). It's been
> > working relatively well so far, but I've come across a problem when I
> > implemented Remote Procedure Call (RPC) mechanism. The Java code
> > compiled without any problems, but when I ran it, I got an error when
> > executing the (Java) function that actually makes the RPC call.
> > Surprisingly, the error is not in what I wrote (as far as I can see),
> > but rather in one of the GWT-generated helper functions. Here's the
> > function itself:
> > At some point in execution, toAppend is undefined, which generates an
> > error when toAppend.length is called.
> > I'm really having trouble tracking down the source of this problem.
> > Part of me thinks that my code is not initializing a variable or
> > something like that correctly, and another part of me wonders why the
> > GWT-generated code doesn't check that toAppend is undefined and handle
> > it appropriately.
> > Can anyone shed any light on this problem? Would be greatly
> > appreciated.
> setServiceEntryPoint() is set, and I tried running it in Hosted mode,
> and it actually ran in the sense that the prodecure call executed and
> then the onFailure callback method was called. I'm having other issues
> with exceptions in Hosted mode (thread here:http://groups.google.com/group/Google-Web-Toolkit/browse_thread/threa...)
> right now, so I haven't even tried running the new code in non-hosted
> mode. When I do, I'll bump this thread with whether or not the error
> persists.
> On May 17, 6:13 am, Olivier Monaco <olivier.mon...@free.fr> wrote:
> > Hi,
> > Which version of GWT do you use? Did you try to run your project in
> > Hosted mode? Did you call setServiceEntryPoint? If you have FireBug
> > installed you may try to check where the toAppend value come from...
> > Olivier.
> > On 17 mai, 03:25, Dmitri V <dmitri...@gmail.com> wrote:
> > > Hi all,
> > > A bit of quick background info: I'm using the compiled JavaScript to
> > > develop a Firefox extension (which is a simple login app). It's been
> > > working relatively well so far, but I've come across a problem when I
> > > implemented Remote Procedure Call (RPC) mechanism. The Java code
> > > compiled without any problems, but when I ran it, I got an error when
> > > executing the (Java) function that actually makes the RPC call.
> > > Surprisingly, the error is not in what I wrote (as far as I can see),
> > > but rather in one of the GWT-generated helper functions. Here's the
> > > function itself:
> > > At some point in execution, toAppend is undefined, which generates an
> > > error when toAppend.length is called.
> > > I'm really having trouble tracking down the source of this problem.
> > > Part of me thinks that my code is not initializing a variable or
> > > something like that correctly, and another part of me wonders why the
> > > GWT-generated code doesn't check that toAppend is undefined and handle
> > > it appropriately.
> > > Can anyone shed any light on this problem? Would be greatly
> > > appreciated.
The errors you described here and in the linked thread seem
symptomatic of something I've seen before. Specifically, problems like
this sometimes occur when there is a version conflict with the JARs
that were used during the GWT compilation process and the JARs that
are deployed on the server where the servlets are defined.
Can you double-check that you compiled your application with the same
GWT version as the gwt-servlet.jar that's deployed on your server?
Also, check that the shell script or run configuration you're using to
start hosted mode has the right version of the gwt-servlet.jar on its
classpath.
As for trying to identify if this problem also has something to do
with the extension you're working on itself, you can try creating a
simple JavaScript function that sends an XHR out to your server, and
check to see if the request makes it through.
Try it out and let us know how it goes.
Hope that helps,
-Sumit Chandel
On May 30, 1:23 pm, Dmitri V <dmitri...@gmail.com> wrote:
> Yeah, tried the new code in non-hosted mode and still get same
> error....
> On May 28, 1:49 pm, Dmitri V <dmitri...@gmail.com> wrote:
> > Hi, thanks for replying.
> > I use GWT 1.4.61.
> > setServiceEntryPoint() is set, and I tried running it in Hosted mode,
> > and it actually ran in the sense that the prodecure call executed and
> > then the onFailure callback method was called. I'm having other issues
> > with exceptions in Hosted mode (thread here:http://groups.google.com/group/Google-Web-Toolkit/browse_thread/threa...)
> > right now, so I haven't even tried running the new code in non-hosted
> > mode. When I do, I'll bump this thread with whether or not the error
> > persists.
> > On May 17, 6:13 am, Olivier Monaco <olivier.mon...@free.fr> wrote:
> > > Hi,
> > > Which version of GWT do you use? Did you try to run your project in
> > > Hosted mode? Did you call setServiceEntryPoint? If you have FireBug
> > > installed you may try to check where the toAppend value come from...
> > > Olivier.
> > > On 17 mai, 03:25, Dmitri V <dmitri...@gmail.com> wrote:
> > > > Hi all,
> > > > A bit of quick background info: I'm using the compiled JavaScript to
> > > > develop a Firefox extension (which is a simple login app). It's been
> > > > working relatively well so far, but I've come across a problem when I
> > > > implemented Remote Procedure Call (RPC) mechanism. The Java code
> > > > compiled without any problems, but when I ran it, I got an error when
> > > > executing the (Java) function that actually makes the RPC call.
> > > > Surprisingly, the error is not in what I wrote (as far as I can see),
> > > > but rather in one of the GWT-generated helper functions. Here's the
> > > > function itself:
> > > > At some point in execution, toAppend is undefined, which generates an
> > > > error when toAppend.length is called.
> > > > I'm really having trouble tracking down the source of this problem.
> > > > Part of me thinks that my code is not initializing a variable or
> > > > something like that correctly, and another part of me wonders why the
> > > > GWT-generated code doesn't check that toAppend is undefined and handle
> > > > it appropriately.
> > > > Can anyone shed any light on this problem? Would be greatly
> > > > appreciated.
I had a similar error awhile back. I did something silly like creating
an object that extended HashSet. This is typically fine but I was
experimenting in my IDE and accidentally overrode something like
iterator() with the default return null. It took a long time to track
down.
Are you by chance overriding a method in StringBuffer like what I
discribed?
On Jun 2, 6:02 pm, Sumit Chandel <sumitchan...@google.com> wrote:
> The errors you described here and in the linked thread seem
> symptomatic of something I've seen before. Specifically, problems like
> this sometimes occur when there is a version conflict with the JARs
> that were used during the GWT compilation process and the JARs that
> are deployed on the server where the servlets are defined.
> Can you double-check that you compiled your application with the same
> GWT version as the gwt-servlet.jar that's deployed on your server?
> Also, check that the shell script or run configuration you're using to
> start hosted mode has the right version of the gwt-servlet.jar on its
> classpath.
> As for trying to identify if this problem also has something to do
> with the extension you're working on itself, you can try creating a
> simple JavaScript function that sends an XHR out to your server, and
> check to see if the request makes it through.
> Try it out and let us know how it goes.
> Hope that helps,
> -Sumit Chandel
> On May 30, 1:23 pm, Dmitri V <dmitri...@gmail.com> wrote:
> > Yeah, tried the new code in non-hosted mode and still get same
> > error....
> > On May 28, 1:49 pm, Dmitri V <dmitri...@gmail.com> wrote:
> > > Hi, thanks for replying.
> > > I use GWT 1.4.61.
> > > setServiceEntryPoint() is set, and I tried running it in Hosted mode,
> > > and it actually ran in the sense that the prodecure call executed and
> > > then the onFailure callback method was called. I'm having other issues
> > > with exceptions in Hosted mode (thread here:http://groups.google.com/group/Google-Web-Toolkit/browse_thread/threa...)
> > > right now, so I haven't even tried running the new code in non-hosted
> > > mode. When I do, I'll bump this thread with whether or not the error
> > > persists.
> > > On May 17, 6:13 am, Olivier Monaco <olivier.mon...@free.fr> wrote:
> > > > Hi,
> > > > Which version of GWT do you use? Did you try to run your project in
> > > > Hosted mode? Did you call setServiceEntryPoint? If you have FireBug
> > > > installed you may try to check where the toAppend value come from...
> > > > Olivier.
> > > > On 17 mai, 03:25, Dmitri V <dmitri...@gmail.com> wrote:
> > > > > Hi all,
> > > > > A bit of quick background info: I'm using the compiled JavaScript to
> > > > > develop a Firefox extension (which is a simple login app). It's been
> > > > > working relatively well so far, but I've come across a problem when I
> > > > > implemented Remote Procedure Call (RPC) mechanism. The Java code
> > > > > compiled without any problems, but when I ran it, I got an error when
> > > > > executing the (Java) function that actually makes the RPC call.
> > > > > Surprisingly, the error is not in what I wrote (as far as I can see),
> > > > > but rather in one of the GWT-generated helper functions. Here's the
> > > > > function itself:
> > > > > At some point in execution, toAppend is undefined, which generates an
> > > > > error when toAppend.length is called.
> > > > > I'm really having trouble tracking down the source of this problem.
> > > > > Part of me thinks that my code is not initializing a variable or
> > > > > something like that correctly, and another part of me wonders why the
> > > > > GWT-generated code doesn't check that toAppend is undefined and handle
> > > > > it appropriately.
> > > > > Can anyone shed any light on this problem? Would be greatly
> > > > > appreciated.