glassfish
  1. glassfish
  2. GLASSFISH-12889

Strange behaviour/bug with remote GF 3.0.1: HTTP/1.1 302 Moved Temporarily

    Details

    • Issuezilla Id:
      12,889
    • Status Whiteboard:
      Hide

      grizzly_1_9_19

      Show
      grizzly_1_9_19

      Description

      I hav already entered a detailed description at
      http://forums.java.net/jive/thread.jspa?messageID=479178

      Here is my first post:

              1. Nabi START ##########################################
                I have monitored the following with a clean glassfish 3.0.1 installation:

      1. stop glassfish with asadmin

      2. start glassfish with asadmin

      3. open browser and call the server, i.e. www.mydomain.com
      I did not change anything, so the default index.html file of the document root
      is displayed (/op/glassfishv3/glassfish/domains/domain1/docroot/index.html)

      4. The browser displays ocasionally (very often):

      I could not explain what I saw in step 4. Sometimes http://www.mydomain.com/ was
      displayed, which is what I expected. But the sometimes what I described in step
      4 is displayed within the URL bar of the browsers.

      So I installed a tool for watching the http traffic. It shows me the following:

      HTTP/1.1 302 Moved Temporarily
      Location: http://www.mydomain.com:80/index.html
      Connection: close
      Cache-Control: private
      Date: Fri, 23 Jul 2010 19:04:08 GMT

      As you see this is a redirect from the Glassfish Server. It seems this makes
      Safari display even the default port 80, whereas the other browsers don't do
      that. But all have in common that they redirect to the new URL defined in the
      header and they display it in the URL bar:

      Location: http://www.mydomain.com:80/index.html

      I have no idea why this happens, but I can tell it happens very often and I do
      not like this behaviour. Especially because it happens totally ocasionally (at
      least as it seemed so far)!

      Here is my environment where my Glassfish is running:

      • Glassfish 3.0.1 Remote Server on Ubuntu Server 8.04 (Hardy)
      • Glassfish is running with a non-root user called "glassfish"
      • Ubuntu firewall is configured to forward port 80 to 8080 with the following
        iptables rule:
        iptables -t nat -A PREROUTING -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 8080

      So far I don't see anything I did wrong. After analyzing this strange behaviour
      I found out the following:

      5. Call the login page of the glassfish admin concole by typing the following
      url into you browser: https://www.mydomain.com:4848/

      6. now again try to open the browser with www.mydomain.com (same as step 4)

      7. This time it works all as expected:

      HTTP/1.1 200 OK
      X-Powered-By: Servlet/3.0
      Server: GlassFish Server Open Source Edition 3.0.1
      Accept-Ranges: bytes
      Etag: W/"1090-1276886352000"
      Last-Modified: Fri, 18 Jun 2010 18:39:12 GMT
      Content-Type: text/html
      Content-Length: 1090
      Date: Fri, 23 Jul 2010 19:24:58 GMT
      Connection: close

      <html>
      <head>
      [...]

      Isn't that strange???

      I am not very sure, but I think after letting Glassfish running for a while the
      issue might occur again. I will let you know if I can prove that somehow or if I
      can't.

      Can anyone reproduce this issue?
      I think this is a behaviour that should be eliminated - it is simply not the
      standard behaviour that one would expect.

      I hope someone will take this over since I have already spent a lot of time into
      this.

      Nabi

              1. Nabi END ##########################################

      kumara has answered with this here:

              1. kumara START ##########################################
                My guess – the "good" redirect (without port number 80) is coming from
                GlassFish web container whereas the "bad" redirect (with port number 80) is
                coming from GlassFish Grizzly (low level network io library for GlassFish).
                As you might be aware, GlassFish loads containers on demand. If you have no web
                applications deployed then web container is not loaded and all traffic is
                handled by grizzly component of GlassFish. When you access admin console, which
                happens to be a web application, web container gets loaded and grizzly sends all
                HTTP traffic to web container for handling resulting in a different behavior.
                A workaround will be to have a web application deployed. Once GlassFish sees a
                user deployed web application, it will load web container during startup and
                therefore your end users will not see the issue.
                Please file an issue on glassfish issue tracker (link below) under
                grizzly-kernel sub-component and someone will look at the issue. Given that
                there is an easy workaround, this should be a low priority issue.
              2. kumara END ##########################################

      His explanation seem reasonable.
      Please check this, you should be able to reproduce this issue.

      Thanks,
      Nabi

        Activity

        Hide
        Ryan Lubke added a comment -

        Taking ownership.

        Show
        Ryan Lubke added a comment - Taking ownership.
        Hide
        Ryan Lubke added a comment -

        Issue has been resolved on the Grizzly side. Fix will be verifiable once grizzly is integrated.

        Will update the issue again when the integration has been completed.

        Show
        Ryan Lubke added a comment - Issue has been resolved on the Grizzly side. Fix will be verifiable once grizzly is integrated. Will update the issue again when the integration has been completed.
        Hide
        Ryan Lubke added a comment -

        Grizzly 1.9.19 has been integrated. Validation of the fix should be possible with GF 3.1 promoted build
        16.

        Show
        Ryan Lubke added a comment - Grizzly 1.9.19 has been integrated. Validation of the fix should be possible with GF 3.1 promoted build 16.

          People

          • Assignee:
            Ryan Lubke
            Reporter:
            nabizamani
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: