I come back again with one of my problem.
I have developped a SpringBoot app but I have now some errors. When I launch the app with Eclipse I don't have any error. But when I convert it in a runnable jar file and I lauch it I have these errors : I don't understand why is it working with eclipse and not in a jar file.
:: Spring Boot ::(v2.6.7)
2022-05-19 08:05:29.366 INFO 5520 --- [main] com.example.demo.DemoApplication: Starting DemoApplication using Java 1.8.0_333 on machinetest with PID 5520 (started by tdriss in C:\Users\tdriss\Desktop\Documents)
2022-05-19 08:05:29.378 INFO 5520 --- [main] com.example.demo.DemoApplication: No active profile set, falling back to 1 default profile: "default"
2022-05-19 08:06:00.841 INFO 5520 --- [main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
2022-05-19 08:06:01.501 INFO 5520 --- [main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2022-05-19 08:06:01.501 INFO 5520 --- [main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.62]
2022-05-19 08:06:01.811 ERROR 5520 --- [main] org.apache.catalina.core.ContainerBase : A child container failed during start
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to initialize component [org.apache.catalina.webresources.StandardRoot#14d81f2c]
at java.util.concurrent.FutureTask.report(Unknown Source) [na:1.8.0_333]
at java.util.concurrent.FutureTask.get(Unknown Source) [na:1.8.0_333]
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:926) [jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:835) [jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) [jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1396) [jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1386) [jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
at java.util.concurrent.FutureTask.run(Unknown Source) [na:1.8.0_333]
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75) [jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
at java.util.concurrent.AbstractExecutorService.submit(Unknown Source) [na:1.8.0_333]
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:919) [jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:263) [jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) [jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:432) [jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) [jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:927) [jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) [jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
at org.apache.catalina.startup.Tomcat.start(Tomcat.java:486) [jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.initialize(TomcatWebServer.java:123) [jar:rsrc:spring-boot-2.6.7.jar!/:na]
at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.<init>(TomcatWebServer.java:104) [jar:rsrc:spring-boot-2.6.7.jar!/:na]
at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.getTomcatWebServer(TomcatServletWebServerFactory.java:479) [jar:rsrc:spring-boot-2.6.7.jar!/:na]
at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.getWebServer(TomcatServletWebServerFactory.java:211) [jar:rsrc:spring-boot-2.6.7.jar!/:na]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.createWebServer(ServletWebServerApplicationContext.java:182) [jar:rsrc:spring-boot-2.6.7.jar!/:na]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:160) [jar:rsrc:spring-boot-2.6.7.jar!/:na]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:577) [jar:rsrc:spring-context-5.3.19.jar!/:na]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145) [jar:rsrc:spring-boot-2.6.7.jar!/:na]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:740) [jar:rsrc:spring-boot-2.6.7.jar!/:na]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:415) [jar:rsrc:spring-boot-2.6.7.jar!/:na]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:303) [jar:rsrc:spring-boot-2.6.7.jar!/:na]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1312) [jar:rsrc:spring-boot-2.6.7.jar!/:na]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1301) [jar:rsrc:spring-boot-2.6.7.jar!/:na]
at com.example.demo.DemoApplication.main(DemoApplication.java:22) [rsrc:./:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_333]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_333]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_333]
at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.8.0_333]
at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:61) [OPAL2022tomcatenable.jar:na]
Caused by: org.apache.catalina.LifecycleException: Failed to initialize component [org.apache.catalina.webresources.StandardRoot#14d81f2c]
at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:440) [jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:139) [jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:173) [jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:4885) ~[jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5023) ~[jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) [jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1396) [jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1386) [jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
at java.util.concurrent.FutureTask.run(Unknown Source) [na:1.8.0_333]
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75) [jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
at java.util.concurrent.AbstractExecutorService.submit(Unknown Source) [na:1.8.0_333]
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:919) [jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
... 34 common frames omitted
Caused by: java.lang.Error: factory already defined
at java.net.URL.setURLStreamHandlerFactory(Unknown Source) ~[na:1.8.0_333]
at org.apache.catalina.webresources.TomcatURLStreamHandlerFactory.<init>(TomcatURLStreamHandlerFactory.java:130) ~[jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
at org.apache.catalina.webresources.TomcatURLStreamHandlerFactory.getInstanceInternal(TomcatURLStreamHandlerFactory.java:53) ~[jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
at org.apache.catalina.webresources.TomcatURLStreamHandlerFactory.register(TomcatURLStreamHandlerFactory.java:77) ~[jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
at org.apache.catalina.webresources.StandardRoot.registerURLStreamHandlerFactory(StandardRoot.java:711) ~[jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
at org.apache.catalina.webresources.StandardRoot.initInternal(StandardRoot.java:698) ~[jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136) [jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
... 44 common frames omitted
2022-05-19 08:06:01.820 ERROR 5520 --- [main] org.apache.catalina.core.ContainerBase : A child container failed during start
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: A child container failed during start
at java.util.concurrent.FutureTask.report(Unknown Source) ~[na:1.8.0_333]
at java.util.concurrent.FutureTask.get(Unknown Source) ~[na:1.8.0_333]
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:926) ~[jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:263) [jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) [jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:432) [jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) [jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:927) [jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) [jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
at org.apache.catalina.startup.Tomcat.start(Tomcat.java:486) [jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.initialize(TomcatWebServer.java:123) [jar:rsrc:spring-boot-2.6.7.jar!/:na]
at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.<init>(TomcatWebServer.java:104) [jar:rsrc:spring-boot-2.6.7.jar!/:na]
at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.getTomcatWebServer(TomcatServletWebServerFactory.java:479) [jar:rsrc:spring-boot-2.6.7.jar!/:na]
at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.getWebServer(TomcatServletWebServerFactory.java:211) [jar:rsrc:spring-boot-2.6.7.jar!/:na]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.createWebServer(ServletWebServerApplicationContext.java:182) [jar:rsrc:spring-boot-2.6.7.jar!/:na]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:160) [jar:rsrc:spring-boot-2.6.7.jar!/:na]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:577) [jar:rsrc:spring-context-5.3.19.jar!/:na]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145) [jar:rsrc:spring-boot-2.6.7.jar!/:na]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:740) [jar:rsrc:spring-boot-2.6.7.jar!/:na]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:415) [jar:rsrc:spring-boot-2.6.7.jar!/:na]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:303) [jar:rsrc:spring-boot-2.6.7.jar!/:na]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1312) [jar:rsrc:spring-boot-2.6.7.jar!/:na]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1301) [jar:rsrc:spring-boot-2.6.7.jar!/:na]
at com.example.demo.DemoApplication.main(DemoApplication.java:22) [rsrc:./:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_333]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_333]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_333]
at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.8.0_333]
at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:61) [OPAL2022tomcatenable.jar:na]
Caused by: org.apache.catalina.LifecycleException: A child container failed during start
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:938) ~[jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:835) ~[jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) [jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1396) ~[jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1386) ~[jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
at java.util.concurrent.FutureTask.run(Unknown Source) ~[na:1.8.0_333]
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75) ~[jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
at java.util.concurrent.AbstractExecutorService.submit(Unknown Source) ~[na:1.8.0_333]
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:919) ~[jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
... 26 common frames omitted
Caused by: java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to initialize component [org.apache.catalina.webresources.StandardRoot#14d81f2c]
at java.util.concurrent.FutureTask.report(Unknown Source) ~[na:1.8.0_333]
at java.util.concurrent.FutureTask.get(Unknown Source) ~[na:1.8.0_333]
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:926) ~[jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
... 34 common frames omitted
Caused by: org.apache.catalina.LifecycleException: Failed to initialize component [org.apache.catalina.webresources.StandardRoot#14d81f2c]
at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:440) [jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:139) [jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:173) [jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:4885) ~[jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5023) ~[jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) [jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1396) ~[jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1386) ~[jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
at java.util.concurrent.FutureTask.run(Unknown Source) ~[na:1.8.0_333]
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75) ~[jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
at java.util.concurrent.AbstractExecutorService.submit(Unknown Source) ~[na:1.8.0_333]
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:919) ~[jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
... 34 common frames omitted
Caused by: java.lang.Error: factory already defined
at java.net.URL.setURLStreamHandlerFactory(Unknown Source) ~[na:1.8.0_333]
at org.apache.catalina.webresources.TomcatURLStreamHandlerFactory.<init>(TomcatURLStreamHandlerFactory.java:130) ~[jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
at org.apache.catalina.webresources.TomcatURLStreamHandlerFactory.getInstanceInternal(TomcatURLStreamHandlerFactory.java:53) ~[jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
at org.apache.catalina.webresources.TomcatURLStreamHandlerFactory.register(TomcatURLStreamHandlerFactory.java:77) ~[jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
at org.apache.catalina.webresources.StandardRoot.registerURLStreamHandlerFactory(StandardRoot.java:711) ~[jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
at org.apache.catalina.webresources.StandardRoot.initInternal(StandardRoot.java:698) ~[jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136) [jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
... 44 common frames omitted
2022-05-19 08:06:01.830 INFO 5520 --- [main] o.apache.catalina.core.StandardService : Stopping service [Tomcat]
2022-05-19 08:06:03.335 WARN 5520 --- [main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat
2022-05-19 08:06:03.363 INFO 5520 --- [main] ConditionEvaluationReportLoggingListener :
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2022-05-19 08:06:03.428 ERROR 5520 --- [main] o.s.boot.SpringApplication : Application run failed
org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:163) ~[jar:rsrc:spring-boot-2.6.7.jar!/:na]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:577) ~[jar:rsrc:spring-context-5.3.19.jar!/:na]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145) ~[jar:rsrc:spring-boot-2.6.7.jar!/:na]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:740) [jar:rsrc:spring-boot-2.6.7.jar!/:na]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:415) [jar:rsrc:spring-boot-2.6.7.jar!/:na]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:303) [jar:rsrc:spring-boot-2.6.7.jar!/:na]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1312) [jar:rsrc:spring-boot-2.6.7.jar!/:na]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1301) [jar:rsrc:spring-boot-2.6.7.jar!/:na]
at com.example.demo.DemoApplication.main(DemoApplication.java:22) [rsrc:./:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_333]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_333]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_333]
at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.8.0_333]
at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:61) [OPAL2022tomcatenable.jar:na]
Caused by: org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat
at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.initialize(TomcatWebServer.java:142) ~[jar:rsrc:spring-boot-2.6.7.jar!/:na]
at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.<init>(TomcatWebServer.java:104) ~[jar:rsrc:spring-boot-2.6.7.jar!/:na]
at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.getTomcatWebServer(TomcatServletWebServerFactory.java:479) ~[jar:rsrc:spring-boot-2.6.7.jar!/:na]
at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.getWebServer(TomcatServletWebServerFactory.java:211) ~[jar:rsrc:spring-boot-2.6.7.jar!/:na]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.createWebServer(ServletWebServerApplicationContext.java:182) ~[jar:rsrc:spring-boot-2.6.7.jar!/:na]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:160) ~[jar:rsrc:spring-boot-2.6.7.jar!/:na]
... 13 common frames omitted
Caused by: org.apache.catalina.LifecycleException: A child container failed during start
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:938) ~[jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:263) ~[jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) ~[jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:432) ~[jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) ~[jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:927) ~[jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) ~[jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
at org.apache.catalina.startup.Tomcat.start(Tomcat.java:486) ~[jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.initialize(TomcatWebServer.java:123) ~[jar:rsrc:spring-boot-2.6.7.jar!/:na]
... 18 common frames omitted
Caused by: java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: A child container failed during start
at java.util.concurrent.FutureTask.report(Unknown Source) ~[na:1.8.0_333]
at java.util.concurrent.FutureTask.get(Unknown Source) ~[na:1.8.0_333]
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:926) ~[jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
... 26 common frames omitted
Caused by: org.apache.catalina.LifecycleException: A child container failed during start
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:938) ~[jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:835) ~[jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) ~[jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1396) ~[jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1386) ~[jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
at java.util.concurrent.FutureTask.run(Unknown Source) ~[na:1.8.0_333]
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75) ~[jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
at java.util.concurrent.AbstractExecutorService.submit(Unknown Source) ~[na:1.8.0_333]
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:919) ~[jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
... 26 common frames omitted
Caused by: java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to initialize component [org.apache.catalina.webresources.StandardRoot#14d81f2c]
at java.util.concurrent.FutureTask.report(Unknown Source) ~[na:1.8.0_333]
at java.util.concurrent.FutureTask.get(Unknown Source) ~[na:1.8.0_333]
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:926) ~[jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
... 34 common frames omitted
Caused by: org.apache.catalina.LifecycleException: Failed to initialize component [org.apache.catalina.webresources.StandardRoot#14d81f2c]
at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:440) ~[jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:139) ~[jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:173) ~[jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:4885) ~[jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5023) ~[jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) ~[jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1396) ~[jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1386) ~[jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
at java.util.concurrent.FutureTask.run(Unknown Source) ~[na:1.8.0_333]
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75) ~[jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
at java.util.concurrent.AbstractExecutorService.submit(Unknown Source) ~[na:1.8.0_333]
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:919) ~[jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
... 34 common frames omitted
Caused by: java.lang.Error: factory already defined
at java.net.URL.setURLStreamHandlerFactory(Unknown Source) ~[na:1.8.0_333]
at org.apache.catalina.webresources.TomcatURLStreamHandlerFactory.<init>(TomcatURLStreamHandlerFactory.java:130) ~[jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
at org.apache.catalina.webresources.TomcatURLStreamHandlerFactory.getInstanceInternal(TomcatURLStreamHandlerFactory.java:53) ~[jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
at org.apache.catalina.webresources.TomcatURLStreamHandlerFactory.register(TomcatURLStreamHandlerFactory.java:77)~[jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
at org.apache.catalina.webresources.StandardRoot.registerURLStreamHandlerFactory(StandardRoot.java:711)~[jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
at org.apache.catalina.webresources.StandardRoot.initInternal(StandardRoot.java:698) ~[jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136) ~[jar:rsrc:tomcat-embed-core-9.0.62.jar!/:na]
... 44 common frames omitted
I have already try to resolve this by adding
TomcatURLStreamHandlerFactory.disable();
The problem is solved with that but when I want to make an api request on localhost:8080 in my browser, I have this in the console
2022-05-19 09:29:03.166 INFO 972 --- [nio-8080-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring DispatcherServlet 'dispatcherServlet'
2022-05-19 09:29:03.195 INFO 972 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet'
2022-05-19 09:29:03.212 INFO 972 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : Completed initialization in 13 ms
And I have a 404 Error in my browser, I precise that I don't have this problem with the project on eclipse.
And this is my POM file
https://codebeautify.org/alleditor/y2226566c
The problem was just linked with the version of Java and the Java library version. There was also a problem with the export in jar, it was necessary to choose copy required libraries into a sub folder and not the two other options, when we makethe runnable jar file export.
Related
I'm trying to make an endpoint using Springboot but im getting this error upon compilation...
"Correct the classpath of your application so that it contains compatible versions of the classes org.apache.catalina.authenticator.AuthenticatorBase and javax.servlet.ServletContext"
Any suggestions? A google search didnt lead me to the right direction.
at java.util.concurrent.FutureTask.report(Unknown Source) [na:1.8.0_321]
at java.util.concurrent.FutureTask.get(Unknown Source) [na:1.8.0_321]
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:926) [tomcat-embed-core-9.0.64.jar:9.0.64]
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:835) [tomcat-embed-core-9.0.64.jar:9.0.64]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) [tomcat-embed-core-9.0.64.jar:9.0.64]
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1396) [tomcat-embed-core-9.0.64.jar:9.0.64]
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1386) [tomcat-embed-core-9.0.64.jar:9.0.64]
at java.util.concurrent.FutureTask.run(Unknown Source) [na:1.8.0_321]
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75) [tomcat-embed-core-9.0.64.jar:9.0.64]
at java.util.concurrent.AbstractExecutorService.submit(Unknown Source) [na:1.8.0_321]
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:919) [tomcat-embed-core-9.0.64.jar:9.0.64]
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:263) [tomcat-embed-core-9.0.64.jar:9.0.64]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) [tomcat-embed-core-9.0.64.jar:9.0.64]
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:432) [tomcat-embed-core-9.0.64.jar:9.0.64]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) [tomcat-embed-core-9.0.64.jar:9.0.64]
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:930) [tomcat-embed-core-9.0.64.jar:9.0.64]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) [tomcat-embed-core-9.0.64.jar:9.0.64]
at org.apache.catalina.startup.Tomcat.start(Tomcat.java:486) [tomcat-embed-core-9.0.64.jar:9.0.64]
at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.initialize(TomcatWebServer.java:123) [spring-boot-2.7.1.jar:2.7.1]
at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.<init>(TomcatWebServer.java:104) [spring-boot-2.7.1.jar:2.7.1]
at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.getTomcatWebServer(TomcatServletWebServerFactory.java:479) [spring-boot-2.7.1.jar:2.7.1]
at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.getWebServer(TomcatServletWebServerFactory.java:211) [spring-boot-2.7.1.jar:2.7.1]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.createWebServer(ServletWebServerApplicationContext.java:184) [spring-boot-2.7.1.jar:2.7.1]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:162) [spring-boot-2.7.1.jar:2.7.1]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:577) [spring-context-5.3.21.jar:5.3.21]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:147) [spring-boot-2.7.1.jar:2.7.1]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:734) [spring-boot-2.7.1.jar:2.7.1]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:408) [spring-boot-2.7.1.jar:2.7.1]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:308) [spring-boot-2.7.1.jar:2.7.1]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1306) [spring-boot-2.7.1.jar:2.7.1]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1295) [spring-boot-2.7.1.jar:2.7.1]
at com.example.HelloWorld.HelloWorldApplication.main(HelloWorldApplication.java:10) [main/:na]
Caused by: org.apache.catalina.LifecycleException: Failed to start component [NonLoginAuthenticator[StandardEngine[Tomcat].StandardHost[localhost].TomcatEmbeddedContext[]]]
at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:440) [tomcat-embed-core-9.0.64.jar:9.0.64]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:198) [tomcat-embed-core-9.0.64.jar:9.0.64]
at org.apache.catalina.core.StandardPipeline.startInternal(StandardPipeline.java:176) ~[tomcat-embed-core-9.0.64.jar:9.0.64]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) [tomcat-embed-core-9.0.64.jar:9.0.64]
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5147) ~[tomcat-embed-core-9.0.64.jar:9.0.64]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) [tomcat-embed-core-9.0.64.jar:9.0.64]
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1396) [tomcat-embed-core-9.0.64.jar:9.0.64]
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1386) [tomcat-embed-core-9.0.64.jar:9.0.64]
at java.util.concurrent.FutureTask.run(Unknown Source) [na:1.8.0_321]
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75) [tomcat-embed-core-9.0.64.jar:9.0.64]
at java.util.concurrent.AbstractExecutorService.submit(Unknown Source) [na:1.8.0_321]
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:919) [tomcat-embed-core-9.0.64.jar:9.0.64]
... 29 common frames omitted
Caused by: java.lang.NoSuchMethodError: javax.servlet.ServletContext.getVirtualServerName()Ljava/lang/String;
at org.apache.catalina.authenticator.AuthenticatorBase.startInternal(AuthenticatorBase.java:1319) ~[tomcat-embed-core-9.0.64.jar:9.0.64]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) [tomcat-embed-core-9.0.64.jar:9.0.64]
... 39 common frames omitted
2022-07-07 17:02:17.896 ERROR 1512 --- [ main] org.apache.catalina.core.ContainerBase : A child container failed during start
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: A child container failed during start
at java.util.concurrent.FutureTask.report(Unknown Source) ~[na:1.8.0_321]
at java.util.concurrent.FutureTask.get(Unknown Source) ~[na:1.8.0_321]
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:926) ~[tomcat-embed-core-9.0.64.jar:9.0.64]
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:263) [tomcat-embed-core-9.0.64.jar:9.0.64]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) [tomcat-embed-core-9.0.64.jar:9.0.64]
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:432) [tomcat-embed-core-9.0.64.jar:9.0.64]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) [tomcat-embed-core-9.0.64.jar:9.0.64]
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:930) [tomcat-embed-core-9.0.64.jar:9.0.64]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) [tomcat-embed-core-9.0.64.jar:9.0.64]
at org.apache.catalina.startup.Tomcat.start(Tomcat.java:486) [tomcat-embed-core-9.0.64.jar:9.0.64]
at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.initialize(TomcatWebServer.java:123) [spring-boot-2.7.1.jar:2.7.1]
at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.<init>(TomcatWebServer.java:104) [spring-boot-2.7.1.jar:2.7.1]
at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.getTomcatWebServer(TomcatServletWebServerFactory.java:479) [spring-boot-2.7.1.jar:2.7.1]
at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.getWebServer(TomcatServletWebServerFactory.java:211) [spring-boot-2.7.1.jar:2.7.1]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.createWebServer(ServletWebServerApplicationContext.java:184) [spring-boot-2.7.1.jar:2.7.1]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:162) [spring-boot-2.7.1.jar:2.7.1]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:577) [spring-context-5.3.21.jar:5.3.21]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:147) [spring-boot-2.7.1.jar:2.7.1]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:734) [spring-boot-2.7.1.jar:2.7.1]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:408) [spring-boot-2.7.1.jar:2.7.1]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:308) [spring-boot-2.7.1.jar:2.7.1]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1306) [spring-boot-2.7.1.jar:2.7.1]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1295) [spring-boot-2.7.1.jar:2.7.1]
at com.example.HelloWorld.HelloWorldApplication.main(HelloWorldApplication.java:10) [main/:na]
Caused by: org.apache.catalina.LifecycleException: A child container failed during start
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:938) ~[tomcat-embed-core-9.0.64.jar:9.0.64]
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:835) ~[tomcat-embed-core-9.0.64.jar:9.0.64]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) [tomcat-embed-core-9.0.64.jar:9.0.64]
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1396) ~[tomcat-embed-core-9.0.64.jar:9.0.64]
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1386) ~[tomcat-embed-core-9.0.64.jar:9.0.64]
at java.util.concurrent.FutureTask.run(Unknown Source) ~[na:1.8.0_321]
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75) ~[tomcat-embed-core-9.0.64.jar:9.0.64]
at java.util.concurrent.AbstractExecutorService.submit(Unknown Source) ~[na:1.8.0_321]
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:919) ~[tomcat-embed-core-9.0.64.jar:9.0.64]
... 21 common frames omitted
Caused by: java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [NonLoginAuthenticator[StandardEngine[Tomcat].StandardHost[localhost].TomcatEmbeddedContext[]]]
at java.util.concurrent.FutureTask.report(Unknown Source) ~[na:1.8.0_321]
at java.util.concurrent.FutureTask.get(Unknown Source) ~[na:1.8.0_321]
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:926) ~[tomcat-embed-core-9.0.64.jar:9.0.64]
... 29 common frames omitted
Caused by: org.apache.catalina.LifecycleException: Failed to start component [NonLoginAuthenticator[StandardEngine[Tomcat].StandardHost[localhost].TomcatEmbeddedContext[]]]
at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:440) [tomcat-embed-core-9.0.64.jar:9.0.64]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:198) [tomcat-embed-core-9.0.64.jar:9.0.64]
at org.apache.catalina.core.StandardPipeline.startInternal(StandardPipeline.java:176) ~[tomcat-embed-core-9.0.64.jar:9.0.64]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) [tomcat-embed-core-9.0.64.jar:9.0.64]
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5147) ~[tomcat-embed-core-9.0.64.jar:9.0.64]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) [tomcat-embed-core-9.0.64.jar:9.0.64]
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1396) ~[tomcat-embed-core-9.0.64.jar:9.0.64]
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1386) ~[tomcat-embed-core-9.0.64.jar:9.0.64]
at java.util.concurrent.FutureTask.run(Unknown Source) ~[na:1.8.0_321]
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75) ~[tomcat-embed-core-9.0.64.jar:9.0.64]
at java.util.concurrent.AbstractExecutorService.submit(Unknown Source) ~[na:1.8.0_321]
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:919) ~[tomcat-embed-core-9.0.64.jar:9.0.64]
... 29 common frames omitted
Caused by: java.lang.NoSuchMethodError: javax.servlet.ServletContext.getVirtualServerName()Ljava/lang/String;
at org.apache.catalina.authenticator.AuthenticatorBase.startInternal(AuthenticatorBase.java:1319) ~[tomcat-embed-core-9.0.64.jar:9.0.64]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) [tomcat-embed-core-9.0.64.jar:9.0.64]
... 39 common frames omitted
2022-07-07 17:02:17.896 INFO 1512 --- [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat]
2022-07-07 17:02:17.899 WARN 1512 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat
2022-07-07 17:02:17.905 INFO 1512 --- [ main] ConditionEvaluationReportLoggingListener :
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2022-07-07 17:02:17.922 ERROR 1512 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :
***************************
APPLICATION FAILED TO START
***************************
Description:
An attempt was made to call a method that does not exist. The attempt was made from the following location:
org.apache.catalina.authenticator.AuthenticatorBase.startInternal(AuthenticatorBase.java:1319)
The following method did not exist:
javax.servlet.ServletContext.getVirtualServerName()Ljava/lang/String;
The calling method's class, org.apache.catalina.authenticator.AuthenticatorBase, was loaded from the following location:
jar:file:/C:/Users/axf924/.gradle/caches/modules-2/files-2.1/org.apache.tomcat.embed/tomcat-embed-core/9.0.64/2d91a06d1b93ba13a2cca9e9ea7c143a64037351/tomcat-embed-core-9.0.64.jar!/org/apache/catalina/authenticator/AuthenticatorBase.class
The called method's class, javax.servlet.ServletContext, is available from the following locations:
jar:file:/C:/Program%20Files/Java/jre1.8.0_321/lib/ext/servlet-api.jar!/javax/servlet/ServletContext.class
jar:file:/C:/Users/axf924/.gradle/caches/modules-2/files-2.1/org.apache.tomcat.embed/tomcat-embed-core/9.0.64/2d91a06d1b93ba13a2cca9e9ea7c143a64037351/tomcat-embed-core-9.0.64.jar!/javax/servlet/ServletContext.class
jar:file:/C:/Program%20Files/Java/jre1.8.0_321/lib/ext/servlet-api.jar!/javax/servlet/ServletContext.class
The called method's class hierarchy was loaded from the following locations:
javax.servlet.ServletContext: file:/C:/Program%20Files/Java/jre1.8.0_321/lib/ext/servlet-api.jar
Action:
Correct the classpath of your application so that it contains compatible versions of the classes org.apache.catalina.authenticator.AuthenticatorBase and javax.servlet.ServletContext
build.gradle
implementation 'org.springframework.boot:spring-boot-starter-web'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
compileOnly group: 'javax.servlet', name: 'servlet-api', version: '2.3'
compile 'javax.servlet:javax.servlet-api:3.0.1'
compile group: 'org.apache.tomcat', name: 'tomcat-catalina', version: '8.5.24'
}```
Your Tomcat version 8.5.24 is using Servlet API 3.1, see this : https://tomcat.apache.org/whichversion.html
You have to upgrade you servlet-api dependency from 3.0.1 to 3.1
There are several issues with your Gradle configuration:
These dependencies have conflicting versions, you only need one of them:
compileOnly group: 'javax.servlet', name: 'servlet-api', version: '2.3'
compile 'javax.servlet:javax.servlet-api:3.0.1'
servlet-api dependency with a proper version is already provided by spring-boot-web-starter, so you don't need to specify it at all, you can just remove both of those lines.
The tomcat-catalina dependency is most likely not needed too, since spring-boot-web-starter already contains embedded Tomcat, and it's not the best idea to include Tomcat in your compilation classpath anyway. So this line can also be removed:
compile group: 'org.apache.tomcat', name: 'tomcat-catalina', version: '8.5.24'
I am running the project by using the startup.bat option in tomcat 10 windows.
I did not modify my code from javax to Jakarta As there are lots of codes getting changed if I modify the code also not able to find out spring dependency for Jakarta.
As per client requirement, I Have to deploy the Application on tomcat10 and java8.previously we are using tomcat9 and java8 for the application.
As per tomcat10 instructions if we deploy an application that is using javax then tomcat10 automatically converts the javax to Jakarta. I follow the process by giving the following link :
https://www.appsdeveloperblog.com/deploy-a-spring-boot-rest-app-as-a-war-to-tomcat-10/
26-Dec-2021 12:02:00.713 SEVERE [main] org.apache.tomcat.jakartaee.Migration.migrateArchiveStreaming Failed to migrate archive [WEB-INF/lib/sbm-java-plugin-1.3-jar-with-dependencies.jar]. Using the "-zipInMemory" option may help.
java.util.zip.ZipException: duplicate entry: META-INF/LICENSE
at java.util.zip.ZipOutputStream.putNextEntry(Unknown Source)
at org.apache.tomcat.jakartaee.Migration.migrateArchiveStreaming(Migration.java:228)
at org.apache.tomcat.jakartaee.Migration.migrateStream(Migration.java:289)
at org.apache.tomcat.jakartaee.Migration.migrateArchiveStreaming(Migration.java:229)
at org.apache.tomcat.jakartaee.Migration.migrateStream(Migration.java:289)
at org.apache.tomcat.jakartaee.Migration.migrateFile(Migration.java:200)
at org.apache.tomcat.jakartaee.Migration.execute(Migration.java:166)
at org.apache.catalina.startup.HostConfig.migrateLegacyApp(HostConfig.java:1298)
at org.apache.catalina.startup.HostConfig$MigrateApp.run(HostConfig.java:2048)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.util.concurrent.AbstractExecutorService.submit(Unknown Source)
at org.apache.catalina.startup.HostConfig.migrateLegacyApps(HostConfig.java:1260)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:471)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1708)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:320)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:423)
at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:366)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:946)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:886)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1396)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1386)
at java.util.concurrent.FutureTask.run(Unknown Source)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.util.concurrent.AbstractExecutorService.submit(Unknown Source)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:919)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:263)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:432)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:927)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.startup.Catalina.start(Catalina.java:795)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:345)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:476)
26-Dec-2021 12:02:00.804 SEVERE [main] org.apache.tomcat.jakartaee.Migration.migrateArchiveStreaming Failed to migrate archive [URWAYPGService.war]. Using the "-zipInMemory" option may help.
java.util.zip.ZipException: duplicate entry: META-INF/LICENSE
at java.util.zip.ZipOutputStream.putNextEntry(Unknown Source)
at org.apache.tomcat.jakartaee.Migration.migrateArchiveStreaming(Migration.java:228)
at org.apache.tomcat.jakartaee.Migration.migrateStream(Migration.java:289)
at org.apache.tomcat.jakartaee.Migration.migrateArchiveStreaming(Migration.java:229)
at org.apache.tomcat.jakartaee.Migration.migrateStream(Migration.java:289)
at org.apache.tomcat.jakartaee.Migration.migrateFile(Migration.java:200)
at org.apache.tomcat.jakartaee.Migration.execute(Migration.java:166)
at org.apache.catalina.startup.HostConfig.migrateLegacyApp(HostConfig.java:1298)
at org.apache.catalina.startup.HostConfig$MigrateApp.run(HostConfig.java:2048)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.util.concurrent.AbstractExecutorService.submit(Unknown Source)
at org.apache.catalina.startup.HostConfig.migrateLegacyApps(HostConfig.java:1260)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:471)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1708)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:320)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:423)
at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:366)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:946)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:886)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1396)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1386)
at java.util.concurrent.FutureTask.run(Unknown Source)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.util.concurrent.AbstractExecutorService.submit(Unknown Source)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:919)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:263)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:432)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:927)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.startup.Catalina.start(Catalina.java:795)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:345)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:476)
26-Dec-2021 12:02:00.807 WARNING [main] org.apache.catalina.startup.HostConfig.migrateLegacyApp Migration failure
java.util.zip.ZipException: duplicate entry: META-INF/LICENSE
at java.util.zip.ZipOutputStream.putNextEntry(Unknown Source)
at org.apache.tomcat.jakartaee.Migration.migrateArchiveStreaming(Migration.java:228)
at org.apache.tomcat.jakartaee.Migration.migrateStream(Migration.java:289)
at org.apache.tomcat.jakartaee.Migration.migrateArchiveStreaming(Migration.java:229)
at org.apache.tomcat.jakartaee.Migration.migrateStream(Migration.java:289)
at org.apache.tomcat.jakartaee.Migration.migrateFile(Migration.java:200)
at org.apache.tomcat.jakartaee.Migration.execute(Migration.java:166)
at org.apache.catalina.startup.HostConfig.migrateLegacyApp(HostConfig.java:1298)
at org.apache.catalina.startup.HostConfig$MigrateApp.run(HostConfig.java:2048)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.util.concurrent.AbstractExecutorService.submit(Unknown Source)
at org.apache.catalina.startup.HostConfig.migrateLegacyApps(HostConfig.java:1260)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:471)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1708)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:320)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:423)
at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:366)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:946)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:886)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1396)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1386)
at java.util.concurrent.FutureTask.run(Unknown Source)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.util.concurrent.AbstractExecutorService.submit(Unknown Source)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:919)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:263)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:432)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:927)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.startup.Catalina.start(Catalina.java:795)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:345)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:476)
26-Dec-2021 12:02:00.825 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [D:\SAUDI_PG\upgrade-tomcat-10\apache-tomcat-10.0.14-windows-x64\apache-tomcat-10.0.14\webapps\docs]
Your jar file contains duplicate entries which probably cause problems when being deployed. If you run the following command with your jar file you will see the duplicate entries:
$ unzip -l URWAYPGService.war |grep META
When I try to deploy in UAT server I am getting below error.
org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/hr-0.0.1-SNAPSHOT]]
at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:441)
After Google I found out that it is the version problem.
My local system, where I generate war file has 1.8.0.162 java version and UAT server has 1.8.0.181 java version.
How to solve this
24-Aug-2018 23:11:49.820 SEVERE [main] org.apache.catalina.core.ContainerBase.addChildInternal ContainerBase.addChild: start:
org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/hr-0.0.1-SNAPSHOT]]
at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:441)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:198)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:743)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:719)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:703)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:986)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1858)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.util.concurrent.AbstractExecutorService.submit(Unknown Source)
at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:772)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:426)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1585)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:308)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:424)
at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:367)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:969)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:839)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1429)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1419)
at java.util.concurrent.FutureTask.run(Unknown Source)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.util.concurrent.AbstractExecutorService.submit(Unknown Source)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:944)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:261)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:770)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.startup.Catalina.start(Catalina.java:682)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:350)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:492)
Try to start your tomcat without any deployed applications. This helps to verify whether the problem comes from your application or a misconfigured or otherwise corrupted installation of your tomcat.
I am unable to remove this error in tomcat. The error is as followed:-
SEVERE: A child container failed during start
java.util.concurrent.ExecutionException:
org.apache.catalina.LifecycleException: Failed to initialize component
[org.apache.catalina.webresources.JarResourceSet#29f69090] at
java.util.concurrent.FutureTask.report(Unknown Source) at
java.util.concurrent.FutureTask.get(Unknown Source) at
org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:949)
at
org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:839)
at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1427)
at
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1417)
at java.util.concurrent.FutureTask.run(Unknown Source) at
org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.util.concurrent.AbstractExecutorService.submit(Unknown Source)
at
org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:943)
at
org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:258)
at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at
org.apache.catalina.core.StandardService.startInternal(StandardService.java:422)
at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at
org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:770)
at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.startup.Catalina.start(Catalina.java:682) at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at
java.lang.reflect.Method.invoke(Unknown Source) at
org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:350) at
org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:492) Caused
by: org.apache.catalina.LifecycleException: Failed to initialize
component [org.apache.catalina.webresources.JarResourceSet#29f69090]
at
org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:441)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:139)
at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:173)
at
org.apache.catalina.webresources.StandardRoot.startInternal(StandardRoot.java:724)
at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at
org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:4758)
at
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4893)
at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1427)
at
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1417)
at java.util.concurrent.FutureTask.run(Unknown Source) at
org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.util.concurrent.AbstractExecutorService.submit(Unknown Source)
at
org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:943)
... 21 more Caused by: java.lang.IllegalArgumentException:
java.util.zip.ZipException: error in opening zip file at
org.apache.catalina.webresources.AbstractSingleArchiveResourceSet.initInternal(AbstractSingleArchiveResourceSet.java:143)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
... 33 more Caused by: java.util.zip.ZipException: error in opening
zip file at java.util.zip.ZipFile.open(Native Method) at
java.util.zip.ZipFile.(Unknown Source) at
java.util.zip.ZipFile.(Unknown Source) at
java.util.jar.JarFile.(Unknown Source) at
java.util.jar.JarFile.(Unknown Source) at
org.apache.tomcat.util.compat.JreCompat.jarFileNewInstance(JreCompat.java:164)
at
org.apache.tomcat.util.compat.JreCompat.jarFileNewInstance(JreCompat.java:149)
at
org.apache.catalina.webresources.AbstractSingleArchiveResourceSet.initInternal(AbstractSingleArchiveResourceSet.java:140)
... 34 more Jul 18, 2018 5:16:20 PM
org.apache.catalina.core.ContainerBase startInternal SEVERE: A child
container failed during start java.util.concurrent.ExecutionException:
org.apache.catalina.LifecycleException: Failed to initialize component
[org.apache.catalina.webresources.JarResourceSet#ca263c2] at
java.util.concurrent.FutureTask.report(Unknown Source) at
java.util.concurrent.FutureTask.get(Unknown Source) at
org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:949)
at
org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:839)
at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1427)
at
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1417)
at java.util.concurrent.FutureTask.run(Unknown Source) at
org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.util.concurrent.AbstractExecutorService.submit(Unknown Source)
at
org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:943)
at
org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:258)
at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at
org.apache.catalina.core.StandardService.startInternal(StandardService.java:422)
at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at
org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:770)
at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.startup.Catalina.start(Catalina.java:682) at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at
java.lang.reflect.Method.invoke(Unknown Source) at
org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:350) at
org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:492) Caused
by: org.apache.catalina.LifecycleException: Failed to initialize
component [org.apache.catalina.webresources.JarResourceSet#ca263c2] at
org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:441)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:139)
at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:173)
at
org.apache.catalina.webresources.StandardRoot.startInternal(StandardRoot.java:724)
at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at
org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:4758)
at
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4893)
at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1427)
at
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1417)
at java.util.concurrent.FutureTask.run(Unknown Source) at
org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.util.concurrent.AbstractExecutorService.submit(Unknown Source)
at
org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:943)
... 21 more Caused by: java.lang.IllegalArgumentException:
java.util.zip.ZipException: error in opening zip file at
org.apache.catalina.webresources.AbstractSingleArchiveResourceSet.initInternal(AbstractSingleArchiveResourceSet.java:143)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
... 33 more Caused by: java.util.zip.ZipException: error in opening
zip file at java.util.zip.ZipFile.open(Native Method) at
java.util.zip.ZipFile.(Unknown Source) at
java.util.zip.ZipFile.(Unknown Source) at
java.util.jar.JarFile.(Unknown Source) at
java.util.jar.JarFile.(Unknown Source) at
org.apache.tomcat.util.compat.JreCompat.jarFileNewInstance(JreCompat.java:164)
at
org.apache.tomcat.util.compat.JreCompat.jarFileNewInstance(JreCompat.java:149)
at
org.apache.catalina.webresources.AbstractSingleArchiveResourceSet.initInternal(AbstractSingleArchiveResourceSet.java:140)
... 34 more Jul 18, 2018 5:16:20 PM
org.apache.catalina.core.ContainerBase startInternal SEVERE: A child
container failed during start java.util.concurrent.ExecutionException:
org.apache.catalina.LifecycleException: Failed to initialize component
[org.apache.catalina.webresources.JarResourceSet#45f45fa1] at
java.util.concurrent.FutureTask.report(Unknown Source) at
java.util.concurrent.FutureTask.get(Unknown Source) at
org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:949)
at
org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:839)
at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1427)
at
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1417)
at java.util.concurrent.FutureTask.run(Unknown Source) at
org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.util.concurrent.AbstractExecutorService.submit(Unknown Source)
at
org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:943)
at
org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:258)
at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at
org.apache.catalina.core.StandardService.startInternal(StandardService.java:422)
at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at
org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:770)
at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.startup.Catalina.start(Catalina.java:682) at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at
java.lang.reflect.Method.invoke(Unknown Source) at
org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:350) at
org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:492) Caused
by: org.apache.catalina.LifecycleException: Failed to initialize
component [org.apache.catalina.webresources.JarResourceSet#45f45fa1]
at
org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:441)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:139)
at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:173)
at
org.apache.catalina.webresources.StandardRoot.startInternal(StandardRoot.java:724)
at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at
org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:4758)
at
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4893)
at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1427)
at
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1417)
at java.util.concurrent.FutureTask.run(Unknown Source) at
org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.util.concurrent.AbstractExecutorService.submit(Unknown Source)
at
org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:943)
... 21 more Caused by: java.lang.IllegalArgumentException:
java.util.zip.ZipException: error in opening zip file at
org.apache.catalina.webresources.AbstractSingleArchiveResourceSet.initInternal(AbstractSingleArchiveResourceSet.java:143)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
... 33 more Caused by: java.util.zip.ZipException: error in opening
zip file at java.util.zip.ZipFile.open(Native Method) at
java.util.zip.ZipFile.(Unknown Source) at
java.util.zip.ZipFile.(Unknown Source) at
java.util.jar.JarFile.(Unknown Source) at
java.util.jar.JarFile.(Unknown Source) at
org.apache.tomcat.util.compat.JreCompat.jarFileNewInstance(JreCompat.java:164)
at
org.apache.tomcat.util.compat.JreCompat.jarFileNewInstance(JreCompat.java:149)
at
org.apache.catalina.webresources.AbstractSingleArchiveResourceSet.initInternal(AbstractSingleArchiveResourceSet.java:140)
... 34 more Jul 18, 2018 5:16:20 PM
org.apache.catalina.core.ContainerBase startInternal SEVERE: A child
container failed during start java.util.concurrent.ExecutionException:
org.apache.catalina.LifecycleException: A child container failed
during start at java.util.concurrent.FutureTask.report(Unknown Source)
at java.util.concurrent.FutureTask.get(Unknown Source) at
org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:949)
at
org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:258)
at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at
org.apache.catalina.core.StandardService.startInternal(StandardService.java:422)
at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at
org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:770)
at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.startup.Catalina.start(Catalina.java:682) at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at
java.lang.reflect.Method.invoke(Unknown Source) at
org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:350) at
org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:492) Caused
by: org.apache.catalina.LifecycleException: A child container failed
during start at
org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:958)
at
org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:839)
at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1427)
at
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1417)
at java.util.concurrent.FutureTask.run(Unknown Source) at
org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.util.concurrent.AbstractExecutorService.submit(Unknown Source)
at
org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:943)
... 13 more Jul 18, 2018 5:16:20 PM
org.apache.catalina.startup.Catalina start SEVERE: The required Server
component failed to start so Tomcat is unable to start.
org.apache.catalina.LifecycleException: A child container failed
during start at
org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:958)
at
org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:258)
at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at
org.apache.catalina.core.StandardService.startInternal(StandardService.java:422)
at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at
org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:770)
at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.startup.Catalina.start(Catalina.java:682) at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at
java.lang.reflect.Method.invoke(Unknown Source) at
org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:350) at
org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:492)
Please let me know how to resolve Lifecycle Exception in tomcat?
Caused by: java.lang.IllegalArgumentException:
java.util.zip.ZipException: error in opening zip file at
Seems that tomcat is not able to open your WAR file. Can you make sure the contents of your WAR file and also the WAR file itself if not corrupt. Try opening it with WINRAR and see if indeed the archive structure is correct.
Good afternoon
I have the following problem on my production server. I have already installed tomcat 8 and 9 to test, JDK 8, set everything right (I believe) and one of my projects does not go up. The strange thing that the WAR generated with maven goes up on my physical machine, but not on the server. Thanks in advance
TOMCAT output:
14-Dec-2017 16:41:07.886 INFO [main] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive [/opt/tomcat/apache-tomcat-9.0.2/webapps/Orcamentario.war]
14-Dec-2017 16:41:08.129 SEVERE [main] org.apache.catalina.core.ContainerBase.addChildInternal ContainerBase.addChild: start:
org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/Orcamentario]]
at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:441)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:198)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:740)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:716)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:703)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:976)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1847)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:112)
at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:761)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:431)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1575)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:308)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:424)
at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:367)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:964)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:839)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1425)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1415)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:941)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:258)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:770)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.startup.Catalina.start(Catalina.java:671)
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.apache.catalina.startup.Bootstrap.start(Bootstrap.java:353)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:493)
Caused by: java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/faces/webapp/FacesServlet
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at org.apache.catalina.loader.WebappClassLoaderBase.findClassInternal(WebappClassLoaderBase.java:2263)
at org.apache.catalina.loader.WebappClassLoaderBase.findClass(WebappClassLoaderBase.java:799)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1244)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1104)
at com.sun.faces.config.FacesInitializer.<clinit>(FacesInitializer.java:115)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at org.apache.catalina.startup.WebappServiceLoader.loadServices(WebappServiceLoader.java:188)
at org.apache.catalina.startup.WebappServiceLoader.load(WebappServiceLoader.java:159)
at org.apache.catalina.startup.ContextConfig.processServletContainerInitializers(ContextConfig.java:1661)
at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1138)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:775)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:299)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5003)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
... 38 more
14-Dec-2017 16:41:08.145 SEVERE [main] org.apache.catalina.startup.HostConfig.deployWAR Error deploying web application archive [/opt/tomcat/apache-tomcat-9.0.2/webapps/Orcamentario.war]
java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/Orcamentario]]
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:744)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:716)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:703)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:976)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1847)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:112)
at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:761)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:431)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1575)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:308)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:424)
at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:367)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:964)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:839)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1425)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1415)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:941)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:258)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:770)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.startup.Catalina.start(Catalina.java:671)
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.apache.catalina.startup.Bootstrap.start(Bootstrap.java:353)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:493)
I solve the problem changing the version of javax.faces for 2.3.3 and javax-servlet-api for 4.0.0.
But now I have the folowing exception:
Absent Code attribute in method that is not native or abstract in class file javax/persistence/OptimisticLockException