Debugging application on external server

186 views
Skip to first unread message

mariuszym

unread,
Nov 28, 2011, 6:04:52 AM11/28/11
to Google Web Toolkit
Hi!

I'm new in GWT and I have annoying problem with GWT. I started develop
existing project (GWT module + EJB module) and I can't begin to debug
this.
Application is working on server Glassfish 2.1 (external server - not
on my localhost). I have ant script which deploying app on this
server, but I still have to compile and deploy. Application uses some
resources from server (jdbc connections, ldap realm), so I can't test
it on my localhost (Jetty or Glassfish).

I tried to change debug configuration in my Eclipse - now when I run
application in my console I have:
Could not connect to remote UI listening at localhost:8085. Using
default UI instead.

In development mode console I have:
00:00:25,623 [INFO] Paste http://externalServer:8085/MyApp/MyApp.html&gwt.codesvr=externalServer:-1
into a browser.
After paste I have error:
Plugin failed to connect to Development Mode server at
10.11.131.124:-1

I know that's wrong, but I have no more ideas how to configure. Is
there a way to run debug this application - I can't find any similiar
case on the forum.

Alexandre Ardhuin

unread,
Nov 30, 2011, 3:14:15 AM11/30/11
to google-we...@googlegroups.com
Hi,

To debug a remote server you have to :
 - start DevMode on your localhost,
 - connect to your remote server with the normal url
 - add "gwt.codesvr=localhost:9997" parameter to the url where 9997 is the port on witch DevMode is listening

As exemple if you have your app running on http://remoteServer/MyApp/Mapp.html and DevMode listening on 9997, you have to use http://remoteServer/MyApp/Mapp.html?gwt.codesvr=localhost:9997

Alexandre

2011/11/28 mariuszym <mari...@gmail.com>



--
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.


Thomas Broyer

unread,
Nov 30, 2011, 5:02:21 AM11/30/11
to google-we...@googlegroups.com
The "code server" should be the machine where you run the DevMode, so if you run your browser on the same machine as the DevMode, it should just be "localhost" (only if you run DevMode on a machine and the browser on another one, or in a virtual machine, then you'll use the name of the machine running DevMode, so that the browser will be able to connect to it).
The startupUrl should be the one of the Glassfish server.
The "remote UI" is Eclipse itself: DevMode runs a distinct java application and either uses a Swing UI or connects to a "remote UI" (to tell you which URL to open, to output logs, etc.) When using the GPE, the "remote UI" is the "Development Mode" view in your Eclipse (where you can then stop the DevMode, refresh the server code, and see the logs).

So, in your Eclipse launch configuration, you should have:
  -startupUrl http://externalServer:8085/MyApp/MyApp.html → corresponds to the URL field in the GWT tab
  -noserver → because you unchecked "Run built-in server" in the Server tab
  -remoteUI "${gwt_remote_ui_server_port}:${unique_id}" → the GPE adds it by default, do not change it (or remove it to use the Swing UI rather than using the integration within Eclipse)

The GPE also adds -codeServerPort 9997 but that's not really important.

Jaroslav Záruba

unread,
Dec 14, 2011, 6:39:15 AM12/14/11
to google-we...@googlegroups.com
Do I have to recompile+republish my app with the -noserver parameter? My understanding is that this parameter is there only for the DevMode launch, but OTOH I find it hard to believe it is possible to debug GWT using production html+js. (Sounds just too good to be true. :)

Thomas Broyer

unread,
Dec 14, 2011, 9:54:47 AM12/14/11
to google-we...@googlegroups.com
The *.nocache.js contains code that "sniffs" for the presence of the gwt.codesvr= in the query-string to trigger DevMode; it then loads the hosted.html (or hosted.js, depending on the linker) instead of the *.cache.html (or *.cache.js). The hosted.html then loads the browser DevMode pluging which connects back to the code server, so that the code that actually runs is *not* the "production" JS but the Java code from your computer, running in the DevMode code server.

Of course, the server-side code is the one deployed on the server.
Reply all
Reply to author
Forward
0 new messages