提取Tomcat Zip有时会失败,并出现IOException:负寻道偏移量

我正在使用具有其zip

url安装程序功能的maven来下载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的相关部分。

<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>

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

回答:

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

还要注意,偏移量变量要足够大以容纳搜索的需求值。

以上是 提取Tomcat Zip有时会失败,并出现IOException:负寻道偏移量 的全部内容, 来源链接: utcz.com/qa/401137.html

回到顶部