my Apps: * COOL MOVIE BROWSER (sports, tv on net) here * MONEY ON THREAD (personal finance) here * HIT-BALL (cute game) here



GWT - Configure DevMode "port" and "codeServerPort" options

All options for the DevMode are listed below, and the most used, even if you don't know it, are "port" and "codeServerPort". These are used all the time to launch the application in dev-mode, using the well-know URL:

h t t p : / / localhost : 8888 / MyModule.html ? gwt.codesvr = localhost : 9997

- where "port = 8888" and "codeServerPort = 9997".

The command  line for starting the development mode for Google Web Toolkit 2.0.2, which Eclipse plugin hides from us, is presented here:

DevMode [-noserver] [-port port-number "auto"] [-whitelist whitelist-string] [-blacklist blacklist-string] [-logdir directory] [-logLevel level] [-gen dir] [-bindAddress host-name-or-address] [-codeServerPort port-number "auto"] [-server servletContainerLauncher[:args]] [-startupUrl url] [-war dir] [-extra dir] [-workDir dir] module[s]

where:
  • -port                       Specifies the TCP port for the embedded web server (defaults to 8888)
  • -codeServerPort    Specifies the TCP port for the code server (defaults to 9997)
  • -noserver               Prevents the embedded web server from running  
  • -whitelist                Allows the user to browse URLs that match the specified regexes (comma or space separated)
  • -blacklist               Prevents the user browsing URLs that match the specified regexes (comma or space separated) 
  • -logdir                    Logs to a file in the given directory, as well as graphically
  • -logLevel               The level of logging detail: ERROR, WARN, INFO, TRACE, DEBUG, SPAM, or ALL 
  • -gen                        Debugging: causes normally-transient generated types to be saved in the specified directory
  • -bindAddress         Specifies the bind address for the code server and web server (defaults to 127.0.0.1)
  • -server                   Specify a different embedded web server to run (must implement ServletContainerLauncher)
  • -startupUrl             Automatically launches the specified URL 
  • -war                        The directory into which deployable output files will be written (defaults to 'war'
  • -extra                     The directory into which extra files, not intended for deployment, will be written
  • -workDir                The compiler's working directory for internal use (must be writeable; defaults to a system temp dir) 
  • module[s]               Specifies the name(s) of the module(s) to host.
If you use Eclipse, like most of us, then to change the default settings of the GWT ports (port & server port) you have to set your launching command like in the below image, where I set as exemple the GWT port = 8877 and the dev-mode plugin port codeServerPort = 9977; so in this case the launching URL will be:

h t t p : / / localhost : 8877 / MyModule.html ? gwt.codesvr = localhost : 9977


So, this is the list of GWT Dev-Mode command line parameters. Have fun !

Cheers!

9 comments:

  1. I have been visiting various blogs for my term papers writing research. I have found your blog to be quite useful. Keep updating your blog with valuable information... Regards

    ReplyDelete
  2. Thank you for the feedback! I'll do my best - so you keep reading and learning!

    Cheers!

    ReplyDelete
  3. excellent post. very useful!

    ReplyDelete
  4. hi SSC,
    I'm using GWT dev. mode everyday.but when I open eclipse on everyday -port 80 argument removed. My argument list is below:

    -port 80 -noserver -remoteUI "${gwt_remote_ui_server_port}:${unique_id}" -startupUrl myproject -logLevel INFO -war C:\workspaceGWT\MyProject\war com.myproject.MyProject


    Do you have this problem or any solution? I'm waiting for your reply...

    ReplyDelete
  5. Nope, I don't have this problem. From within Eclipse I always use the default port 8888, not 80, which is special, and you never know what kind of conflicts may appear.

    It's not big deal to launch you application like this: http://server-name:8888/module-name.html?gwt.codesvr=localhost:9997 :-)


    What I saw, it's the eclipse GWT plugin is removing the command line if you click on the "GWT" tab -- so, after you did click on it, you have to go back to the "Arguments" tab to set back your preferences. I hope this is your case.

    Cheers!

    ReplyDelete
  6. SSC said
    " What I saw, it's the eclipse GWT plugin is removing the command line if you click on the "GWT" tab -- so, after you did click on it, you have to go back to the "Arguments" tab to set back your preferences. I hope this is your case. "

    First of all thanks for your quick reply man.

    Yeah, you already show the removing commands, I think it is big bug for GWT do you? Not only clicking "GWT tab" but also opening Eclipse this case is occur.

    I'm very very tired of changing argument list everyday morning. It is boring. I have to use port 80 bacouse the 8888 is working another project. Do you have any idea? Am I report this bug GWT developer team?

    ReplyDelete
  7. That's very strange that you loose settings at opening eclipse. Maybe you have not the right GWT plugin version appropriated for your eclipse version.

    You know that they have separate plugins for eclipse 3.4, 3.5 and 3.6 ? You need to have the right version corresponding to your eclipse version.

    Yup, you can open them a ticket. Here's the link where you can do this: http://code.google.com/p/google-web-toolkit/issues/list

    All the best!

    ReplyDelete
  8. Is there a way of being in touch with you by email i'm looking for help because I have a Gwt web app I need to run on Tomcat which I did with eclipse server but I can't understand how i can do to use dev mode.
    Regards
    Alain

    ReplyDelete
  9. Hi Alain,

    You can send me emails at moneyonthread@free.fr.

    Cheers!

    ReplyDelete