一个奇怪的问题,java的安全性。java.lang.VerifyError

fengjingyu 2005-05-16 10:50:19
我在程序ManagePackageDownloadAction.java中调用了Archiver.java中的一个这样的一个方法:
public class ManagePackageDownloadAction
{
public String executeFuncAction(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response,
UserDataBean userDataBean){
......
byte[] outData = Archiver.zipDirAndFile(fZipFiles); <---------断点A
......
}
}


public class Archiver
{
......
public static byte[] zipDirAndFile(File[] fileList) throws EAPLIException
{
byte[] ret = null; <------------------断点B
try {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ZipOutputStream zos = new ZipOutputStream(baos);

String parentPath = "";
String filePath = "";
for (int i = 0; i < fileList.length; i++) {
if (fileList[i].isDirectory())

{
File[] fileListSub = getFileList(fileList[i]);

String dirpath = fileList[i].getParent() + File.separator;
for (int j = 0; j < fileListSub.length; j++) {

parentPath = fileListSub[j].getParent().substring(dirpath.length()) + File.separator;
filePath = parentPath + DBAccess.replaceWavedash2MS932(fileListSub[j].getName());
if (fileListSub[j].isFile()) {

Log.debug(CLASS_NAME, "zipDirAndFile", "901", "INF00000000", "filePath:" + filePath, null,lcd);
ZipEntry ze = new ZipEntry(filePath);
zos.putNextEntry(ze);
BufferedInputStream bis = new BufferedInputStream(new FileInputStream(fileListSub[j]));
int rb = 0;
while((rb = bis.read()) != -1) {

zos.write(rb);
}
bis.close();
zos.closeEntry();
}
}
}
else if (fileList[i].isFile())
{
parentPath = fileList[i].getParent().substring(fileList[i].getParent().length());
filePath = parentPath + DBAccess.replaceWavedash2MS932(fileList[i].getName());

ZipEntry ze = new ZipEntry(filePath);
zos.putNextEntry(ze);
BufferedInputStream bis = new BufferedInputStream(new FileInputStream(fileList[i]));
int rb = 0;
while((rb = bis.read()) != -1) {
zos.write(rb);
}
bis.close();
zos.closeEntry();

}
else
{
throw new EAPLIException(
CLASS_NAME, "zipDirAndFile", "002", "ERR10000001",MessageCode.getDetailMessage("ERR10000001"), lcd);
}
}
zos.close();
ret = baos.toByteArray();
baos.close();
} catch (FileNotFoundException e) {
throw new EAPLIException(CLASS_NAME, "zipDirAndFile", "004", "ERR99000001", null, e,lcd);
} catch (IOException e) {
throw new EAPLIException(CLASS_NAME, "zipDirAndFile", "005", "ERR99000001", null, e,lcd);
}
return ret;
}
....
}

现在我在调试的时候,一走到断点A就报错,断点B都没有走到,报的错是:
java.lang.VerifyError: (class: Archiver, method: zipDirAndFile signature: ([Ljava/io/File;)[B) Incompatible object argument for function call
at ManagePackageDownloadAction.executeFuncAction(ManagePackageDownloadAction.java:287)
......
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
at net.skirnir.catalina.servlets.MultipartFilter.doFilter(MultipartFilter.java:69)
at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:604)
at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:317)
at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:790)
at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.AJPRequestHandler.run(AJPRequestHandler.java:208)
at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.AJPRequestHandler.run(AJPRequestHandler.java:125)
at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
at java.lang.Thread.run(Thread.java:534)

我敢肯定那不是方法中的错误,连方法都没走进去就报了错,用google查到是什么JVM问题,我在本地运行没有问题,但放到server上就不行了,请教这是为什么?

在线等,谢谢!
...全文
93 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
bluelily22 2005-05-16
  • 打赏
  • 举报
回复
可能是jar文件的版本的兼容性的问题,升级一下jar文件,
fengjingyu 2005-05-16
  • 打赏
  • 举报
回复
up

13,096

社区成员

发帖
与我相关
我的任务
社区描述
Java J2ME
社区管理员
  • J2ME社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