1.最近在做一个文档管理的功能,遇到的问题是上传的音频文件播放时遇到的,音频播放前端用的是audiojs,由于上传的文件没有放在项目目录下,请求是用struts action 返回的OutputStream.
2.出现的问题:前端请求了三次,后台报错,错误信息如下:
2016-09-02 12:04:57 INFO [http-bio-8080-exec-22] - saveName:af240eda1e9b78341b42b0ca555bfc04.mp3
2016-09-02 12:04:57 INFO [http-bio-8080-exec-39] - saveName:af240eda1e9b78341b42b0ca555bfc04.mp3
2016-09-02 12:04:57 INFO [http-bio-8080-exec-41] - saveName:af240eda1e9b78341b42b0ca555bfc04.mp3
org.apache.catalina.connector.ClientAbortException: java.net.SocketException: Broken pipe
at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:407)
at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java:480)
at org.apache.tomcat.util.buf.ByteChunk.append(ByteChunk.java:366)
at org.apache.catalina.connector.OutputBuffer.writeBytes(OutputBuffer.java:432)
at org.apache.catalina.connector.OutputBuffer.write(OutputBuffer.java:420)
at org.apache.catalina.connector.CoyoteOutputStream.write(CoyoteOutputStream.java:91)
at app.component.doc.action.TbDocInfoAction.readDocs(TbDocInfoAction.java:484)
at app.component.doc.action.TbDocInfoAction.openImgOrTxt(TbDocInfoAction.java:145)
at app.component.doc.action.TbDocInfoAction$$FastClassByCGLIB$$ef9208ea.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
前端调用代码如下:
$(".audio-read").click(function(){
var audioName = $(this).attr("name"); //音频文件的名字
var titleName = $(this).attr("title"); //音频本身名字
var audioHtml = '<audio preload="auto"><source src="XXXXXXXAction_xxxx.action?saveName='+audioName+'"></audio>';
$(".audio-modal-title").text(titleName);
$(".audio-modal-body").html(audioHtml);
audiojs.events.ready(function() {
var as = audiojs.createAll();
});
})
保存在服务器其他目录的文件能不通过输出流来实现吗?
请问各位这种情况该怎么来处理。感激不尽。
缥缈止盈
呼啦一阵风
叮当猫咪
相关分类