Servlet实现文件上传时候出现了错误,紧急求救!!

来源:百度知道 编辑:UC知道 时间:2024/05/29 00:06:24
Apache Tomcat/5.0.28 - Error reportHTTP Status 500 -

type Exception report
message
description The server encountered an internal error () that prevented it from
fulfilling this request.
exception
javax.servlet.ServletException: Error instantiating servlet class servlets.FileUpload
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
java.lang.Thread.run(Thread.java:619)
root cause
java.lang.Error: Unresolved compilation problems:
The import org.apache.common

DataBaseConnection db=new DataBaseConnection();
db.setAuthor(author);
java.io.File f=new java.io.File("../webapps/OpenSource/"+author);
String path="../webapps/OpenSource/";
if(f.exists()==false)
{
f.mkdir();
}
try{
SmartUpload su = new SmartUpload();

su.initialize(servletconfig, request, response);
su.setMaxFileSize(900000000);
su.setTotalMaxFileSize(900000000);
su.setAllowedFilesList("chm,doc,txt,rar,java,zip,jar,sql,pdf,ppt,xls");
su.setDeniedFilesList("exe,bat,jsp,htm,html,,");
su.upload();
for (int i=0;i<su.getFiles().getCount();i++)
{
com.jspsmart.upload.File file = su.getFiles().getFile(i);
if (file.isMissing()) continue;
file.saveAs(path+author+"/" + file.getFileName());
session.setAttribute("filename",file.getFileName());
}
session.setAttribute