提取 Tomcat Zip 有时会失败并出现 IOException:负查找偏移量

发布于 2024-11-24 15:37:27 字数 8435 浏览 1 评论 0原文

我正在使用 Maven Cargo 及其 zip url 安装程序功能来下载 Tomcat 进行集成测试。这在我的计算机上运行良好,但在 husdon 中运行时有时会失败(大约 10-20%)。

失败的是:

Error while expanding /home/hudson/workspace/My Test Media-Archive/cfma/target/cargo/install/apache-tomcat-6.0.32.zip
java.io.IOException: Negative seek offset
    at org.apache.tools.ant.taskdefs.Expand.expandFile(Expand.java:148)
    at org.apache.tools.ant.taskdefs.Expand.execute(Expand.java:107)
    at org.codehaus.cargo.container.installer.ZipURLInstaller.unpack(ZipURLInstaller.java:252)
    at org.codehaus.cargo.container.installer.ZipURLInstaller.install(ZipURLInstaller.java:149)
    at org.codehaus.cargo.maven2.configuration.Container.setupHome(Container.java:357)
    at org.codehaus.cargo.maven2.configuration.Container.createContainer(Container.java:241)
    at org.codehaus.cargo.maven2.AbstractCargoMojo.createNewContainer(AbstractCargoMojo.java:470)
    at org.codehaus.cargo.maven2.AbstractCargoMojo.createContainer(AbstractCargoMojo.java:410)
    at org.codehaus.cargo.maven2.ContainerStartMojo.doExecute(ContainerStartMojo.java:53)
    at org.codehaus.cargo.maven2.AbstractCargoMojo.execute(AbstractCargoMojo.java:268)
    at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
    at hudson.maven.agent.PluginManagerInterceptor.executeMojo(PluginManagerInterceptor.java:182)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
    at org.apache.maven.lifecycle.LifecycleExecutorInterceptor.execute(LifecycleExecutorInterceptor.java:65)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
    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.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
    at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
    at hudson.maven.agent.Main.launch(Main.java:173)
    at hudson.maven.MavenBuilder.call(MavenBuilder.java:164)
    at hudson.maven.MavenModuleSetBuild$Builder.call(MavenModuleSetBuild.java:861)
    at hudson.maven.MavenModuleSetBuild$Builder.call(MavenModuleSetBuild.java:792)
    at hudson.remoting.UserRequest.perform(UserRequest.java:114)
    at hudson.remoting.UserRequest.perform(UserRequest.java:48)
    at hudson.remoting.Request$2.run(Request.java:270)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:662)
Caused by: java.io.IOException: Negative seek offset
    at java.io.RandomAccessFile.seek(Native Method)
    at org.apache.tools.zip.ZipFile.positionAtCentralDirectory(ZipFile.java:403)
    at org.apache.tools.zip.ZipFile.populateFromCentralDirectory(ZipFile.java:271)
    at org.apache.tools.zip.ZipFile.<init>(ZipFile.java:152)
    at org.apache.tools.ant.taskdefs.Expand.expandFile(Expand.java:137)
    ... 40 more
