grizzly
  1. grizzly
  2. GRIZZLY-1535

CompressionEncodingFilter throws NPE

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.3
    • Fix Version/s: 2.3.4, 3.0
    • Component/s: None
    • Labels:
      None
    • Environment:

      JDK1.7_21x64, Windows2008R2, GF V4.0.1 (b01)

      Description

      GF throws an NPE when delivering the attached file (which is served as "text/plain").

      Compression settings:

      <http default-virtual-server="server" max-connections="250" compressable-mime-type="text/html,text/xml,text/plain,text/css,text/javascript" compression="on">
              <file-cache enabled="false" max-age-seconds="30"></file-cache>
      </http>
      

      Stacktrace;

      [2013-06-28T14:39:56.083+0200] [glassfish 4.0] [WARNING] [] [org.glassfish.grizzly.filterchain.DefaultFilterChain] [tid: _ThreadID=24 _ThreadName=http-listener-1(1)] [timeMillis: 1372423196083] [levelValue: 900] [[
        Exception during FilterChain execution
      java.lang.NullPointerException
      	at org.glassfish.grizzly.http.server.CompressionEncodingFilter.indexOfStartsWith(CompressionEncodingFilter.java:196)
      	at org.glassfish.grizzly.http.server.CompressionEncodingFilter.applyEncoding(CompressionEncodingFilter.java:123)
      	at org.glassfish.grizzly.http.GZipContentEncoding.wantEncode(GZipContentEncoding.java:136)
      	at org.glassfish.grizzly.http.HttpCodecFilter.setContentEncodingsOnSerializing(HttpCodecFilter.java:1666)
      	at org.glassfish.grizzly.http.HttpServerFilter.prepareResponse(HttpServerFilter.java:871)
      	at org.glassfish.grizzly.http.HttpServerFilter.encodeHttpPacket(HttpServerFilter.java:814)
      	at org.glassfish.grizzly.http.HttpCodecFilter.handleWrite(HttpCodecFilter.java:1302)
      	at org.glassfish.grizzly.filterchain.ExecutorResolver$8.execute(ExecutorResolver.java:111)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
      	at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
      	at org.glassfish.grizzly.filterchain.FilterChainContext.write(FilterChainContext.java:853)
      	at org.glassfish.grizzly.filterchain.FilterChainContext.write(FilterChainContext.java:822)
      	at org.glassfish.grizzly.http.io.OutputBuffer.flushBuffer(OutputBuffer.java:1011)
      	at org.glassfish.grizzly.http.io.OutputBuffer.flushBinaryBuffers(OutputBuffer.java:996)
      	at org.glassfish.grizzly.http.io.OutputBuffer.flushAllBuffers(OutputBuffer.java:967)
      	at org.glassfish.grizzly.http.io.OutputBuffer.close(OutputBuffer.java:710)
      	at org.glassfish.grizzly.http.io.OutputBuffer.endRequest(OutputBuffer.java:367)
      	at org.glassfish.grizzly.http.server.Response.finish(Response.java:501)
      	at org.glassfish.grizzly.http.server.HttpServerFilter.afterService(HttpServerFilter.java:317)
      	at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:212)
      	at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
      	at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
      	at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:837)
      	at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)
      	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
      	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
      	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
      	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:565)
      	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:545)
      	at java.lang.Thread.run(Unknown Source)
      ]]
      

      Filename of served file: informationstableau.json

      Content of served file (with Windows-Style line endings CRLF):

      [
      	{
      	"Eintrag":1,
      	"Abteilung":"100",
      	"Gruppe":1,
      	"Name":"Auer",
      	"Surname":"Claudia",
      	"Abwesend":false,
      	"Anwesend":2,
      	"ImageUrl":"icon/bullet_ball_glass_blue.png"
      	},
      	{
      	"Eintrag":2,
      	"Abteilung":"100",
      	"Gruppe":2,
      	"Name":"Böhme",
      	"Surname":"Olaf",
      	"Abwesend":false,
      	"Anwesend":1,
      	"ImageUrl":"icon/bullet_ball_glass_green.png"
      	},
      	{
      	"Eintrag":3,
      	"Abteilung":"100",
      	"Gruppe":1,
      	"Name":"Bieber",
      	"Surname":"Michael",
      	"Abwesend":true,
      	"Anwesend":0,
      	"ImageUrl":"icon/bullet_ball_glass_red.png"
      	},
      	{
      	"Eintrag":4,
      	"Abteilung":"100",
      	"Gruppe":1,
      	"Name":"Schlegel",
      	"Surname":"Jan",
      	"Abwesend":true,
      	"Anwesend":0,
      	"ImageUrl":"icon/bullet_ball_glass_red.png"
      	},
      	{
      	"Eintrag":5,
      	"Abteilung":"100",
      	"Gruppe":2,
      	"Name":"Kutscher",
      	"Surname":"Steffen",
      	"Abwesend":true,
      	"Anwesend":0,
      	"ImageUrl":"icon/bullet_ball_glass_red.png"
      	},
      	{
      	"Eintrag":6,
      	"Abteilung":"100",
      	"Gruppe":1,
      	"Name":"Janisch",
      	"Surname":"Heike",
      	"Abwesend":true,
      	"Anwesend":0,
      	"ImageUrl":"icon/bullet_ball_glass_red.png"
      	},
      	{
      	"Eintrag":7,
      	"Abteilung":"100",
      	"Gruppe":1,
      	"Name":"Petters",
      	"Surname":"Carsten",
      	"Abwesend":true,
      	"Anwesend":0,
      	"ImageUrl":"icon/bullet_ball_glass_red.png"
      	},
      	{
      	"Eintrag":8,
      	"Abteilung":"100",
      	"Gruppe":1,
      	"Name":"Bräunlich",
      	"Surname":"Steffi",
      	"Abwesend":true,
      	"Anwesend":0,
      	"ImageUrl":"icon/bullet_ball_glass_red.png"
      	},
      	{
      	"Eintrag":9,
      	"Abteilung":"100",
      	"Gruppe":1,
      	"Name":"Merz",
      	"Surname":"Tino",
      	"Abwesend":true,
      	"Anwesend":0,
      	"ImageUrl":"icon/bullet_ball_glass_red.png"
      	},
      	{
      	"Eintrag":10,
      	"Abteilung":"100",
      	"Gruppe":2,
      	"Name":"Loerzer",
      	"Surname":"Andreas",
      	"Abwesend":false,
      	"Anwesend":2,
      	"ImageUrl":"icon/bullet_ball_glass_blue.png"
      	},
      	{
      	"Eintrag":11,
      	"Abteilung":"100",
      	"Gruppe":1,
      	"Name":"Bertram",
      	"Surname":"Ludwig",
      	"Abwesend":true,
      	"Anwesend":0,
      	"ImageUrl":"icon/bullet_ball_glass_red.png"
      	},
      	{
      	"Eintrag":12,
      	"Abteilung":"100",
      	"Gruppe":1,
      	"Name":"Müller",
      	"Surname":"Klaus",
      	"Abwesend":true,
      	"Anwesend":0,
      	"ImageUrl":"icon/bullet_ball_glass_red.png"
      	},
      	{
      	"Eintrag":13,
      	"Abteilung":"100",
      	"Gruppe":1,
      	"Name":"Krell",
      	"Surname":"Tino",
      	"Abwesend":true,
      	"Anwesend":0,
      	"ImageUrl":"icon/bullet_ball_glass_red.png"
      	},
      	{
      	"Eintrag":14,
      	"Abteilung":"100",
      	"Gruppe":1,
      	"Name":"Neubert",
      	"Surname":"Constanze",
      	"Abwesend":true,
      	"Anwesend":0,
      	"ImageUrl":"icon/bullet_ball_glass_red.png"
      	},
      	{
      	"Eintrag":15,
      	"Abteilung":"101",
      	"Gruppe":2,
      	"Name":"Lahmann",
      	"Surname":"Hans",
      	"Abwesend":true,
      	"Anwesend":0,
      	"ImageUrl":"icon/bullet_ball_glass_red.png"
      	},
      	{
      	"Eintrag":16,
      	"Abteilung":"100",
      	"Gruppe":1,
      	"Name":"Liessem",
      	"Surname":"Thomas",
      	"Abwesend":false,
      	"Anwesend":3,
      	"ImageUrl":"icon/bullet_ball_glass_yellow.png"
      	},
      	{
      	"Eintrag":17,
      	"Abteilung":"101",
      	"Gruppe":1,
      	"Name":"Wenzel",
      	"Surname":"Ralf",
      	"Abwesend":true,
      	"Anwesend":0,
      	"ImageUrl":"icon/bullet_ball_glass_red.png"
      	},
      	{
      	"Eintrag":18,
      	"Abteilung":"101",
      	"Gruppe":1,
      	"Name":"Adrian",
      	"Surname":"Heiko",
      	"Abwesend":true,
      	"Anwesend":0,
      	"ImageUrl":"icon/bullet_ball_glass_red.png"
      	},
      	{
      	"Eintrag":19,
      	"Abteilung":"100",
      	"Gruppe":1,
      	"Name":"Benduhn",
      	"Surname":"Heike",
      	"Abwesend":true,
      	"Anwesend":0,
      	"ImageUrl":"icon/bullet_ball_glass_red.png"
      	},
      	{
      	"Eintrag":20,
      	"Abteilung":"100",
      	"Gruppe":2,
      	"Name":"Nuhr",
      	"Surname":"Dieter",
      	"Abwesend":true,
      	"Anwesend":0,
      	"ImageUrl":"icon/bullet_ball_glass_red.png"
      	},
      	{
      	"Eintrag":21,
      	"Abteilung":"100",
      	"Gruppe":1,
      	"Name":"Schubert",
      	"Surname":"Olaf",
      	"Abwesend":true,
      	"Anwesend":0,
      	"ImageUrl":"icon/bullet_ball_glass_red.png"
      	},
      	{
      	"Eintrag":22,
      	"Abteilung":"100",
      	"Gruppe":1,
      	"Name":"Kahlert",
      	"Surname":"Inge",
      	"Abwesend":true,
      	"Anwesend":0,
      	"ImageUrl":"icon/bullet_ball_glass_red.png"
      	},
      	{
      	"Eintrag":23,
      	"Abteilung":"100",
      	"Gruppe":1,
      	"Name":"Siebert",
      	"Surname":"Patricia",
      	"Abwesend":true,
      	"Anwesend":0,
      	"ImageUrl":"icon/bullet_ball_glass_red.png"
      	},
      	{
      	"Eintrag":24,
      	"Abteilung":"100",
      	"Gruppe":1,
      	"Name":"Wolf",
      	"Surname":"Jochen",
      	"Abwesend":true,
      	"Anwesend":0,
      	"ImageUrl":"icon/bullet_ball_glass_red.png"
      	},
      	{
      	"Eintrag":25,
      	"Abteilung":"101",
      	"Gruppe":2,
      	"Name":"Goll",
      	"Surname":"Peter",
      	"Abwesend":true,
      	"Anwesend":0,
      	"ImageUrl":"icon/bullet_ball_glass_red.png"
      	},
      	{
      	"Eintrag":26,
      	"Abteilung":"100",
      	"Gruppe":1,
      	"Name":"Berger",
      	"Surname":"Lutz",
      	"Abwesend":false,
      	"Anwesend":3,
      	"ImageUrl":"icon/bullet_ball_glass_yellow.png"
      	},
      	{
      	"Eintrag":27,
      	"Abteilung":"101",
      	"Gruppe":1,
      	"Name":"Thormann",
      	"Surname":"Pierre",
      	"Abwesend":true,
      	"Anwesend":0,
      	"ImageUrl":"icon/bullet_ball_glass_red.png"
      	},
      	{
      	"Eintrag":28,
      	"Abteilung":"101",
      	"Gruppe":1,
      	"Name":"Becker",
      	"Surname":"Heiko",
      	"Abwesend":true,
      	"Anwesend":0,
      	"ImageUrl":"icon/bullet_ball_glass_red.png"
      	}
      
      ]
      

        Activity

        Hide
        zdila added a comment -

        I still have this issue in "GlassFish Server Open Source Edition 4.0 (build 89)".

        BTW if client uses "Accept-Encoding: identity" then for the same URL I get correctly 204 No Content.

        Is it possible that this fix has not been released yet in GF 4 build 89? Just asking because it is more than 5 months since this fix. Thanks.

        Show
        zdila added a comment - I still have this issue in "GlassFish Server Open Source Edition 4.0 (build 89)". BTW if client uses "Accept-Encoding: identity" then for the same URL I get correctly 204 No Content. Is it possible that this fix has not been released yet in GF 4 build 89? Just asking because it is more than 5 months since this fix. Thanks.
        Hide
        oleksiys added a comment -

        Hi,

        unfortunately we fixed this issue after Glassfish 4 release.
        Here is the patch you can use to fix this problem.

        https://dl.dropboxusercontent.com/u/7319744/nucleus-grizzly-all.jar

        Don't forget to clean osgi cache.

        WBR,
        Alexey.

        Show
        oleksiys added a comment - Hi, unfortunately we fixed this issue after Glassfish 4 release. Here is the patch you can use to fix this problem. https://dl.dropboxusercontent.com/u/7319744/nucleus-grizzly-all.jar Don't forget to clean osgi cache. WBR, Alexey.
        Hide
        slominskir added a comment -

        This seems to be a regression because I am attempting to upgrade to GlassFish version 4 from version 3.1.2.2 and this used to work. It seems another workaround is to simply turn off compression until a newer version of GlassFish comes out.

        Show
        slominskir added a comment - This seems to be a regression because I am attempting to upgrade to GlassFish version 4 from version 3.1.2.2 and this used to work. It seems another workaround is to simply turn off compression until a newer version of GlassFish comes out.
        Hide
        oleksiys added a comment -

        pls. try the patch linked in the prev. post.

        Show
        oleksiys added a comment - pls. try the patch linked in the prev. post.
        Hide
        bnaderi added a comment - - edited

        More or less similar problem by GF 4 build 89.
        When asking for a response larger than 16k the response was incomplete (it happens in browsers i.e. Firefox NOT by using wget 1.6).
        Compression was on in the server configuration.

        Applying the patch has solved the problem.
        Thanks a lot!

        Show
        bnaderi added a comment - - edited More or less similar problem by GF 4 build 89. When asking for a response larger than 16k the response was incomplete (it happens in browsers i.e. Firefox NOT by using wget 1.6). Compression was on in the server configuration. Applying the patch has solved the problem. Thanks a lot!

          People

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

            Dates

            • Created:
              Updated:
              Resolved: