java.lang.IllegalArgumentException: New capacity must not be smaller than current size

Spring JIRA | Neeraj A Khadakkar | 1 year ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    This appears to be regression of issue 11717, where attempting to calculate Etag for jsp's which include other tags throws following exception : SEVERE: Exception initializing page context java.lang.IllegalArgumentException: New capacity must not be smaller than current size at org.springframework.util.Assert.isTrue(Assert.java:68) at org.springframework.util.FastByteArrayOutputStream.resize(FastByteArrayOutputStream.java:265) at org.springframework.web.util.ContentCachingResponseWrapper.setBufferSize(ContentCachingResponseWrapper.java:143) at javax.servlet.ServletResponseWrapper.setBufferSize(ServletResponseWrapper.java:189) at javax.servlet.ServletResponseWrapper.setBufferSize(ServletResponseWrapper.java:189) at javax.servlet.ServletResponseWrapper.setBufferSize(ServletResponseWrapper.java:189) at javax.servlet.ServletResponseWrapper.setBufferSize(ServletResponseWrapper.java:189) at javax.servlet.ServletResponseWrapper.setBufferSize(ServletResponseWrapper.java:189) at javax.servlet.ServletResponseWrapper.setBufferSize(ServletResponseWrapper.java:189) at javax.servlet.ServletResponseWrapper.setBufferSize(ServletResponseWrapper.java:189) at javax.servlet.ServletResponseWrapper.setBufferSize(ServletResponseWrapper.java:189) at org.apache.jasper.runtime.JspWriterImpl.<init>(JspWriterImpl.java:138) at org.apache.jasper.runtime.PageContextImpl._initialize(PageContextImpl.java:206) at org.apache.jasper.runtime.PageContextImpl.initialize(PageContextImpl.java:174) at org.apache.jasper.runtime.JspFactoryImpl.internalGetPageContext(JspFactoryImpl.java:174) at org.apache.jasper.runtime.JspFactoryImpl.getPageContext(JspFactoryImpl.java:123)

    Spring JIRA | 1 year ago | Neeraj A Khadakkar
    java.lang.IllegalArgumentException: New capacity must not be smaller than current size
  2. 0

    This appears to be regression of issue 11717, where attempting to calculate Etag for jsp's which include other tags throws following exception : SEVERE: Exception initializing page context java.lang.IllegalArgumentException: New capacity must not be smaller than current size at org.springframework.util.Assert.isTrue(Assert.java:68) at org.springframework.util.FastByteArrayOutputStream.resize(FastByteArrayOutputStream.java:265) at org.springframework.web.util.ContentCachingResponseWrapper.setBufferSize(ContentCachingResponseWrapper.java:143) at javax.servlet.ServletResponseWrapper.setBufferSize(ServletResponseWrapper.java:189) at javax.servlet.ServletResponseWrapper.setBufferSize(ServletResponseWrapper.java:189) at javax.servlet.ServletResponseWrapper.setBufferSize(ServletResponseWrapper.java:189) at javax.servlet.ServletResponseWrapper.setBufferSize(ServletResponseWrapper.java:189) at javax.servlet.ServletResponseWrapper.setBufferSize(ServletResponseWrapper.java:189) at javax.servlet.ServletResponseWrapper.setBufferSize(ServletResponseWrapper.java:189) at javax.servlet.ServletResponseWrapper.setBufferSize(ServletResponseWrapper.java:189) at javax.servlet.ServletResponseWrapper.setBufferSize(ServletResponseWrapper.java:189) at org.apache.jasper.runtime.JspWriterImpl.<init>(JspWriterImpl.java:138) at org.apache.jasper.runtime.PageContextImpl._initialize(PageContextImpl.java:206) at org.apache.jasper.runtime.PageContextImpl.initialize(PageContextImpl.java:174) at org.apache.jasper.runtime.JspFactoryImpl.internalGetPageContext(JspFactoryImpl.java:174) at org.apache.jasper.runtime.JspFactoryImpl.getPageContext(JspFactoryImpl.java:123)

    Spring JIRA | 1 year ago | Neeraj A Khadakkar
    java.lang.IllegalArgumentException: New capacity must not be smaller than current size

    1 unregistered visitors

    Root Cause Analysis

    1. java.lang.IllegalArgumentException

      New capacity must not be smaller than current size

      at org.springframework.util.Assert.isTrue()
    2. Spring Core
      FastByteArrayOutputStream.resize
      1. org.springframework.util.Assert.isTrue(Assert.java:68)
      2. org.springframework.util.FastByteArrayOutputStream.resize(FastByteArrayOutputStream.java:265)
      2 frames
    3. Spring
      ContentCachingResponseWrapper.setBufferSize
      1. org.springframework.web.util.ContentCachingResponseWrapper.setBufferSize(ContentCachingResponseWrapper.java:143)
      1 frame
    4. JavaServlet
      ServletResponseWrapper.setBufferSize
      1. javax.servlet.ServletResponseWrapper.setBufferSize(ServletResponseWrapper.java:189)
      2. javax.servlet.ServletResponseWrapper.setBufferSize(ServletResponseWrapper.java:189)
      3. javax.servlet.ServletResponseWrapper.setBufferSize(ServletResponseWrapper.java:189)
      4. javax.servlet.ServletResponseWrapper.setBufferSize(ServletResponseWrapper.java:189)
      5. javax.servlet.ServletResponseWrapper.setBufferSize(ServletResponseWrapper.java:189)
      6. javax.servlet.ServletResponseWrapper.setBufferSize(ServletResponseWrapper.java:189)
      7. javax.servlet.ServletResponseWrapper.setBufferSize(ServletResponseWrapper.java:189)
      8. javax.servlet.ServletResponseWrapper.setBufferSize(ServletResponseWrapper.java:189)
      8 frames
    5. GWT dev
      JspFactoryImpl.getPageContext
      1. org.apache.jasper.runtime.JspWriterImpl.<init>(JspWriterImpl.java:138)
      2. org.apache.jasper.runtime.PageContextImpl._initialize(PageContextImpl.java:206)
      3. org.apache.jasper.runtime.PageContextImpl.initialize(PageContextImpl.java:174)
      4. org.apache.jasper.runtime.JspFactoryImpl.internalGetPageContext(JspFactoryImpl.java:174)
      5. org.apache.jasper.runtime.JspFactoryImpl.getPageContext(JspFactoryImpl.java:123)
      5 frames