--- Nested Exception ---
java.io.IOException: Negative seek offset
    at java.io.RandomAccessFile.seek(Native Method)
    at org.apache.tools.zip.ZipFile.positionAtCentralDirectory(ZipFile.java:403)
    at org.apache.tools.zip.ZipFile.populateFromCentralDirectory(ZipFile.java:271)
    at org.apache.tools.zip.ZipFile.<init>(ZipFile.java:152)
    at org.apache.tools.ant.taskdefs.Expand.expandFile(Expand.java:137)
    at org.apache.tools.ant.taskdefs.Expand.execute(Expand.java:107)
    at org.codehaus.cargo.container.installer.ZipURLInstaller.unpack(ZipURLInstaller.java:252)
    at org.codehaus.cargo.container.installer.ZipURLInstaller.install(ZipURLInstaller.java:149)
    at org.codehaus.cargo.maven2.configuration.Container.setupHome(Container.java:357)
    at org.codehaus.cargo.maven2.configuration.Container.createContainer(Container.java:241)
    at org.codehaus.cargo.maven2.AbstractCargoMojo.createNewContainer(AbstractCargoMojo.java:470)
    at org.codehaus.cargo.maven2.AbstractCargoMojo.createContainer(AbstractCargoMojo.java:410)
    at org.codehaus.cargo.maven2.ContainerStartMojo.doExecute(ContainerStartMojo.java:53)
    at org.codehaus.cargo.maven2.AbstractCargoMojo.execute(AbstractCargoMojo.java:268)
    at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
    at hudson.maven.agent.PluginManagerInterceptor.executeMojo(PluginManagerInterceptor.java:182)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
    at org.apache.maven.lifecycle.LifecycleExecutorInterceptor.execute(LifecycleExecutorInterceptor.java:65)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
    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.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
    at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
    at hudson.maven.agent.Main.launch(Main.java:173)
    at hudson.maven.MavenBuilder.call(MavenBuilder.java:164)
    at hudson.maven.MavenModuleSetBuild$Builder.call(MavenModuleSetBuild.java:861)
    at hudson.maven.MavenModuleSetBuild$Builder.call(MavenModuleSetBuild.java:792)
    at hudson.remoting.UserRequest.perform(UserRequest.java:114)
    at hudson.remoting.UserRequest.perform(UserRequest.java:48)
    at hudson.remoting.Request$2.run(Request.java:270)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:662)

这是我的 pom.xml 的相关部分。

<plugin>
  <groupId>org.codehaus.cargo</groupId>
  <artifactId>cargo-maven2-plugin</artifactId>
  <version>1.0.5</version>
  <configuration>
     <container>
         <zipUrlInstaller>
    <url>http://archive.apache.org/dist/tomcat/tomcat-6/v6.0.32/bin/apache-tomcat-6.0.32.zip</url>
          <zipUrlInstaller>
          .... 
     </container>
     ...
   <configuration>
</plugin>

有人知道我做错了什么吗?

I am using maven cargo with its zip url installer feature to download a tomcat for my integration tests. This works fine on my computer, but when its run in husdon it fails sometimes (round about 10-20%).

The failure is:

Error while expanding /home/hudson/workspace/My Test Media-Archive/cfma/target/cargo/install/apache-tomcat-6.0.32.zip
java.io.IOException: Negative seek offset
    at org.apache.tools.ant.taskdefs.Expand.expandFile(Expand.java:148)
    at org.apache.tools.ant.taskdefs.Expand.execute(Expand.java:107)
    at org.codehaus.cargo.container.installer.ZipURLInstaller.unpack(ZipURLInstaller.java:252)
    at org.codehaus.cargo.container.installer.ZipURLInstaller.install(ZipURLInstaller.java:149)
    at org.codehaus.cargo.maven2.configuration.Container.setupHome(Container.java:357)
    at org.codehaus.cargo.maven2.configuration.Container.createContainer(Container.java:241)
    at org.codehaus.cargo.maven2.AbstractCargoMojo.createNewContainer(AbstractCargoMojo.java:470)
    at org.codehaus.cargo.maven2.AbstractCargoMojo.createContainer(AbstractCargoMojo.java:410)
    at org.codehaus.cargo.maven2.ContainerStartMojo.doExecute(ContainerStartMojo.java:53)
    at org.codehaus.cargo.maven2.AbstractCargoMojo.execute(AbstractCargoMojo.java:268)
    at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
    at hudson.maven.agent.PluginManagerInterceptor.executeMojo(PluginManagerInterceptor.java:182)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
    at org.apache.maven.lifecycle.LifecycleExecutorInterceptor.execute(LifecycleExecutorInterceptor.java:65)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
    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.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
    at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
    at hudson.maven.agent.Main.launch(Main.java:173)
    at hudson.maven.MavenBuilder.call(MavenBuilder.java:164)
    at hudson.maven.MavenModuleSetBuild$Builder.call(MavenModuleSetBuild.java:861)
    at hudson.maven.MavenModuleSetBuild$Builder.call(MavenModuleSetBuild.java:792)
    at hudson.remoting.UserRequest.perform(UserRequest.java:114)
    at hudson.remoting.UserRequest.perform(UserRequest.java:48)
    at hudson.remoting.Request$2.run(Request.java:270)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:662)
