I have a simple JSP View with audio element:
<audio controls>
<source src="message.mp3" type="audio/mpeg">
</audio>
message.mp3 is about 5 mb and I'm using Spring MVC and tomcat.
unfortunately i'm getting this error if i try to open the view:
ClientAbortException: java.net.SocketException: Software caused connection abort: socket write error at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:361) at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java:437) at org.apache.tomcat.util.buf.ByteChunk.append(ByteChunk.java:351) at org.apache.catalina.connector.OutputBuffer.writeBytes(OutputBuffer.java:384) at org.apache.catalina.connector.OutputBuffer.write(OutputBuffer.java:373) at org.apache.catalina.connector.CoyoteOutputStream.write(CoyoteOutputStream.java:93) at org.springframework.util.StreamUtils.copy(StreamUtils.java:124)
I have no problems with small *.wav files (2,5 mb).
Any help?
EDIT:
All files are accessible and i can download them. It just wont work with html5-audio element. File access is provided by Spring framework i have just defined the Resourcehandler:
@Configuration
@EnableWebMvc
@EnableTransactionManagement
@ComponentScan(basePackages = "test.my.app.*")
public class AppConfiguration extends WebMvcConfigurerAdapter {
//...
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
String loc = "file:/home/dit/files";
registry.addResourceHandler("/resources/audiofiles/**").addResourceLocations(loc);
}
//...
}