gpt4 book ai didi

maven - mvn jetty :run throwing java. util.zip.ZipException:无效的条目大小

转载 作者:行者123 更新时间:2023-12-04 22:34:09 26 4
gpt4 key购买 nike

我试图在码头运行一个非常基本的项目(它基本上是一个完全没有功能的线框,只有一些 maven 依赖项)。
为此,我使用 mvn jetty 插件:

mvn jetty:run

但是我在服务器开始启动后立即收到此异常:
[INFO] Starting jetty 7.4.0.v20110414 ...
2012-08-16 13:25:22.237:INFO::jetty-7.4.0.v20110414

java.util.zip.ZipException: invalid entry size (expected 3313 but got 2163 bytes)
at java.util.zip.ZipInputStream.readEnd(ZipInputStream.java:386)
at java.util.zip.ZipInputStream.read(ZipInputStream.java:156)
at java.util.jar.JarInputStream.read(JarInputStream.java:195)
at java.util.zip.ZipInputStream.closeEntry(ZipInputStream.java:100)
at java.util.zip.ZipInputStream.getNextEntry(ZipInputStream.java:78)
at java.util.jar.JarInputStream.getNextEntry(JarInputStream.java:130)
at java.util.jar.JarInputStream.getNextJarEntry(JarInputStream.java:167)
at org.eclipse.jetty.webapp.JarScanner.matched(JarScanner.java:153)
at org.eclipse.jetty.util.PatternMatcher.matchPatterns(PatternMatcher.java:82)
at org.eclipse.jetty.util.PatternMatcher.match(PatternMatcher.java:64)
at org.eclipse.jetty.webapp.JarScanner.scan(JarScanner.java:75)
at org.eclipse.jetty.webapp.MetaInfConfiguration.preConfigure(MetaInfConfiguration.java:75)
at org.eclipse.jetty.webapp.WebAppContext.preConfigure(WebAppContext.java:406)
at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:435)
at org.mortbay.jetty.plugin.JettyWebAppContext.doStart(JettyWebAppContext.java:180)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:58)
at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:226)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:164)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:58)
at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:226)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:58)
at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:93)
at org.eclipse.jetty.server.Server.doStart(Server.java:253)
at org.mortbay.jetty.plugin.JettyServer.doStart(JettyServer.java:67)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:58)
at org.mortbay.jetty.plugin.AbstractJettyMojo.startJetty(AbstractJettyMojo.java:468)
at org.mortbay.jetty.plugin.AbstractJettyMojo.execute(AbstractJettyMojo.java:408)
at org.mortbay.jetty.plugin.JettyRunMojo.execute(JettyRunMojo.java:589)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:569)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:539)
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.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 org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
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 org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)

这听起来像某个地方的损坏 jar ,但我不知道如何继续,这是我第一次使用码头。

有任何想法吗?

最佳答案

正如我所怀疑的,这个问题是由于 JAR 文件损坏造成的。我的解决方案是清除我的本地存储库(删除 .m2/repository 文件夹的内容)并执行:

mvn clean install

解决所有依赖项后,它运行起来就像一个魅力。

您还应该确保在启动 jetty 之前,应用程序实际上正在编译到输出文件夹(在我的例子中是一个名为 war 的文件夹)。

关于maven - mvn jetty :run throwing java. util.zip.ZipException:无效的条目大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11993324/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com