Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.9.9
    • Fix Version/s: 1.9.40
    • Component/s: all
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: Macintosh

    • Issuezilla Id:
      811

      Description

      When uploading files over 2 Gb, I get the following exception:

      java.lang.NumberFormatException
      at com.sun.grizzly.util.buf.Ascii.parseLong(Ascii.java:232)
      at com.sun.grizzly.util.buf.ByteChunk.getLong(ByteChunk.java:542)
      at com.sun.grizzly.util.buf.MessageBytes.getLong(MessageBytes.java:712)
      at com.sun.grizzly.tcp.Request.getContentLengthLong(Request.java:367)
      at com.sun.grizzly.http.ProcessorTask.prepareRequest(ProcessorTask.java:1350)
      at com.sun.grizzly.http.ProcessorTask.parseRequest(ProcessorTask.java:867)
      at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:659)
      at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954)
      at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170)
      at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)
      at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)
      at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)
      at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
      at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
      at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
      at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
      at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
      at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
      at java.lang.Thread.run(Thread.java:619)

      #]

      It looks like somewhere the file size in bytes is not being kept as a long, since ints cannot store the
      bytesize for files over 2Gb. Can this be fixed in Grizzly? 2Gb is not such a big file size.

      I am using GlassFish v3 and the grizzly installed is the glassfish-grizzly that was released with it.
      Version 1.9.18-9.

        Activity

        Hide
        babbarkrishan added a comment -

        Hi

        Its actually glassfish settings for max size of post data.
        To check, go to admin panel (http://localhost:4848/)
        click on Network Config->Network Listeners->http-listener-1 or http-listener-2.

        Then click on HTTP tab above.
        Here see the value of Max Post Size. It is the max size which can be sent in post.
        Here it is taking integer values which can be maximum 2147483647 (1 less than 2 GB (2147483648 bytes)).
        Which is the reason we can not upload more than 2 GB data.

        I am also trying to make a site which can handle large file uploads and can handle multiple requests concurrently. So far I am not clear how and where grizzly comes in role? What all settings I need to do? How can we test if grizzly is being used and its beneficial?

        I also tried to make a standalone webserver using Grizzly, but i am unable to parse file being uploaded within my HttpHandler.

        Please help me to understand grizzly and share some code for saving uploaded files in grizzly.

        Thanks
        Krishan Babbar

        Show
        babbarkrishan added a comment - Hi Its actually glassfish settings for max size of post data. To check, go to admin panel ( http://localhost:4848/ ) click on Network Config->Network Listeners->http-listener-1 or http-listener-2. Then click on HTTP tab above. Here see the value of Max Post Size. It is the max size which can be sent in post. Here it is taking integer values which can be maximum 2147483647 (1 less than 2 GB (2147483648 bytes)). Which is the reason we can not upload more than 2 GB data. I am also trying to make a site which can handle large file uploads and can handle multiple requests concurrently. So far I am not clear how and where grizzly comes in role? What all settings I need to do? How can we test if grizzly is being used and its beneficial? I also tried to make a standalone webserver using Grizzly, but i am unable to parse file being uploaded within my HttpHandler. Please help me to understand grizzly and share some code for saving uploaded files in grizzly. Thanks Krishan Babbar
        Hide
        Justin Lee added a comment -

        consolidating to one user name

        Show
        Justin Lee added a comment - consolidating to one user name
        Hide
        oleksiys added a comment -

        I've tried to telnet to a port and pass big content-length header and checked that it was parsed correctly.
        Can you pls. do the same check?

        Show
        oleksiys added a comment - I've tried to telnet to a port and pass big content-length header and checked that it was parsed correctly. Can you pls. do the same check?
        Hide
        makoto1337 added a comment -

        I should mention that files just under 2Gb work fine, but files 2Gb and over fail.

        I will be away next week, but after that I will try to copy the HTTP request header for you. Can you upload
        files over 2Gb using Grizzly?

        Show
        makoto1337 added a comment - I should mention that files just under 2Gb work fine, but files 2Gb and over fail. I will be away next week, but after that I will try to copy the HTTP request header for you. Can you upload files over 2Gb using Grizzly?
        Hide
        oleksiys added a comment -

        it shouldn't be related to file size.
        Can you pls. make a dump of HTTP request header?

        Show
        oleksiys added a comment - it shouldn't be related to file size. Can you pls. make a dump of HTTP request header?

          People

          • Assignee:
            oleksiys
            Reporter:
            makoto1337
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: