Debugging GWT with Eclipse

43 views
Skip to first unread message

Amit Dhingra

unread,
Sep 18, 2008, 12:53:44 AM9/18/08
to google-web-toolkit
Hi,
I have been unable to debug GWT application in eclipse.
I tried running the debugger with the main class as com.google.gwt.dev.GWTShell. Doing so and checking the textbox "Stop in main" the debugger halts in main as expected, but the hosted browser is never opened and it never comes to breakpoints set in my code.
Am I missing on something.
Or rather I am asking for Idiot's guide to debugging GWT in Eclipse.

Thanks in advance!!!

--
Warm Regards,
Amit Dhingra

Pierre Mage

unread,
Sep 18, 2008, 4:33:56 AM9/18/08
to Google Web Toolkit
Good Morning Amit,

I need more precisions to answer your question.
Does your application works in running mode (in eclipse) ?

Your Debug Configuration should look like this:
Java Application
Main
Project: your Java project
Main class: com.google.gwt.dev.GWTShell
Arguments
Program arguments: -out www yourPackages.yourModule/
yourHostPage.html
VM arguments: -Xmx256m
Classpath: should includes gwt-dev-yourOS.jar and your source
folder.

Amit Dhingra

unread,
Sep 18, 2008, 5:35:13 AM9/18/08
to Google-We...@googlegroups.com
Hi,
Well, I wasn't providing the arguments to the debugger, and hence it was not opening the hosted browser. Thanks a lot for the tips!!!
But even after providing the arguments, I am facing problems.

I have done the following...
Java Application
 Main
   Project: try5
   Main class: com.google.gwt.dev.GWTShell
 Arguments
   Program arguments: -out www eu.future.earth.gwt.MainDemoApp/MainDemoApp.html
   VM arguments: -Xmx256m
 Classpath: Following are the contents of my .classpath file
**************
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
    <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
    <classpathentry kind="var" path="JUNIT_HOME/junit.jar"/>
    <classpathentry kind="lib" path="E:/work/gwt-windows-1.4.62/gwt-dev-windows.jar"/>
    <classpathentry kind="lib" path="E:/work/gwt-windows-1.4.62/gwt-user.jar"/>
    <classpathentry kind="lib" path="E:/work/try5/lib/gwt-dnd-2.0.7.jar"/>
    <classpathentry kind="lib" path="E:/work/try5/lib/ftr-gwt-library-date-0.9.5.jar"/>
    <classpathentry kind="src" path="src"/>
    <classpathentry kind="src" path="test"/>
    <classpathentry kind="output" path="bin"/>
</classpath>
**************

The Development shell gives the following error
[ERROR] Unable to find type 'eu.future.earth.gwt.client.MainDemoApp'

Please find attached the screenshot of all the above mentioned things.

If I try and run the application using any of the cmd files, it runs perfectly well.

Contents of MainDemoApp-shell.cmd
***************
@java -cp "%~dp0\src;%~dp0\bin;%~dp0/lib/gwt-dnd-2.0.7.jar;%~dp0/lib/ftr-gwt-library-date-0.9.5.jar;E:/work/gwt-windows-1.4.62/gwt-user.jar;E:/work/gwt-windows-1.4.62/gwt-dev-windows.jar" com.google.gwt.dev.GWTShell -out "%~dp0\www" %* eu.future.earth.gwt.MainDemoApp/MainDemoApp.html
***************

Am I still missing something.

Thanks & Regards,
Amit
problem.JPG

Paul Robinson

unread,
Sep 18, 2008, 5:53:11 AM9/18/08
to Google-We...@googlegroups.com

ftr-gwt-library-date-0.9.5.jar contains the calendar widget itself, but
not the demo app. Just open up the jar file to see what's inside - you
should see the class you're trying to run (MainDemoApp) isn't there. You
may need to download the source and compile it.
http://code.google.com/p/ftr-gwt-library/source/checkout

Paul

Amit Dhingra

unread,
Sep 18, 2008, 6:03:16 AM9/18/08
to Google-We...@googlegroups.com
Hi Paul,
I actually have imported the ftr-gwt-demo project in eclipse and have provided the ftr-gwt-library-date-0.9.5.jar file as external jars.
And moreover I am able to run the application with the cmd files.

Regards,
Amit

Thomas Broyer

unread,
Sep 18, 2008, 8:23:41 AM9/18/08
to Google Web Toolkit

On 18 sep, 11:35, "Amit Dhingra" <amit.dhing...@gmail.com> wrote:
> Hi,
> Well, I wasn't providing the arguments to the debugger, and hence it was not
> opening the hosted browser. Thanks a lot for the tips!!!
> But even after providing the arguments, I am facing problems.
>
> I have done the following...
> Java Application
>  Main
>    Project: try5
>    Main class: com.google.gwt.dev.GWTShell
>  Arguments
>    Program arguments: -out www
> eu.future.earth.gwt.MainDemoApp/MainDemoApp.html
>    VM arguments: -Xmx256m
>  Classpath: Following are the contents of my .classpath file

You have to manually add to the run/debug classpath your src/ folder
(Advanced... -> Add Folders): check by yourself the "(default
classpath)" entry in the "Classpath" tab from the Run/Debug dialog: it
only contains "binaries", not the src/ which GWTCompiler and GWTShell
need.
See, the %~dp0\src folder is explicitly called out.

Amit Dhingra

unread,
Sep 18, 2008, 9:36:35 AM9/18/08
to Google-We...@googlegroups.com
Thanks !!! That did the job.

Cheers,
Amit
Reply all
Reply to author
Forward
0 new messages