Devmode keeps losing the ?gwt.codesvr and falling back to old production code

Bug #786391 reported by Matt Giuca
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MUGLE
Triaged
Low
Unassigned

Bug Description

Thus requiring that you either do a full production compile every time you run it (this shouldn't be; the whole point of ant devmode is that you run it without a full compilation), or manually stick ?gwt.codesvr=127.0.0.1:9997 on the end of the URL.

I think that I must have screwed up defining the build files for the GWT / GAE crossover. From what I have read, if you launch a GWT app with a URL such as:
http://127.0.0.1:8888/Mugle.html
it will run the production code, which requires you have cleaned and run ant gwtc.

If you launch a GWT app with a URL such as:
http://127.0.0.1:8888/Mugle.html?gwt.codesvr=127.0.0.1:9997
then it will connect to the GWT development mode code server on port 9997. Hence that part of the URL is critical.

It looks like the "Launch Default Browser" button in ant devmode is giving the browser a URL without gwt.codesvr, and therefore you are getting the production code. I need to fix the build script to set gwt.codesvr in the URL.

A workaround, in the meantime, may be to manually add ?gwt.codesvr=127.0.0.1:9997 to the URL; then you shouldn't need to run ant before running ant devmode. (You can just refresh the browser to see code changes.)

Tags: build
Revision history for this message
Matt Giuca (mgiuca) wrote :

Actually, I am getting to the bottom of this. The problem isn't with the build script. It's with the generation of the login URLs (and all the other URLs as well).

Note that when you start the server, you are linked to:
http://127.0.0.1:8888/Mugle.html?gwt.codesvr=127.0.0.1:9997
and it works without running ant.

But the URL for the login page is:
http://127.0.0.1:8080/_ah/login?continue=http%3A%2F%2F127.0.0.1%3A8080%2F
note that the continue= is set to redirect back to http://127.0.0.1:8080, without the ?gwt.codesvr... When you come back from logging in, you find yourself at:
http://127.0.0.1:8080/
which doesn't work unless you have recently run gwtc. If you manually put ?gwt.codesvr=127.0.0.1:9997 on the end of this URL, it works again.

But even if we fixed that, I would be worried that all of the Ajax URLs are losing the ?gwt.codesvr=127.0.0.1:9997 part as well, and therefore will require gwtc; though it doesn't look that way in practice.

Therefore, I guess for now a workaround is to keep sticking that annoying string on the end of your URLs, and then you can use ant devmode without ant. For now, I am de-assigning myself since this is NOT a build problem.

Changed in mugle:
assignee: Matt Giuca (mgiuca) → nobody
Revision history for this message
Scott Ritchie (sritchie) wrote : Re: [Bug 786391] Re: Need to run 'ant' before running 'ant devmode'

I havent had any problems when removing that url. I've always just compiled
with ant first since it seems to have more reliable behaviour as to the
changes made

On Sun, May 22, 2011 at 1:20 PM, Matt Giuca <email address hidden>wrote:

> Actually, I am getting to the bottom of this. The problem isn't with the
> build script. It's with the generation of the login URLs (and all the
> other URLs as well).
>
> Note that when you start the server, you are linked to:
> http://127.0.0.1:8888/Mugle.html?gwt.codesvr=127.0.0.1:9997
> and it works without running ant.
>
> But the URL for the login page is:
> http://127.0.0.1:8080/_ah/login?continue=http%3A%2F%2F127.0.0.1%3A8080%2F
> note that the continue= is set to redirect back to http://127.0.0.1:8080,
> without the ?gwt.codesvr... When you come back from logging in, you find
> yourself at:
> http://127.0.0.1:8080/
> which doesn't work unless you have recently run gwtc. If you manually put
> ?gwt.codesvr=127.0.0.1:9997 on the end of this URL, it works again.
>
> But even if we fixed that, I would be worried that all of the Ajax URLs
> are losing the ?gwt.codesvr=127.0.0.1:9997 part as well, and therefore
> will require gwtc; though it doesn't look that way in practice.
>
> Therefore, I guess for now a workaround is to keep sticking that
> annoying string on the end of your URLs, and then you can use ant
> devmode without ant. For now, I am de-assigning myself since this is NOT
> a build problem.
>
> ** Changed in: mugle
> Assignee: Matt Giuca (mgiuca) => (unassigned)
>
> --
> You received this bug notification because you are subscribed to MUGLE.
> https://bugs.launchpad.net/bugs/786391
>
> Title:
> Need to run 'ant' before running 'ant devmode'
>
> Status in Melbourne University Game-based Learning Environment:
> Triaged
>
> Bug description:
> This shouldn't be: the whole point of ant devmode is that you run it
> without a full compilation.
>
> I think that I must have screwed up defining the build files for the GWT /
> GAE crossover. From what I have read, if you launch a GWT app with a URL
> such as:
> http://127.0.0.1:8888/Mugle.html
> it will run the production code, which requires you have cleaned and run
> ant gwtc.
>
> If you launch a GWT app with a URL such as:
> http://127.0.0.1:8888/Mugle.html?gwt.codesvr=127.0.0.1:9997
> then it will connect to the GWT development mode code server on port 9997.
> Hence that part of the URL is critical.
>
> It looks like the "Launch Default Browser" button in ant devmode is
> giving the browser a URL without gwt.codesvr, and therefore you are
> getting the production code. I need to fix the build script to set
> gwt.codesvr in the URL.
>
> A workaround, in the meantime, may be to manually add
> ?gwt.codesvr=127.0.0.1:9997 to the URL; then you shouldn't need to run
> ant before running ant devmode. (You can just refresh the browser to
> see code changes.)
>

Revision history for this message
Matt Giuca (mgiuca) wrote : Re: Need to run 'ant' before running 'ant devmode'

> I havent had any problems when removing that url. I've always just compiled
> with ant first since it seems to have more reliable behaviour as to the
> changes made

That's exactly the problem ... you shouldn't *have* to compile with ant first. If you need to compile ant first for something to work, then it means that thing is not running in development mode, it's running in compiled (production) mode. The whole point of devmode is to avoid having to make a production compile (which takes about a minute) when you want to test changes.

If you put the gwt.codesvr on the end of the URL, you shouldn't need to run ant in order to get the reliable behaviour.

Matt Giuca (mgiuca)
summary: - Need to run 'ant' before running 'ant devmode'
+ Devmode keeps losing the ?gwt.codesvr and falling back to production
description: updated
Revision history for this message
Matt Giuca (mgiuca) wrote :

I set this to low; I have been using the workaround of pasting ?gwt.codesvr=127.0.0.1:9997 for a week and it isn't too bothersome. You only have to do it when you log out or log in.

summary: - Devmode keeps losing the ?gwt.codesvr and falling back to production
+ Devmode keeps losing the ?gwt.codesvr and falling back to old production
+ code
Changed in mugle:
importance: High → Low
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.