Webloigc92 报下面的错误,有知道的大侠指点一下啊,谢谢。急急~~
<2009-7-3 上午09时36分23秒 CST> <Error> <HTTP> <BEA-101019> <[weblogic.servlet.internal.WebAppServletContext@5d7554 - appName: 'traffic', name: 'WebRoot',
context-path: ''] Servlet failed with IOException
java.io.IOException: failed to read '2' bytes from InputStream; clen: 6016 remaining: 2 count: 6014
at weblogic.servlet.internal.ChunkOutput.writeStream(ChunkOutput.java:417)
at weblogic.servlet.internal.ChunkOutputWrapper.writeStream(ChunkOutputWrapper.java:168)
at weblogic.servlet.internal.ServletOutputStreamImpl.writeStream(ServletOutputStreamImpl.java:498)
at weblogic.servlet.internal.ServletOutputStreamImpl.writeStream(ServletOutputStreamImpl.java:486)
at weblogic.servlet.FileServlet.sendFile(FileServlet.java:405)
Truncated. see log file for complete stacktrace
>
是不是下面的代码有什么问题?
InputStream fis = null;
BufferedOutputStream bos = null;
try {
String dpId = session.getAttribute("dp_id")==null?"":session.getAttribute("dp_id").toString();
String nameReport=request.getParameter("nameReport");
String workbook = request.getParameter("workbook");
if(workbook==null || "".equals(workbook)){
workbook = session.getAttribute("dp_id").toString();
}
String tempworkbook = workbook +"/";
tempworkbook = tempworkbook.replaceAll("主工作薄/",dpId+"/");
if(tempworkbook.endsWith("/")){
tempworkbook = tempworkbook.substring(0,tempworkbook.length()-1);
}
fis = request.getInputStream();
bos = new BufferedOutputStream(new FileOutputStream(new File(strAbsPath+"workbookspace\\"+tempworkbook+"\\"+nameReport+".cll")));
int b = fis.read();
while (b != -1) {
bos.write(b);
b = fis.read();
}
}catch (Exception e) {
e.printStackTrace();
}finally{
bos.flush();
bos.close();
fis.close();
bos = null;
fis = null;
}
原因:因为workbook路径中包含了空格。
本Blog纯属个人学习、工作需要,记录相关资料。请不要发表任何有人身攻击的言论,谢谢! www.zhipsoft.cn
posted on 2009-07-03 10:44
ZhipSoft 阅读(2945)
评论(0) 编辑 收藏 所属分类:
Java