2

I created appEngine project from the Maven glass java starter project, and I am trying to run it as appengine:devserver But, when I try to access the localhost on the browser, it says:- "This webpage has a redirect loop".

Also, how do I delete the cache on the chrome browser, because even when the localserver is not running, I still get the above mentioned error, unless I delete the cache from the browser and restart my Windows m/c.

2 Answers2

2

I resolved this issue. Basically, it was a url-rewriting issue and the Jetty server was inserting the sessionId (jsessionId) into the URL. I disabled this by having this in the web.xml:

<context-param>
    <param-name>org.mortbay.jetty.servlet.SessionURL</param-name>
    <param-value>none</param-value>
</context-param>

and this in the appengine-web.xml:

<sessions-enabled>true</sessions-enabled>
Eugene Loy
  • 12,224
  • 8
  • 53
  • 79
0

Instead of "localhost", try creating a host entry in your %SystemRoot%\system32\drivers\etc\hosts file (eg. devserver.example.com 127.0.01)

When testing, you can disable Chrome cache by going into devtools and clicking the settings gear.

pinoyyid
  • 21,499
  • 14
  • 64
  • 115
  • Changing the etc\hosts file as you suggested did not help. Still getting the same error - "This webpage has a redirect loop". – Dev Srivastava Sep 03 '13 at 20:55
  • You'll need to trace the network requests in Chrome devtools to see what the loop is, then trace the code to see where the loop is originating – pinoyyid Sep 04 '13 at 04:17
  • for some reasons App Engine does not like this code in the AuthFilter.java httpResponse.sendRedirect(WebUtil.buildUrl(httpRequest, "/oauth2callback")); This code would redirect to Authorization via Google services. – Dev Srivastava Sep 04 '13 at 20:27