很有挑战性的问题(50分)

  • 主题发起人 主题发起人 iceheartboy
  • 开始时间 开始时间
I

iceheartboy

Unregistered / Unconfirmed
GUEST, unregistred user!
我用jxl编写了一个读取Excel内容的方法,用JSP在前台调用该方法,服务器为Weblogic 在windows平台时测试通过,而转移到Unix平台时Weblogic报错,具体错误为:
Apr 12, 2004 10:19:53 AM CST> <Error> <HTTP> <sj85_1> <wlptserver7011> <ExecuteThread: '3' for queue: 'default'> <kernel identity> <> <101017> <[ServletContext(id=1094083648,name=DefaultWebApp,context-path=)] Root cause of ServletException>
java.lang.OutOfMemoryError
at jxl.read.biff.File.<init>(File.java:76)
at jxl.Workbook.getWorkbook(Workbook.java:242)
at jxl.Workbook.getWorkbook(Workbook.java:227)
at wlpt.tools.Information_Init.ReadExcel(Information_Init.java:54)
at jsp_servlet._txgscsh.__init_temptable._jspService(__init_temptable.java:129)
at weblogic.servlet.jsp.JspBase.service(JspBase.java(Compiled Code))
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java(Compiled Code))
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java(Compiled Code))
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java(Compiled Code))
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java(Compiled Code))
at weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManager.java(Compiled Code))
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java(Compiled Code))
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java(Compiled Code))
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java(Compiled Code))
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:133)
方法的源代码为:
public ArrayList ReadExcel(int row,int col,int page,String FileName){
//构建Workbook对象, 只读Workbook对象
//直接从本地文件创建Workbook
//从输入流创建Workbook
InputStream is = new FileInputStream(FileName);
jxl.Workbook rwb = Workbook.getWorkbook(is);
//获取第一张Sheet表
Sheet rs = rwb.getSheet(page);
//从第一张Sheet表获取数据
for (int rows=row;rows<rs.getRows();rows++){
tempResult res=new tempResult();
for(int cloum=col;cloum<rs.getColumns();cloum++){
Cell cell=rs.getCell(cloum,rows);
String tempdata=cell.getContents();
tempdata=tempdata.trim();
check_Result=check(tempdata);
if (check_Result!=null){
return "0&amp;第"+String.valueOf(rows+1)+"行,第"+String.valueOf(cloum+1)+"列包含非法字符"+check_Result;
}else
{
res.list_data[cloum]=tempdata;
}
}
arr.add(res);
}
return arr;
}
jsp主要代码为:
<%@ page contentType="text/html;charset=gb2312"%>
<%@ page import="javax.rmi.PortableRemoteObject"%>
<%@ page autoFlush ="true"%>
<%@ page import="java.lang.Object,java.util.Enumeration,wlpt.tools.*" %>
//调用
String str_mess=Init_table.ReadExcel(0,0,0,"2003.xls");
大家帮忙给指点一下错误,或者是unix平台的配置
 
后退
顶部