简体   繁体   English

IndexOutOfBoundsException解压缩耳朵文件时

[英]IndexOutOfBoundsException When unzipping an ear file

This is one of the target in my deployment script and it tries to unzip an .ear file. 这是我的部署脚本中的目标之一,它尝试解压缩.ear文件。 It fails with IndexOutOfBoundsException. 它因IndexOutOfBoundsException而失败。

<target name="unzip">
        <unzip src="${project-name}.ear" dest="${unzip-destination}" />
</target>

How do I figure out what is causing this exception? 我如何找出导致此异常的原因? What list/array is this accessing that causes this exception? 此访问导致该异常的访问是什么列表/数组?

Stacktrace: 堆栈跟踪:

java.lang.IndexOutOfBoundsException
        at java.util.zip.ZipInputStream.read(ZipInputStream.java:144)
        at IdentifyServer.modifyZipContents(IdentifyServer.java:215)
        at IdentifyServer.execute(IdentifyServer.java:135)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
        at org.apache.tools.ant.TaskAdapter.execute(TaskAdapter.java:154)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
        at org.apache.tools.ant.Task.perform(Task.java:348)
        at org.apache.tools.ant.Target.execute(Target.java:357)
        at org.apache.tools.ant.Target.performTasks(Target.java:385)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
        at org.apache.tools.ant.Main.runBuild(Main.java:758)
        at org.apache.tools.ant.Main.startAnt(Main.java:217)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)

It sounds like you have a corrupt ear file. 听起来您的耳朵文件损坏了。 I would suggest creating another zip file and try your ant ask on that zip file. 我建议您创建另一个zip文件,然后尝试向您的蚂蚁询问该zip文件。 Once you confirm that it works then you know your ant task is working. 一旦确认它可以工作,便知道您的蚂蚁任务正在工作。 Then I would focus on looking at how the ear file is being generated. 然后,我将重点研究耳文件的生成方式。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM