-
1. Re: Wildfly 9.0.2 increasing max-post-size
jaysensharma Dec 17, 2015 10:10 AM (in response to ganeshment)Hello Ganesh,
Please use the following CLI command :
/subsystem=undertow/server=default-server/http-listener=default/:write-attribute(name=max-post-size,value=25485760)
Generated XML config in your WildFly profile:
<subsystem xmlns="urn:jboss:domain:undertow:3.0"> <buffer-cache name="default"/> <server name="default-server"> <http-listener name="default" max-post-size="25485760" redirect-socket="https" socket-binding="http"/> <!-- NOTICE max-post-size="25485760" --> <host name="default-host" alias="localhost"> <location name="/" handler="welcome-content"/> <filter-ref name="server-header"/> <filter-ref name="x-powered-by-header"/> </host> </server> . . </subsystem>
See: http://wildscribe.github.io/Wildfly/8.0.0.Final/subsystem/undertow/server/http-listener/index.html
- max-post-size The maximum size of a post that will be accepted
Attribute Value Default Value 10485760 Type LONG Nillable true Expressions Allowed true Regards
Jay SenSharma
-
2. Re: Wildfly 9.0.2 increasing max-post-size
ganeshment Dec 17, 2015 11:12 AM (in response to jaysensharma)My question is at present it does not allow any value larger than integer max value (does not allow mean even though I set it in standalone.xml while starting the server it fails with integer range validation error).
Our requirement is to configure a value larger than integer max so we have made the required changes to use Long range validator. It is working but want to make sure this is the right approach.
-
3. Re: Wildfly 9.0.2 increasing max-post-size
ganeshment Dec 30, 2015 4:42 PM (in response to ganeshment)As most of the documents specify max-post-size type as LONG
but when looked at the code in org.jboss.as.web.WebConnectorDefinition.java, max-post-size type is INT
-
4. Re: Wildfly 9.0.2 increasing max-post-size
jaikiran Dec 30, 2015 11:15 PM (in response to ganeshment)Can you try this against the recently released 10.0.0 CR5 and see if it works there? If it doesn't, please post the configuration file you are using and also the complete exception stacktrace.
-
5. Re: Wildfly 9.0.2 increasing max-post-size
ganeshment Jan 1, 2016 1:16 PM (in response to ganeshment)I have looked into 10 CR5 code and it is also using Integer type and validator.
protected static final SimpleAttributeDefinition MAX_POST_SIZE = new SimpleAttributeDefinitionBuilder(Constants.MAX_POST_SIZE, ModelType.INT) .setAllowNull(true) .setValidator(new IntRangeValidator(0, true)) .setFlags(AttributeAccess.Flag.RESTART_ALL_SERVICES) .setDefaultValue(new ModelNode(2097152)) .setAllowExpression(true) .build(); I will post stack trace on Monday
-
6. Re: Wildfly 9.0.2 increasing max-post-size
ctomc Jan 4, 2016 5:27 AM (in response to ganeshment)well, the code in WebConnectorDefintion is used by legacy web subsystem and it is not shared by undertow subsystem.
For undertow subsystem it is defined here:
wildfly/ListenerResourceDefinition.java at master · wildfly/wildfly · GitHub
which uses undertow/UndertowOptions.java at master · undertow-io/undertow · GitHub as definition of the attribute.
and as you can see it is long.
-
7. Re: Wildfly 9.0.2 increasing max-post-size
ganeshment Jan 9, 2016 7:42 PM (in response to ctomc)We were setting same value to max-header-size and max-post-size and were getting Integer validation error. Copy paste problem.
max-header-size is Int type and we don't have requirement to set it to large value.
After correction we are able to work with files greater than 2.14GB.
Iam marking this post as answered
-
8. Re: Wildfly 9.0.2 increasing max-post-size
a.bader Sep 8, 2016 5:15 PM (in response to ganeshment)Is there any way to setup the max-pool-size (independent of integer / long -> I use only 100MB but not only 10MB) programmatically or in web.xml?
I should be able to build a .war file containing this setting rather than needing modifs in standalone.xml / using the CLI.
-
9. Re: Wildfly 9.0.2 increasing max-post-size
clairton.rodrigo.heinzen Mar 21, 2017 11:54 AM (in response to a.bader)Hello
I Solved this.
I create META-INF/services/io.undertow.servlet.ServletExtension and put "IncreasePostSizeServletExtension" for this implemations
import javax.servlet.ServletContext;
import io.undertow.server.HandlerWrapper;
import io.undertow.server.HttpHandler;
import io.undertow.servlet.ServletExtension;
import io.undertow.servlet.api.DeploymentInfo;
public class IncreasePostSizeServletExtension implements ServletExtension {
@Override
public void handleDeployment(final DeploymentInfo deployment, final ServletContext context) {
deployment.addInitialHandlerChainWrapper(new HandlerWrapper() {
@Override
public HttpHandler wrap(final HttpHandler handler) {
return new IncreasePostSizeHandlerDecorator(handler);
}
});
}
}
public class IncreasePostSizeHandlerDecorator implements HttpHandler{
private final HttpHandler delegate;
public IncreasePostSizeHandlerDecorator(final HttpHandler delegate) {
super();
this.delegate = delegate;
}
@Override
public void handleRequest(final HttpServerExchange exchange) throws Exception {
delegate.handleRequest(exchange);
exchange.setMaxEntitySize(61644800l);
}
}
-
10. Re: Wildfly 9.0.2 increasing max-post-size
clairton.rodrigo.heinzen Jun 21, 2017 3:20 PM (in response to clairton.rodrigo.heinzen)This library will resolve GitHub - clairton/undertow-max-entity-size-handler