2

I'm at the tail-end of the painful process of updating a JBoss 5 install to JBoss 6.1.0.Alpha. This issue doesn't exist in the JBoss 5 install.

Versions:

  • Spring 3.2.3.RELEASE
  • JBoss EAP 6.1.0.Alpha1 (AS7.2.0.Alpha1-redhat-4)
  • Apache 2.2 with mod_proxy

The controller hierarchy is still using the old org.springframework.web.servlet.mvc.SimpleFormController as the base controller.

When posting a large set of form data (not huge; 326 rows of a table), the domain objects which appear in the controller (re-hydrated via MVC marshalling) have been truncated - not all of them appear. As seen in the debugger as well as the resulting partially updated screen.

All the data can be seen in Chrome going up in the form data inside the post, as Content-Type:application/x-www-form-urlencoded.

However at the server, the objects which Spring Web MVC has created from the posted data stop at around 246. It is as if some upper limit has been hit and the data has simply been truncated at that point.

Note this does not appear to be the "dot in the path bug". I have added this config to no avail:

<bean class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping">
    <property name="useDefaultSuffixPattern" value="false" />
</bean>

I have tried deleting a few items either side of where the cut-off occurs (243 to 249) in case there's something odd in the data, but doing so still results in ~246 items arriving in the controller.

The JBoss HTTP connector has been configured to allow a maximum of 100mb, and even 1000mb for a post (massively larger than the data being posted).

My suspicion is that this is a Spring configuration issue but I've dug through the documentation and come up dry.

EDIT:

Spring MVC seems to be innocent. Using Eclipse, I've dug back through the call-stack at runtime to find the earliest call where I can see the request:

Earliest call in the stack with a request

Then selected the request variable -> right click -> Edit Detail Formatter...

Added this code using System.out (since output to the debug UI gets truncated by Eclipse):

java.util.Enumeration paramNames = getParameterNames();
    while (paramNames.hasMoreElements()) {
    System.out.println(paramNames.nextElement());
}

Which outputs all the parameters that the Request object has got.

Sure enough, the "selected" attributes (each row in the form must be selected to have any affect on this screen) stop dead at 245 (I've sorted the output here):

itemSearchFilter.results[244].selected
itemSearchFilter.results[245].selected
itemSearchFilter.results[24].selected
itemSearchFilter.results[25].selected

So this is looking like a configuration issue between Apache and JBoss because, as far as I know, Spring hasn't yet had a chance to interact with this Request instance (it certainly doesn't look like it from the call-stack shown above).

Here's the mod_proxy config from Apache http.conf

<IfModule mod_proxy.c>
    ProxyRequests Off
    <Proxy *>
        AddDefaultCharset off
        Order deny,allow
        Allow from all
    </Proxy>
    ProxyVia On
    ProxyPass /a-mgt http://localhost:8080/a-mgt
    ProxyPassReverse /a-mgt http://localhost:8080/a-mgt
</IfModule>

Here's the HTTP Connector config from JBoss standalone-full.xml

    <subsystem xmlns="urn:jboss:domain:web:1.4" default-virtual-server="default-host" native="false">
        <configuration>
            <jsp-configuration development="true" check-interval="1"
                            modification-test-interval="1" recompile-on-fail="true"/>
        </configuration>
        <connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http"
                            max-post-size="1048576000" max-save-post-size="0" max-connections="1000"/>
        <virtual-server name="default-host" enable-welcome-root="true">
            <alias name="localhost"/>
        </virtual-server>
    </subsystem>

   <subsystem xmlns="urn:jboss:domain:threads:1.1">
        <bounded-queue-thread-pool name="http-executor">
            <core-threads count="100"/>
            <queue-length count="10"/>
            <max-threads count="1000"/>
            <keepalive-time time="20" unit="seconds"/>
        </bounded-queue-thread-pool>
    </subsystem>

    <socket-binding-group name="standard-sockets"
                    default-interface="public"
                    port-offset="${jboss.socket.binding.port-offset:0}">
            <socket-binding name="http" port="8080"/>
    </socket-binding-group>
Community
  • 1
  • 1
RedYeti
  • 1,024
  • 14
  • 28
  • Are the domain objects rehydrated from the database? If so, have you checked whether there's a `maxResults` or `fetchSize` setting in play somewhere in the config or DAO code which could be truncating the data? Perhaps a settings change could have crept in when migrating from JBoss 5 to JBoss 6? – Will Keeling Oct 16 '13 at 10:16
  • Sorry @WillKeeling but you're thinking of this the wrong way around - the objects are created by Spring MVC as the arrive back from the posted form. There's no DB interaction in this problem. Thanks for the suggestion though! – RedYeti Oct 16 '13 at 10:26

1 Answers1

0

It turns out that there's a limit on the number of HTTP parameters used by the JBoss HTTP connector which, frustratingly, isn't configurable via the XML snippet I put in the question.

Instead it must be added to standalong-full.xml as a system property:

...
</extensions>

<system-properties>
    <property name="org.apache.tomcat.util.http.Parameters.MAX_COUNT" value="5000"/>
</system-properties>

<management>
...

Why that is not configurable from the HTTP Connector or at the very least documented on there...

I found the solution on this JBoss Community thread.

RedYeti
  • 1,024
  • 14
  • 28