Can't debug client code from Eclipse

103 views
Skip to first unread message

urbanus

unread,
Feb 4, 2010, 11:16:39 PM2/4/10
to Google Web Toolkit
Debugging a default "GreetingService" application from Eclipse works
fine -- including breakpoints in the server code -- but breakpoints in
the client code aren't triggered.

I installed GWT 2.0.1, plus the GWT 2.0.1 plugin for Eclipse. I
generated a new, default project from the command-line, added it as an
Eclipse project, went to "Properties" and set the "Web Toolkit" to
2.0.1. I can debug it as a "Web Application" and it appears on the
new "Development Mode" panel in Eclipse.

I pasted the URL into Firefox and was prompted to install the plugin
-- OK. Restarted Firefox, the plugin seems to be talking to Eclipse
(if I stop Development Mode in Eclipse, the page is greyed out and
"GWT Code Server Disconnected" is displayed).

Debugging works fine in the *server* code: I can set breakpoints in
GreetingServiceImpl.java and step, etc. But if I set a breakpoint in
the *client* code (such as the sendNameToServer() method) the code
runs but the breakpoints are never hit.

System: Eclipse 3.5, Fedora 11, Java "1.6.0_0" "build 14.0-b16".


Thanks,
Dave

Rajeev Dayal

unread,
Feb 5, 2010, 11:05:04 AM2/5/10
to google-we...@googlegroups.com
There have been problems with versions of JDK 1.6.0_X, where X is between 0-15, where breakpoints are not hit when debugging. However, it is odd that your server breakpoints consistently work, but your client breakpoints do not; in those cases where the JDK has been the source of the problem, the breakpoints don't work at all (on either side).

What is the URL that you're pasting into your browser? Can you provide a screenshot of what the development mode view looks like (I want to make sure that there is an entry for the web browser)?

What happens if you set the breakpoint in the onModuleLoad() method within your entry point?



--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.


urbanus

unread,
Feb 6, 2010, 7:28:11 AM2/6/10
to Google Web Toolkit
> What happens if you set the breakpoint in the onModuleLoad() method within
> your entry point?

Thanks for your advice. I found that breakpoints work in the
onModuleLoad() method, but not in any asynchronous callback code.


Rajeev Dayal

unread,
Feb 9, 2010, 10:53:04 AM2/9/10
to google-we...@googlegroups.com
Actually, setting a breakpoint in async callback code should definitely work. In the sample, I set a breakpoint in the "onSuccess" method of the RPC callback, and it breaks there.

Try upgrading your JDK and see if you still experience the problem.





--

urbanus

unread,
Mar 2, 2010, 6:17:29 PM3/2/10
to Google Web Toolkit
On Feb 10, 2:53 am, Rajeev Dayal <rda...@google.com> wrote:
> Try upgrading your JDK and see if you still experience the problem.

Actually I found the problem. I was setting the breakpoint on the
method definition line, i.e.:

public void onSuccess(String result) {

Those breakpoints never hit. If I place breakpoints on any lines
*within* that method, they hit just fine.

Note that under normal circumstances if you put a breakpoint on a
method line, execution will break at the immediately following line.
It seems that client-side asynchronous GWT code doesn't behave that
way. I wouldn't consider this to be a serious issue: just something
to be aware of.

Thanks for your advice.


Dave

Rajeev Dayal

unread,
Mar 3, 2010, 11:01:59 AM3/3/10
to google-we...@googlegroups.com
Glad you got it working. If you wouldn't mind, could you file a bug for this? Provide details about your Eclipse version, JDK version, and OS.


--

Dan

unread,
Apr 2, 2010, 5:07:14 PM4/2/10
to Google Web Toolkit
I'm having a similar problem though the only place breakpoints don't
seem to work is in my AsyncCallback.

I see no errors in firebug or anywhere in eclipse.

The method that accepts the callback is a native js method. the js
calls the callback onSuccess.
With compiled code, I can see this actually works, but running in
development mode, i cannot get the callback to fire at all.

please advise.

> > google-web-tool...@googlegroups.com<google-web-toolkit%2Bunsubs cr...@googlegroups.com>

Rajeev Dayal

unread,
Apr 6, 2010, 10:47:01 AM4/6/10
to google-we...@googlegroups.com
Hi,

Are you sure the callback is not firing in development mode, or is the breakpoint not being hit? If the breakpoint is not being hit, you may be running into this issue (if you're using hotswap):


If you're not actually getting the callback to fire in development mode, can you paste a code snippet that shows what you're doing?


Thanks,
Rajeev

To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.

Dan Dumont

unread,
Apr 6, 2010, 12:42:07 PM4/6/10
to google-we...@googlegroups.com
It was a scoping problem.    I needed to use a closure in the native js method to wrap the callback, because even though passing the function ref works in js, to run in java it needs the context.

It would be cool if the documentation explicitly called that out because i didn't realize gwt would barf like that in developer mode.  It does make sense now though.

Rajeev Dayal

unread,
Apr 6, 2010, 1:43:44 PM4/6/10
to google-we...@googlegroups.com
Glad its working. Do you mind filing an issue for this?
Reply all
Reply to author
Forward
0 new messages