How can I debug a GWT project in eclipse? - eclipse

I have a GWT-Maven project and I want to debug it. I have not any Idea about debug in development mode or production mode. so I am giving some step which I did.
I deploy the war file on tomcat6 liferay server.
now I set a break point on server side(its work perfect)
when I set break point on client its not workig.
so is there is any way to debug GWT client on development or production mode.

I'm not sure if I'm following you correctly, but GWT is compiled into JS. Take a look at sourceMaps, I believe that's what you're looking for.

You should use the debugger of your browser. Chrome is best for this.
Launch your GWT app.
Press F12 to open developer tools.
Select "sources" tab
In the tree on the left open "Title of your page (xxxx.html)"
Below this you will see source maps with all your packages.
Open the java file you wish to put a breakpoint in and set a breakpoint using Chrome.
Doing client side GWT debugging in Eclipse is afaik not possible. But for me the Chrome debugger is more than enough.
I think IntelliJ can do client side debugging for GWT from whitin IntelliJ itself (for the paid version of IntelliJ).

Related

Cannot watch expressions of GWT under debug mode in Eclipse

I am using GWT 2.8 with GWT plugin v.3 and Tomcat 8 in Eclipse.
When I debug the project, breakpoints are working fine, but I can't watch expression, it shows reference error.
Does anyone has the same issue?
I read some related question which says using Google Plugin will be fine, but Google Plugin doesn't support Java 8.
Why it happens and how I solve it?
With GWT 2.8 and SuperDev Mode you have to change your debugging habbits a bit. On the server side the things stay the same, but on the client side you have to use the browser for debugging. Use GWT.debugger to add breakpoints in the code or set JS breakpoints in your browsers developer tools.
You also have to use the developer tools to see the expressions. Keep in mind to turn on source maps in your browser preferences. Eventually you have to use the -noincremental parameter in your run configuration to see the java variables.

Debug a remote JBoss's GWT App in Eclipse

It works to debug Java code running on a remote JBoss server on Linus, Eclipse runs on Windows. The code is can be traced with Eclipse's debugger and JDT. The ear is maven built.
Now I try to debug also the GWT Java code with Eclipse remote debug. Do I understand right, that this should be possible with com.google.gwt.dev.DevMode ? I do not want to use Superdev and Javascript, I very much prefer to debug Java in the Eclipse Debugger.
Has anybody tried this?
If you use GWT 2.7, the DevMode is deprecsted and should no longer be used.
The debug way is the SuperDev Mode, you debug with the browsers builtin javascript debugger and a sourcemap that translates to the cirrent java line. The jboss is out of scope here, because everything happens in your browser.
Excellent support for sourcemaps is in chrome.
I got it to work with the help of this: Is it possible to debug GWT client code on a REMOTE server using IntelliJ 9 Community Edition?
Chrome 41 as browser with GWT Developer Plugin,
URL for the appp is http://linux:8080/myapp/?gwt.codesvr=127.0.0.1:9997
add -nosuperDevMode to the launch config,
add javaee.jar from Glassfish 4.1 to the top of its classpath

GWT SuperDev - Can't find GWT Modules

I have followed the steps given on this page - getting-started-with-the-superdevmode
but I am still getting message - Can't find any GWT Modules on this page. I did some more googling but could not find any solution until now.
I am using GWT 2.6.1 and eclipse kepler 64 bit on ubuntu.
Here are the steps I did.
Created a new Web app project for GAE, using GWT 2.6.1 and GAE sdk 1.9.6.
Go to Run configurations. Create a new configuration for a "Java Application". Change the main class, Argument and add jar file as shown in the screenshot.
Check the apps .gwt.xml file. It already has <add-linker name="xsiframe"/>. I have tried adding devModeRedirectEnabled property also. It did not help.
GWT compile the project.
Run the application as Web application. Default jetty config serves the application at
http://localhost:8888/SuperDev.html.
I opened up this page in firefox. I can see the page content.
Launch the Java application configuration. It does compile again and gives a success message and tells me to launch
http://localhost:9876/
I opened it in firefox and it shows -
Dragged Dev Mode On to firefox's bookmark. And clicked.
I get the message - Can't find any GWT Modules on this page.
Following are the configurations for my superdev mode java app. Did I miss anything?
You need to click the bookmarklet when viewing your compiled web app.
The last steps should therefore be:
Dragged Dev Mode On to firefox's bookmark.
Switched back to my application at http://localhost:8888/SuperDev.html and clicked the bookmark
Once you have the bookmarklets, you actually don't really need to open http://localhost:9876 anymore (you'll find compile logs there, and can browser your code, including the code generated by GWT generators; so it can still be useful).
I tried to do it with Eclipse Oxygen, Java7 (for run application, for oxygen you have to have java 8), and GWT Eclipse Plugin 3.0.0.
In such an environment all you need to do is:
On project right click > Debug As > GWT Legacy Development Mode with Jetty.
PS:
you have to have address like this
http://127.0.0.1:8888/StockWatcher.html?gwt.codesvr=127.0.0.1:9997
NOT like :http://127.0.0.1:8888/StockWatcher.html
After openning addres you must additionally install the plugin in the browser - you will be asked for it
It work on IE11

Can't see java code when runnig GWT 2.5 in SuperDev mode

I have a GWT 2.5 app following Thomas Broyer's maven archetypes. I've followed the guidelines explained in the SO question and everything seems to be OK.
The code server is running properly. I browse my app and I start the dev mode from bookmarks copied to the toolbar. After starting dev mode, I can see the dialog with the compile button. After clicking the button, I can see the compiler working in Eclipse console. However, when I try to see java code on Chrome browser I can see javascript code only.
I don't know if it could be relevant, but I'm starting the code server from maven with gwt-maven-plugin's gwt:run-codeserver goal.
This is a known issue: Chrome changed the way it deals with Source Maps and this lead to an incompatibility with how GWT produces them.
This is fixed in 2.5.1-rc1 that's just been published to Central (a couple days ago, not yet officially announced). See http://mojo.codehaus.org/gwt-maven-plugin/user-guide/using-different-gwt-sdk-version.html to use it into your build. I'll release a new version of the gwt-maven-plugin that "links" to this version, and then update the archetypes.

Stop running GWT application in development mode (in eclipse)

I'm developing a simple GWT application with eclipse. When I try to run it, it runs in development mode. How I can change its configuration and disable running in development mode?
From eclipse, choose the google tools icon from the toolbar, and then click the red toolbox to compile the code.
When it's compiled, run the project as normal. From this point, you can either run in development mode by including the gwt.codesvr=localhost:9997 argument on the url, or you can run in production mode by omitting the gwt.codesvr argument.
To be more concise: to run in production mode, just remove the gwt.codesvr argument from the url. If you get the error that your module "may need to be recompiled," go back to eclipse and choose the red toolbox icon to compile the code again.
I think you don't want to disable anything. Instead of running the application as a gwt application deploy the application in tomcat or some other servers. Then it will run as normal web application. Gwt application also a dynamic web project. Nothing extra in it.
From the question I am not able to identify whether you are using any build tool or not. Just incase if you are using maven build tool you have option to maven jetty plugin and execute the mvn jetty:run option.