I want to prevent the SocketTimeoutException
that occurs after about 1 minute if a user tries to upload a large file from an upload form in my Grails web application. I know this is a Tomcat thing rather than a Grails thing, but I'm struggling a bit to modify server.xml
using the eventConfigureTomcat
event block in _Events.groovy
.
According to the tomcat docs there is a disableUploadTimeout
property that I should set to true
on the connector, but when I try this in the eventConfigureTomcat
block, I get the following error when my app starts up:
| Running Grails application
| Error Server failed to start: No such property: disableUploadTimeout for class: org.apache.catalina.connector.Connector (Use --stacktrace to see the full trace)
The contents of my _Events.groovy
looks like this:
eventConfigureTomcat = { tomcat ->
tomcat.connector.disableUploadTimeout = "true"
}
And that error does make sense - according to the javadoc, there is no property disableUploadTimeout
on that connector implementation.
What am I doing wrong? How should I be setting this property, or is there some other way to prevent long running file uploads from timing out?