私は非常にシンプルなRESTful Apache-camelプロジェクトをjettyで実行しようとしています。 http://camel.Apache.org/restlet.html の指示に従いました。
アプリケーションは実行されますが、すべての関数がjettyからエラー503を返すため、プロジェクトを表示できません。 Eclipseでは、Java.util.Zip.Zipexecutionでいくつかのエラーを確認できます。 (以下に投稿)しかし、私はそのライブラリを使用せず、必要なすべてのライブラリを取得するためにmavenを使用します。
すべての検索でJAR/WARファイルが破損している可能性があることがわかりますが、Mavenを使用しているため(以前は使用していませんでした)、ファイルの検索場所がわかりませんでした。
どうすれば解決できますか?
完全なエラー:
[INFO] jetty-9.2.19.v20160908
Java.util.Zip.ZipException: invalid END header (bad central directory size)
at Java.util.Zip.ZipFile.open(Native Method)
at Java.util.Zip.ZipFile.<init>(ZipFile.Java:219)
at Java.util.Zip.ZipFile.<init>(ZipFile.Java:149)
at Java.util.jar.JarFile.<init>(JarFile.Java:166)
at Java.util.jar.JarFile.<init>(JarFile.Java:103)
at Sun.net.www.protocol.jar.URLJarFile.<init>(URLJarFile.Java:93)
at Sun.net.www.protocol.jar.URLJarFile.getJarFile(URLJarFile.Java:69)
at Sun.net.www.protocol.jar.JarFileFactory.get(JarFileFactory.Java:109)
at Sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.Java:122)
at Sun.net.www.protocol.jar.JarURLConnection.getJarFile(JarURLConnection.Java:89)
at org.Eclipse.jetty.util.resource.JarFileResource.listEntries(JarFileResource.Java:314)
at org.Eclipse.jetty.util.resource.JarFileResource.list(JarFileResource.Java:275)
at org.Eclipse.jetty.util.resource.Resource.getAllResources(Resource.Java:682)
at org.Eclipse.jetty.webapp.MetaInfConfiguration.scanForTlds(MetaInfConfiguration.Java:314)
at org.Eclipse.jetty.webapp.MetaInfConfiguration.scanJars(MetaInfConfiguration.Java:135)
at org.Eclipse.jetty.webapp.MetaInfConfiguration.preConfigure(MetaInfConfiguration.Java:86)
at org.Eclipse.jetty.webapp.WebAppContext.preConfigure(WebAppContext.Java:468)
at org.Eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.Java:504)
at org.Eclipse.jetty.maven.plugin.JettyWebAppContext.doStart(JettyWebAppContext.Java:366)
at org.Eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.Java:68)
at org.Eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.Java:132)
at org.Eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.Java:114)
at org.Eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.Java:61)
at org.Eclipse.jetty.server.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.Java:163)
at org.Eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.Java:68)
at org.Eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.Java:132)
at org.Eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.Java:114)
at org.Eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.Java:61)
at org.Eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.Java:68)
at org.Eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.Java:132)
at org.Eclipse.jetty.server.Server.start(Server.Java:387)
at org.Eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.Java:114)
at org.Eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.Java:61)
at org.Eclipse.jetty.server.Server.doStart(Server.Java:354)
at org.Eclipse.jetty.maven.plugin.JettyServer.doStart(JettyServer.Java:73)
at org.Eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.Java:68)
at org.Eclipse.jetty.maven.plugin.AbstractJettyMojo.startJetty(AbstractJettyMojo.Java:535)
at org.Eclipse.jetty.maven.plugin.AbstractJettyMojo.execute(AbstractJettyMojo.Java:358)
at org.Eclipse.jetty.maven.plugin.JettyRunMojo.execute(JettyRunMojo.Java:167)
at org.Apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.Java:134)
at org.Apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.Java:207)
at org.Apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.Java:153)
at org.Apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.Java:145)
at org.Apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.Java:116)
at org.Apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.Java:80)
at org.Apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.Java:51)
at org.Apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.Java:128)
at org.Apache.maven.DefaultMaven.doExecute(DefaultMaven.Java:307)
at org.Apache.maven.DefaultMaven.doExecute(DefaultMaven.Java:193)
at org.Apache.maven.DefaultMaven.execute(DefaultMaven.Java:106)
at org.Apache.maven.cli.MavenCli.execute(MavenCli.Java:863)
at org.Apache.maven.cli.MavenCli.doMain(MavenCli.Java:288)
at org.Apache.maven.cli.MavenCli.main(MavenCli.Java:199)
at Sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at Sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.Java:62)
at Sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.Java:43)
at Java.lang.reflect.Method.invoke(Method.Java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.Java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.Java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.Java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.Java:356)
[WARNING] Retrying list:Java.lang.IllegalStateException
Java.util.Zip.ZipException: invalid END header (bad central directory size)
at Java.util.Zip.ZipFile.open(Native Method)
at Java.util.Zip.ZipFile.<init>(ZipFile.Java:219)
at Java.util.Zip.ZipFile.<init>(ZipFile.Java:149)
at Java.util.jar.JarFile.<init>(JarFile.Java:166)
at Java.util.jar.JarFile.<init>(JarFile.Java:103)
at Sun.net.www.protocol.jar.URLJarFile.<init>(URLJarFile.Java:93)
at Sun.net.www.protocol.jar.URLJarFile.getJarFile(URLJarFile.Java:69)
at Sun.net.www.protocol.jar.JarFileFactory.get(JarFileFactory.Java:109)
at Sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.Java:122)
at Sun.net.www.protocol.jar.JarURLConnection.getJarFile(JarURLConnection.Java:89)
at org.Eclipse.jetty.util.resource.JarFileResource.listEntries(JarFileResource.Java:314)
at org.Eclipse.jetty.util.resource.JarFileResource.list(JarFileResource.Java:288)
at org.Eclipse.jetty.util.resource.Resource.getAllResources(Resource.Java:682)
at org.Eclipse.jetty.webapp.MetaInfConfiguration.scanForTlds(MetaInfConfiguration.Java:314)
at org.Eclipse.jetty.webapp.MetaInfConfiguration.scanJars(MetaInfConfiguration.Java:135)
at org.Eclipse.jetty.webapp.MetaInfConfiguration.preConfigure(MetaInfConfiguration.Java:86)
at org.Eclipse.jetty.webapp.WebAppContext.preConfigure(WebAppContext.Java:468)
at org.Eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.Java:504)
at org.Eclipse.jetty.maven.plugin.JettyWebAppContext.doStart(JettyWebAppContext.Java:366)
at org.Eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.Java:68)
at org.Eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.Java:132)
at org.Eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.Java:114)
at org.Eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.Java:61)
at org.Eclipse.jetty.server.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.Java:163)
at org.Eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.Java:68)
at org.Eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.Java:132)
at org.Eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.Java:114)
at org.Eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.Java:61)
at org.Eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.Java:68)
at org.Eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.Java:132)
at org.Eclipse.jetty.server.Server.start(Server.Java:387)
at org.Eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.Java:114)
at org.Eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.Java:61)
at org.Eclipse.jetty.server.Server.doStart(Server.Java:354)
at org.Eclipse.jetty.maven.plugin.JettyServer.doStart(JettyServer.Java:73)
at org.Eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.Java:68)
at org.Eclipse.jetty.maven.plugin.AbstractJettyMojo.startJetty(AbstractJettyMojo.Java:535)
at org.Eclipse.jetty.maven.plugin.AbstractJettyMojo.execute(AbstractJettyMojo.Java:358)
at org.Eclipse.jetty.maven.plugin.JettyRunMojo.execute(JettyRunMojo.Java:167)
at org.Apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.Java:134)
at org.Apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.Java:207)
at org.Apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.Java:153)
at org.Apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.Java:145)
at org.Apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.Java:116)
at org.Apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.Java:80)
at org.Apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.Java:51)
at org.Apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.Java:128)
at org.Apache.maven.DefaultMaven.doExecute(DefaultMaven.Java:307)
at org.Apache.maven.DefaultMaven.doExecute(DefaultMaven.Java:193)
at org.Apache.maven.DefaultMaven.execute(DefaultMaven.Java:106)
at org.Apache.maven.cli.MavenCli.execute(MavenCli.Java:863)
at org.Apache.maven.cli.MavenCli.doMain(MavenCli.Java:288)
at org.Apache.maven.cli.MavenCli.main(MavenCli.Java:199)
at Sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at Sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.Java:62)
at Sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.Java:43)
at Java.lang.reflect.Method.invoke(Method.Java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.Java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.Java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.Java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.Java:356)
[WARNING] Failed startup of context o.e.j.m.p.JettyWebAppContext@398474a2{/camel.restfull,file:/C:/Users/[user]/workspace/camel.restfull/src/main/webapp/,null}{file:/C:/Users/[user]/workspace/camel.restfull/src/main/webapp/}
Java.lang.IllegalStateException: Java.lang.IllegalStateException
at org.Eclipse.jetty.util.resource.Resource.getAllResources(Resource.Java:699)
at org.Eclipse.jetty.webapp.MetaInfConfiguration.scanForTlds(MetaInfConfiguration.Java:314)
at org.Eclipse.jetty.webapp.MetaInfConfiguration.scanJars(MetaInfConfiguration.Java:135)
at org.Eclipse.jetty.webapp.MetaInfConfiguration.preConfigure(MetaInfConfiguration.Java:86)
at org.Eclipse.jetty.webapp.WebAppContext.preConfigure(WebAppContext.Java:468)
at org.Eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.Java:504)
at org.Eclipse.jetty.maven.plugin.JettyWebAppContext.doStart(JettyWebAppContext.Java:366)
at org.Eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.Java:68)
at org.Eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.Java:132)
at org.Eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.Java:114)
at org.Eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.Java:61)
at org.Eclipse.jetty.server.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.Java:163)
at org.Eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.Java:68)
at org.Eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.Java:132)
at org.Eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.Java:114)
at org.Eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.Java:61)
at org.Eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.Java:68)
at org.Eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.Java:132)
at org.Eclipse.jetty.server.Server.start(Server.Java:387)
at org.Eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.Java:114)
at org.Eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.Java:61)
at org.Eclipse.jetty.server.Server.doStart(Server.Java:354)
at org.Eclipse.jetty.maven.plugin.JettyServer.doStart(JettyServer.Java:73)
at org.Eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.Java:68)
at org.Eclipse.jetty.maven.plugin.AbstractJettyMojo.startJetty(AbstractJettyMojo.Java:535)
at org.Eclipse.jetty.maven.plugin.AbstractJettyMojo.execute(AbstractJettyMojo.Java:358)
at org.Eclipse.jetty.maven.plugin.JettyRunMojo.execute(JettyRunMojo.Java:167)
at org.Apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.Java:134)
at org.Apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.Java:207)
at org.Apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.Java:153)
at org.Apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.Java:145)
at org.Apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.Java:116)
at org.Apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.Java:80)
at org.Apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.Java:51)
at org.Apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.Java:128)
at org.Apache.maven.DefaultMaven.doExecute(DefaultMaven.Java:307)
at org.Apache.maven.DefaultMaven.doExecute(DefaultMaven.Java:193)
at org.Apache.maven.DefaultMaven.execute(DefaultMaven.Java:106)
at org.Apache.maven.cli.MavenCli.execute(MavenCli.Java:863)
at org.Apache.maven.cli.MavenCli.doMain(MavenCli.Java:288)
at org.Apache.maven.cli.MavenCli.main(MavenCli.Java:199)
at Sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at Sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.Java:62)
at Sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.Java:43)
at Java.lang.reflect.Method.invoke(Method.Java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.Java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.Java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.Java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.Java:356)
Caused by: Java.lang.IllegalStateException
at org.Eclipse.jetty.util.resource.JarFileResource.listEntries(JarFileResource.Java:323)
at org.Eclipse.jetty.util.resource.JarFileResource.list(JarFileResource.Java:288)
at org.Eclipse.jetty.util.resource.Resource.getAllResources(Resource.Java:682)
... 48 more
[WARNING] !RequestLog
[INFO] Started ServerConnector@630d1b2f{HTTP/1.1}{0.0.0.0:8080}
[INFO] Started @3993ms
[INFO] Started Jetty Server
m2
フォルダーを削除してこのエラーを解決しました。 Eclipseは、再起動およびライブラリの再ダウンロード後にインデックスを再構築しています。
破損したファイルは1つだけかもしれません。どのjarが破損しているかを調べることができます。この例では、jetty-9.2.19.v20160908
の.m2/repo
を探し、それだけを削除します。失敗した場合は、.m2
リポジトリをすべて削除します。