Spring Boot视频206 Partial Content下载出问题总结
2017-09-07 10:25
1081 查看
Spring Boot视频206 Partial Content下载出问题总结
查找这个问题花了整整两个白天现象:下载其他资源正常,只有下载大文件视频,H5标签video下面206 Partial Content时候,会出现问题
。表现为只有第一个包下载成功,后续包无法下载。 版本spring boot 1.5.3.release Spring MVC
4.3.8.release。静态资源调用路径ResourceRegionHttpMessageConverter.writeInternal方法–>writeResourceRegion方法的in.close时候返回有异常在DispatcherServlet
936行mv = ha.handle(processedRequest, response,
mappedHandler.getHandler()); 抛出异常 在937行dispatchException =
ex;被catch住,但是没有抛出。异常为java.io.ioexception:您的主机中的软件中止了一个已建立的连接
寻找问题途径:直接忽略走的弯路,说起作用的寻找方法,先使用空白spring
boot项目放入视频文件测试,下载良好,怀疑是引入的jar包对spring
boot产生影响。手动将所有jar包scope设置为test,还是无效,确定不是依赖的jar包问题,最终问题定位到resouce引用(因为java文件中有mybatis的xml配置文件,因此需要配置resources标签把xml也打包),并且因为使用maven的profile,需要做过滤,但视频文件没有设置为不需要替换。
解决方法:将视频文件目录在替换配置放入exclude,并且新建一个不需要替换的项,包含进去,问题解决!
具体原因,还是要仔细学习研究,等有时间的时候我来调试不全问题原因。
<resources> <resource> <directory>src/main/resources</directory> <filtering>true</filtering> <excludes> <exclude>static/css/font/**</exclude> <exclude>static/video/**</exclude> </excludes> </resource> <resource> <directory>src/main/resources</directory> <filtering>false</filtering> <includes> <include>static/css/font/**</include> <include>static/video/**</include> </includes> </resource> <resource> <directory>src/main/java</directory> <includes> <include>**/*.xml</include> </includes> </resource> </resources>
相关文章推荐
- 自己用springboot+mybatis+easyui写的个人管理系统遇到的问题总结
- Spring Boot学习总结(6)——SpringBoot解决ajax跨域请求问题的配置
- springboot + jpa 报错问题总结。转自别人的帖子。
- spring boot + maven + mybatis 学习过程遇到问题总结(1)
- springboot_04,集成redis问题总结
- Spring boot 打成jar包问题总结
- springboot项目配置多环境打包部署遇到的问题总结
- Springboot问题总结
- Spring Boot+JPA+Mysql+ThymeLeaf快速构建CURD系统(五)源码下载地址以及总结
- spring boot 1.5.6 配置mybaits-plus 多模块配置 ,出现的问题 总结
- Spring boot 打成jar包问题总结
- BUI+Springboot,问题总结
- Spring boot 打成jar包问题总结
- Spring Boot问题总结
- 关于利用浏览器下载网络视频文件的问题总结
- SpringBoot+Mybatis学习Demo问题总结1
- Spring boot 打成jar包问题总结
- spring-boot问题总结手册
- spring-boot常见问题总结
- springboot,feign上传超大文件,超时等问题解决方案