bizarre yet predictable triple and interleaved call to servlet when using Chrome GWT devmode

35 views
Skip to first unread message

dsw

unread,
Apr 13, 2012, 10:28:09 PM4/13/12
to Google Web Toolkit
I asked this on stackoverflow:
http://stackoverflow.com/questions/10137389/bizarre-yet-predictable-triple-and-interleaved-call-to-servlet-when-using-gwt-de

but I'm blocked on it so I hope you don't mind if I ask it here.

The short version is that I have a Bar.jsp file that renders out an
HTML page that should load the GWT app.

The app.yaml look something like this (with more comments):

handlers:

- url: /Intro
jsp: Intro.jsp

# the internal rpc service
- url: /waga/rpc
name: WagaServiceImpl
servlet: com.waga.server.WagaServiceImpl
login: required

- url: /bar/*
jsp: Bar.jsp
login: required

I'm logged in in my browser. I launch ant devmode and in the devmode
app I say to go to /bar/xyz123 in the browser.

== Mystery 1:

I have a log message at the top and the bottom of Bar.jsp and the both
print out. The problem is they print out 3 times (top, bottom, top,
bottom, etc.), almost as if Chrome were going to the URL 3 times.

The page renders blank (except the title) which is correct; I view-
source in the page and it looks right. In the past this has loaded my
GWT app due to this line in the page head:

<script type="text/javascript" language="javascript" src="waga/
waga.nocache.js"></script>

== Mystery 2:

Somehow the client simply does not load the GWT app. This was
working: my machine would normally heat up and cause the fan to run
while it was compiling the GWT client Java to JavaScript, and I don't
hear that nor see it on top -o cpu. The page just renders and then it
is almost as if the javascript just doesn't run.

One might ask what did I change between the version that worked and
this version. Well, I reorganized the structure of the app so that a
new user would see an Intro page and then redirect to a NewUser page
which would make a new user unless they exist and then redirect to
displaying their data etc. But none of that mechanism is present in
this example and those lines are commented out of the app.yaml.

Jens

unread,
Apr 14, 2012, 10:28:18 AM4/14/12
to google-we...@googlegroups.com
Have you verified (using chrome dev tools) that the browser successfully fetches "waga/waga.nocache.js" and that "waga.nocache.js" actually contains javascript code?

If your app does not start it seems like the javascript file could not be loaded because of a wrong URL or you use some server side rewrite rules that causes your server to return a different file for the url "waga/waga.nocache.js".

-- J.

Daniel Wilkerson

unread,
Apr 17, 2012, 9:45:33 PM4/17/12
to Google Web Toolkit
This mystery is solved.
http://stackoverflow.com/questions/10137389/bizarre-yet-predictable-triple-and-interleaved-call-to-servlet-when-using-gwt-de

I think it would be best if webAppCreator generated HTML having
absolute paths rather than relatives paths to the generated
JavaScript. The compiler is going to put the .js file in the same
place relative to the server root no matter the URL of the page
accessing it. So I'm going to call this a bug in webAppCreator.

Reply all
Reply to author
Forward
0 new messages