jsp运行servlet发现调用的一个类找不到,但是本地运行又是对的
求各位大神帮助。。
运行jsp网页时,报错为:
public void processExtract(String path, String storePath)
{
File[] files = new File(path).listFiles();
for (int i = 0; i < files.length; i++)
{
if (files[i].isDirectory() == true)
{
processExtract(files[i].getAbsolutePath(), storePath);
} else
{
String encode = "GB2312";
try
{
BufferedReader reader = new BufferedReader(new FileReader(
files[i].getAbsoluteFile()));
String line = reader.readLine();
while (line != null)
{
if (line.indexOf("charset=") != -1)
{
int start = line.indexOf("charset=");
start = start + 8;
String tmp = line.substring(start, start + 3);
if ("ISO".equals(tmp) || "iso".equals(tmp))
{
encode = "ISO-8859-1";
} else if ("UTF".equals(tmp) || "utf".equals(tmp))
{
encode = "UTF-8";
} else if ("GBK".equals(tmp) || "gbk".equals(tmp))
{
encode = "GBK";
} else
{
encode = "GB2312";
}
reader.close();
break;
} else
{
line = reader.readLine();
}
}
} catch (IOException e)
{
// TODO: handle exception
e.printStackTrace();
}
Extractor extractor = new Extractor();
extractor.setEncode(encode);
extractor.extract(files[i].getAbsolutePath(), storePath);
}
}
}
红色部分报错。。请问是什么原因呀。。用main函数执行是对的。可是一用jsp的servlet调用该方法就错了。。
------解决方案--------------------这些应该都是网上下载的jar包,把这些包放到网站的lib文件夹下