Breakpoint Is Not Getting Hooked in Eclipse with GWT Application - eclipse

I am trying to debug a very simple HTML GWT module in Eclipse, but the breakpoint in my EntryPoint class does not get hit! I have the following setup:
GWT version: 2.7
Eclipse version: Mars 4.5.2
Chrome version: 53
Running mode: Super Dev Mode (debug)
My module contains a simple HTML file with one EntryPoint (It's a proverbial HelloWorld). The application starts normally when I do Run As Super Dev Mode or Debug As Super Dev Mode, and I see server's and client's URL's and ports with no errors. I can navigate to the application's HTML URL to see the simple Label, and even recompile and see the changes if I modify the EntryPoint class which contains the Label.
I have set my argument's log level to DEBUG (see tons of loading various modules) and even check marked Debug As Configuration to stop at the main method. The thing is, when I run the application in Debug Super Dev Mode for the first time to start the core server, I can see the breakpoint stopping in DevMode class' main() method (not afterward though when I make changes to the EntryPoint and recompile by refreshing the browser). But when I set a breakpoint in my EntryPoint's onModuleLoad(), it gets ignored!
How can I get the server to put a hook on my EntryPoint?

In some cases there is no code available for a JavaScript statement.
Try to use:
GWT.debugger();
which will always stops if you are using a debugger.

Related

GWT Super Dev does not work in IE 11

After compiler my application in GWT Super Dev Mode,
Run: "http://localhost:9876/" in IE 11,
see the followings,
GWT Code Server
1.Drag these two bookmarklets to your browser's bookmark bar:
Dev Mode On Dev Mode Off
................
3.Click "Dev Mode On" to start development mode.
when click "Dev Mode On", is shows "Can't find any GWT Modules on this page."
Anyone knows how to debug GWT in IE 11?
Thanks!
Phase 1
Compile your project
Host it in some webserver
Test it by surfing to this URL
Now phase 2
Run as superdevmode
The SuperDevMode page opens
Surf to the website you created in phase 1
Click the DevMode on bookmarklet you placed in your bookmarks bar
The app should compile
You are missing point 2 (which you left out here):
Visit a web page that uses one of these modules: [your_module_name]
So probably you didn't define a startup url for your run configuration (which IDE are you using?). You can do this with the argument -startupUrl index.html. The index.html should be placed in your output war directory.
Depeding on the port you configured (default 8888) you have to visit this html-page (with the module.js injected of course) to start the compilation. An example url would be:
127.0.0.1:8888/index.html
To debug your application in IE 11 you have to set breakpoints with GWT.debugger() for the client code. For the server code you can use the breakpoints of your IDE. To use the clientside-breakpoints you have to open the Developer Tools of your browser (F12 in case of IE11). There go to debugger/sources or however the tab is called in the case of your browser and debug your application client code directly in the browser. Keep in mind to use source maps to map your Java source code to the generated JS file.

Using breakpoint in eclipse for servlet program

I got a problem using beakpoint. there are many discussed topic regarding my question. but all of them are about java program( where main() is declared) but for servlet program how to use breakpoint? i am using elcipse IDE galileo version.
Either you let Eclipse start the web container in debug mode, and you use the breakpoint exactly like you would do on a standalone application, or you start the container in debug mode from outside of eclipse, and define (and start) a debug configuration in eclipse which connects to the remote debugging session of the container.
The way to start the container in debug mode, and the port to use to connect the debugger to the server, depends on the container. Read its documentation.
Whatever the way you choose, you'll have to use your webapp (using your browser, for example), until a request is sent to your servlet and the line with the breakpoint is executed. At this point, the way to debug is exactly the same way as if you debugged a standalone application.

Eclipse code change working explanation

If you are using Eclipse and your development server is running in the debugger, when you save your changes to this file, Eclipse compiles the new code automatically, then attempts to insert the new code into the already-running server. Changes to classes, JSPs, static files and appengine-web.xml are reflected immediately in the running server without needing to restart
plz any one can explain this ??????????
For classes like JSP-files:
Its debugging using JPDA.
The IDE attach via socket to the JVM your running app and hot-redeploy the not-permanent-code (aka PermGen).
There are different techiques and frameworks for that:
http://en.wikipedia.org/wiki/Java_Platform_Debugger_Architecture
It doesn't happen automatically. Check Project --> Build Automatically option. It should have been checked.
If you un-check it; then project will not be build/deployed automatically.

Variable evaluation fails in Eclipse when debugging JavaScript using Chrome Dev Tools

I have installed the Chrome Dev Tools Eclipse plug-in as described on http://code.google.com/p/chromedevtools/ and debugging JavaScript basically works. I can set breakpoints in my JavaScript source files and when I run the JavaScript code in Chrome, Eclipse stops the execution and opens the Debug perspective. Stepping through the code works fine, and I can also see the local and global variables in the Variables view.
When clicking on one of the variables, the detail view shows an error message, though:
Helper script failed on remote: _com_chromium_debug_helper is not defined
Did I miss something during the installation?
Update
Added an issue on the project's page: http://code.google.com/p/chromedevtools/issues/detail?id=85
Most likely you should open an issue at the project page. It is definitely a bug and fixing it might require additional context from you.
This is internals of ChromeDevTools SDK's workaround for WebKit Remote Debugging protocol limitations.

GWT app does not work properly when deployed to Tomcat server

I have a litte web app which works properly when deployed to the App Engine in Eclipse.
However, I get an error when I want to deploy my app to my Tomcat server.
I copied the content of my war folder directly to the default ROOT folder of Tomcat.
Then I run my app on an external server inside Eclipse.
Everything works fine to that point - the app is loaded straight from the browser's cache.
Here comes the problem:
The google chrome development console says "Uncaught ReferenceError: function is not defined" when I click on some features of my app that are realized through JSNI on GWT side.
I understand that the error comes from a JS caller inside external JS code. The caller invokes a GWT client-side method/function (that's why it is not defined in the ext. JS code).
Any suggestions on how to solve this problem?
Do you have any extra modules that require external js files? Some modules require the js files to be included in the war and included in your root .html file. It could be the case that you are using a library that doesn't have the base js functions.
You can add this to your .gwt.xml file to turn on the stack trace.
<set-property name="compiler.stackMode" value="emulated"/>
<set-configuration-property name="compiler.emulatedStack.recordLineNumbers" value="true"/>
<set-configuration-property name="compiler.emulatedStack.recordFileNames" value="true"/>
You could also try the setUncaughtException handler to see exceptions that are being thrown in production mode. With the emulated stack trace turned on you should be able to get a backtrace that has line numbers for your code. It is not as good as development mode but very useful for debugging.
GWT.setUncaughtExceptionHandler(new GWT.UncaughtExceptionHandler()) {
#Override
public void onUncaughtException(Throwable cause) {
logger.log(Level.SEVERE, "OOPS", cause);
}
}
Note Make sure your logger is configured to use something you can access. Like firebug or remote logging servlet.
I currently use tomcat 7 in production and development mode using eclipse. You can configure a tomcat instance of the server in eclipse and use the "Run as WebApplication on External Server". This will allow you to see the exception in development mode.
Also make sure you don't have the ?gwt.codesvr=127.0.0.1:9997 if you are in production mode. This will cause problems too unless you have the development code server running.