1

I’m using Spring 3.2.11.RELEASE with JBoss 7.1.3.Final. I’m building a WAR file and I have a page that submits a form with more than 512 parameters. Upon doing so, I get the below exception …

20:05:03,905 ERROR [org.mainco.springboard.session.util.SessionHelper] (ajp-/127.0.0.1:8009-29) More than the maximum number of request parameters (GET plus POST) for a single request ([512]) were detected. Any parameters beyond this limit have been ignored. To change this limit, set the maxParameterCount attribute on the Connector.: java.lang.IllegalStateException: More than the maximum number of request parameters (GET plus POST) for a single request ([512]) were detected. Any parameters beyond this limit have been ignored. To change this limit, set the maxParameterCount attribute on the Connector.
        at org.apache.tomcat.util.http.Parameters.addParameter(Parameters.java:199) [jbossweb-7.0.17.Final.jar:]
        at org.apache.tomcat.util.http.Parameters.processParameters(Parameters.java:383) [jbossweb-7.0.17.Final.jar:]
        at org.apache.tomcat.util.http.Parameters.processParameters(Parameters.java:229) [jbossweb-7.0.17.Final.jar:]
        at org.apache.catalina.connector.Request.parseParameters(Request.java:2874) [jbossweb-7.0.17.Final.jar:]
        at org.apache.catalina.connector.Request.getParameter(Request.java:1291) [jbossweb-7.0.17.Final.jar:]
        at org.apache.catalina.connector.RequestFacade.getParameter(RequestFacade.java:363) [jbossweb-7.0.17.Final.jar:]
        at javax.servlet.ServletRequestWrapper.getParameter(ServletRequestWrapper.java:180) [jboss-servlet-api_3.0_spec-1.0.1.Final.jar:1.0.1.Final]
        at org.mainco.springboard.session.util.SessionHelper.getSessionId(SessionHelper.java:48) [core-88.0.0.jar:]
        at org.mainco.springboard.core.security.SpringboardSecurityContextRepository.loadContext(SpringboardSecurityContextRepository.java:69) [core-88.0.0.jar:]
        at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:82) [spring-security-web-3.2.9.RELEASE.jar:3.2.9.RELEASE]
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) [spring-security-web-3.2.9.RELEASE.jar:3.2.9.RELEASE]
        at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192) [spring-security-web-3.2.9.RELEASE.jar:3.2.9.RELEASE]
        at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160) [spring-security-web-3.2.9.RELEASE.jar:3.2.9.RELEASE]
        at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343) [spring-web-3.2.11.RELEASE.jar:3.2.11.RELEASE]
        at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260) [spring-web-3.2.11.RELEASE.jar:3.2.11.RELEASE]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.17.Final.jar:]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.17.Final.jar:]
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.17.Final.jar:]
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.17.Final.jar:]
        at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:165) [jboss-as-web-7.1.3.Final.jar:7.1.3.Final]
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) [jbossweb-7.0.17.Final.jar:]
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.17.Final.jar:]
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.17.Final.jar:]
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:372) [jbossweb-7.0.17.Final.jar:]
        at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:505) [jbossweb-7.0.17.Final.jar:]
        at org.apache.coyote.ajp.AjpProtocol$AjpConnectionHandler.process(AjpProtocol.java:453) [jbossweb-7.0.17.Final.jar:]
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:931) [jbossweb-7.0.17.Final.jar:]
        at java.lang.Thread.run(Thread.java:680) [rt.jar:1.6.0_65]

I’ve tried to add this param into my Spring context …

<bean id="systemPrereqs"
    class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
    <property name="targetObject" value="#{@systemProperties}" />
    <property name="targetMethod" value="putAll" />
    <property name="arguments">
        <!-- The new Properties -->
        <util:properties>
            <prop key="org.apache.tomcat.util.http.Parameters.MAX_COUNT">1024</prop>
        </util:properties>
    </property>
</bean>

However, despite having this in my application, I still get the above error. How can I make this problem go away by making application changes? This question focusses on getting this to work by making application changes so if there are solutions involving re-configuring JBoss, that is good to know but that is not the question I’m asking here.

Dave
  • 15,639
  • 133
  • 442
  • 830
  • 1
    So you have a single tomcat, possible multiple apps and you want apps to reconfigure the single tomcat instance. That is basically what you are asking. Even if it would work you would possibly be interfering with all other applications. And aren't 512 parameters a bit much, maybe refactor the form? – M. Deinum Feb 02 '16 at 06:18

1 Answers1

0

You need to add this to JBoss configuration (standalone.xml), not Spring context.

</extensions>

    <system-properties>
       <property name="org.apache.tomcat.util.bla.bla" value="nnn"/>
    </system-properties>

<management>

Look here: http://www.javaquery.com/2013/12/javalangillegalstateexception-more-than.html

m.aibin
  • 3,528
  • 4
  • 28
  • 47
  • 1
    When I said "This question focusses on getting this to work by making application changes so if there are solutions involving re-configuring JBoss, that is good to know but that is not the question I’m asking here", how could I have phrased that differently to express that I do not want ot make JBoss configurations but would like to solve this in the application only? – Dave Feb 01 '16 at 21:55