We are trying to use response.outputStream in Grails 3.3.0 under Tomcat 7.0.57. However, when any bytes are written to the stream, we get this error:
org.springframework.web.util.NestedServletException: Handler dispatch failed; nested exception is java.lang.NoClassDefFoundError: javax/servlet/WriteListener
This seems to come from the 3.1 Servlet spec? But Tomcat 7 doesn't support 3.1, only 3.0. However, we've targeted the Grails app to the Tomcat version we are deploying to by doing this in dependencies:
provided "org.springframework.boot:spring-boot-starter-tomcat"
And this, later in the build.gradle file:
war {
ext['tomcat.version'] = '7.0.57'
}
Anything else to try?