Caused by: java.io.IOException: Negative seek offset
    at java.io.RandomAccessFile.seek(Native Method)
    at org.apache.tools.zip.ZipFile.positionAtCentralDirectory(ZipFile.java:403)
    at org.apache.tools.zip.ZipFile.populateFromCentralDirectory(ZipFile.java:271)
    at org.apache.tools.zip.ZipFile.<init>(ZipFile.java:152)
    at org.apache.tools.ant.taskdefs.Expand.expandFile(Expand.java:137)
    ... 40 more
--- Nested Exception ---
java.io.IOException: Negative seek offset
    at java.io.RandomAccessFile.seek(Native Method)
    at org.apache.tools.zip.ZipFile.positionAtCentralDirectory(ZipFile.java:403)
    at org.apache.tools.zip.ZipFile.populateFromCentralDirectory(ZipFile.java:271)
    at org.apache.tools.zip.ZipFile.<init>(ZipFile.java:152)
    at org.apache.tools.ant.taskdefs.Expand.expandFile(Expand.java:137)
    at org.apache.tools.ant.taskdefs.Expand.execute(Expand.java:107)
    at org.codehaus.cargo.container.installer.ZipURLInstaller.unpack(ZipURLInstaller.java:252)
    at org.codehaus.cargo.container.installer.ZipURLInstaller.install(ZipURLInstaller.java:149)
    at org.codehaus.cargo.maven2.configuration.Container.setupHome(Container.java:357)
    at org.codehaus.cargo.maven2.configuration.Container.createContainer(Container.java:241)
    at org.codehaus.cargo.maven2.AbstractCargoMojo.createNewContainer(AbstractCargoMojo.java:470)
    at org.codehaus.cargo.maven2.AbstractCargoMojo.createContainer(AbstractCargoMojo.java:410)
    at org.codehaus.cargo.maven2.ContainerStartMojo.doExecute(ContainerStartMojo.java:53)
    at org.codehaus.cargo.maven2.AbstractCargoMojo.execute(AbstractCargoMojo.java:268)
    at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
    at hudson.maven.agent.PluginManagerInterceptor.executeMojo(PluginManagerInterceptor.java:182)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
    at org.apache.maven.lifecycle.LifecycleExecutorInterceptor.execute(LifecycleExecutorInterceptor.java:65)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
    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.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
    at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
    at hudson.maven.agent.Main.launch(Main.java:173)
    at hudson.maven.MavenBuilder.call(MavenBuilder.java:164)
    at hudson.maven.MavenModuleSetBuild$Builder.call(MavenModuleSetBuild.java:861)
    at hudson.maven.MavenModuleSetBuild$Builder.call(MavenModuleSetBuild.java:792)
    at hudson.remoting.UserRequest.perform(UserRequest.java:114)
    at hudson.remoting.UserRequest.perform(UserRequest.java:48)
    at hudson.remoting.Request$2.run(Request.java:270)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:662)

And this is the relevant part of my pom.

<plugin>
  <groupId>org.codehaus.cargo</groupId>
  <artifactId>cargo-maven2-plugin</artifactId>
  <version>1.0.5</version>
  <configuration>
     <container>
         <zipUrlInstaller>
    <url>http://archive.apache.org/dist/tomcat/tomcat-6/v6.0.32/bin/apache-tomcat-6.0.32.zip</url>
          <zipUrlInstaller>
          .... 
     </container>
     ...
   <configuration>
</plugin>

Does anybody know what I am doing wrong?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

物价感观 2024-12-01 15:37:27

通常这是由于下载错误(奇怪的损坏的数据包等)。在使用之前尝试使用 MD5 / SHA-1 校验和来验证存档。

另请注意,偏移变量足够大,足以容纳您的搜索所需的值。

Usually it's due to a bad download (the odd corrupted packet etc). Try using an MD5 / SHA-1 checksum to validate the archive before using it.

Also be careful that the offset variable is large enough to hold the require value of your seek.

不及他 2024-12-01 15:37:27

将下载网址更改为镜像后问题就消失了。

The Problem was gone after changing the download url to an mirror.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文