J'essaie de lancer un projet RESTful Apache-camel très simple avec jetty. J'ai suivi les instructions de http://camel.Apache.org/restlet.html .
Mon application s'exécutera, mais je ne suis pas en mesure d'afficher mon projet car chaque fonction donne une erreur 503 de la jetée. Dans Eclipse, je peux voir quelques erreurs dans Java.util.Zip.Zipexecution. (affiché ci-dessous) mais je n'ai pas utilisé cette lib et j'utilise maven pour obtenir toutes les bibliothèques nécessaires.
Chaque recherche m'apprend que le fichier JAR/WAR est peut-être corrompu, mais comme j'utilise Maven (et je ne l'ai pas utilisé plus tôt), je ne savais pas où chercher un fichier.
Comment puis-je résoudre ça?
Erreur complète:
[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
Résolu cette erreur en supprimant le m2
dossier. Eclipse reconstruit l'index après un redémarrage et télécharge à nouveau la bibliothèque.
Il peut s'agir d'un seul fichier corrompu. On peut essayer de déterminer quel pot est corrompu. Dans cet exemple, je ressemblerais à jetty-9.2.19.v20160908
dans .m2/repo
et ne l'enlèverait que. Si cela échoue, je supprimerais tout .m2
référentiel.