org.glassfish.grizzly.http.util.MimeHeaders$MaxHeaderCountExceededException: Illegal attempt to exceed the configured maximum number of headers: 100

  1. 0

    Enabling Jersey trace logging causes MaxHeaderCountExceededException

    Stack Overflow | 3 months ago | Martin Charlesworth
    org.glassfish.grizzly.http.util.MimeHeaders$MaxHeaderCountExceededException: Illegal attempt to exceed the configured maximum number of headers: 100

    Root Cause Analysis

    1. org.glassfish.grizzly.http.util.MimeHeaders$MaxHeaderCountExceededException

      Illegal attempt to exceed the configured maximum number of headers: 100

      at org.glassfish.grizzly.http.util.MimeHeaders.createHeader()
    2. grizzly-http
      HttpHeader.addHeader
      1. org.glassfish.grizzly.http.util.MimeHeaders.createHeader(MimeHeaders.java:396)
      2. org.glassfish.grizzly.http.util.MimeHeaders.addValue(MimeHeaders.java:422)
      3. org.glassfish.grizzly.http.HttpHeader.addHeader(HttpHeader.java:707)
      3 frames
    3. Grizzly Server
      Response.addHeader
      1. org.glassfish.grizzly.http.server.Response.addHeader(Response.java:1177)
      1 frame
    4. Glassfish Core
      ResponseFacade.addHeader
      1. org.apache.catalina.connector.Response.addHeader(Response.java:1221)
      2. org.apache.catalina.connector.ResponseFacade.addHeader(ResponseFacade.java:579)
      2 frames
    5. jersey-container-servlet-core
      ResponseWriter.writeResponseStatusAndHeaders
      1. org.glassfish.jersey.servlet.internal.ResponseWriter.writeResponseStatusAndHeaders(ResponseWriter.java:165)
      1 frame
    6. jersey-core-server
      ServerRuntime$Responder$1.getOutputStream
      1. org.glassfish.jersey.server.ServerRuntime$Responder$1.getOutputStream(ServerRuntime.java:701)
      1 frame
    7. Jersey Core
      OutboundMessageContext.close
      1. org.glassfish.jersey.message.internal.CommittingOutputStream.commitStream(CommittingOutputStream.java:200)
      2. org.glassfish.jersey.message.internal.CommittingOutputStream.flushBuffer(CommittingOutputStream.java:305)
      3. org.glassfish.jersey.message.internal.CommittingOutputStream.commit(CommittingOutputStream.java:261)
      4. org.glassfish.jersey.message.internal.CommittingOutputStream.close(CommittingOutputStream.java:276)
      5. org.glassfish.jersey.message.internal.OutboundMessageContext.close(OutboundMessageContext.java:839)
      5 frames
    8. jersey-core-server
      ServerRuntime$2.run
      1. org.glassfish.jersey.server.ContainerResponse.close(ContainerResponse.java:412)
      2. org.glassfish.jersey.server.ServerRuntime$Responder.writeResponse(ServerRuntime.java:784)
      3. org.glassfish.jersey.server.ServerRuntime$Responder.processResponse(ServerRuntime.java:444)
      4. org.glassfish.jersey.server.ServerRuntime$Responder.process(ServerRuntime.java:434)
      5. org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:329)
      5 frames