0
votes

Tomcat server 9.0 not starting in eclipse It showing error "Server Tomcat v9.0 Server at localhost failed to start."I have tried alot of things from changing port to uninstalling tomcat and eclipse then reinstalling it again but nothing changed,thanks in advance for your help.

enter image description here

few things that may help : enter image description here

    <?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
<servlet>
    <servlet-name>Serv</servlet-name>
    <servlet-class>com.exemplemvc.ServletControleur</servlet-class>
</servlet>
<servlet-mapping>
    <servlet-name>Serv</servlet-name>
    <url-pattern>s</url-pattern>
</servlet-mapping>
</web-app>

nov. 25, 2018 12:13:58 PM org.apache.catalina.startup.VersionLoggerListener log INFOS: Server version: Apache Tomcat/9.0.13 nov. 25, 2018 12:13:58 PM org.apache.catalina.startup.VersionLoggerListener log INFOS: Server built: Nov 2 2018 14:27:55 UTC nov. 25, 2018 12:13:58 PM org.apache.catalina.startup.VersionLoggerListener log INFOS: Server number: 9.0.13.0 nov. 25, 2018 12:13:58 PM org.apache.catalina.startup.VersionLoggerListener log INFOS: OS Name: Windows 10 nov. 25, 2018 12:13:58 PM org.apache.catalina.startup.VersionLoggerListener log INFOS: OS Version: 10.0 nov. 25, 2018 12:13:58 PM org.apache.catalina.startup.VersionLoggerListener log INFOS: Architecture: amd64 nov. 25, 2018 12:13:58 PM org.apache.catalina.startup.VersionLoggerListener log INFOS: Java Home: C:\Program Files\Java\jre1.8.0_191 nov. 25, 2018 12:13:58 PM org.apache.catalina.startup.VersionLoggerListener log INFOS: JVM Version: 1.8.0_191-b12 nov. 25, 2018 12:13:58 PM org.apache.catalina.startup.VersionLoggerListener log INFOS: JVM Vendor: Oracle Corporation nov. 25, 2018 12:13:58 PM org.apache.catalina.startup.VersionLoggerListener log INFOS: CATALINA_BASE:
C:\Users\USER\eclipse-workspace.metadata.plugins\org.eclipse.wst.server.core\tmp0 nov. 25, 2018 12:13:58 PM org.apache.catalina.startup.VersionLoggerListener log INFOS: CATALINA_HOME: C:\Users\USER\Downloads\apache-tomcat-9.0.13 nov. 25, 2018 12:13:58 PM org.apache.catalina.startup.VersionLoggerListener log INFOS: Command line argument: -Dcatalina.base=C:\Users\USER\eclipse-workspace.metadata.plugins\org.eclipse.wst.server.core\tmp0 nov. 25, 2018 12:13:58 PM org.apache.catalina.startup.VersionLoggerListener log INFOS: Command line argument: -Dcatalina.home=C:\Users\USER\Downloads\apache-tomcat-9.0.13 nov. 25, 2018 12:13:58 PM org.apache.catalina.startup.VersionLoggerListener log INFOS: Command line argument: -Dwtp.deploy=C:\Users\USER\eclipse-workspace.metadata.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps nov. 25, 2018 12:13:58 PM org.apache.catalina.startup.VersionLoggerListener log INFOS: Command line argument: -Djava.endorsed.dirs=C:\Users\USER\Downloads\apache-tomcat-9.0.13\endorsed nov. 25, 2018 12:13:58 PM org.apache.catalina.startup.VersionLoggerListener log INFOS: Command line argument: -Dfile.encoding=MS932 nov. 25, 2018 12:13:58 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent INFOS: Loaded APR based Apache Tomcat Native library [1.2.18] using APR version [1.6.5]. nov. 25, 2018 12:13:58 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent INFOS: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true]. nov. 25, 2018 12:13:58 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent INFOS: APR/OpenSSL configuration: useAprConnector [false], useOpenSSL [true] nov. 25, 2018 12:13:58 PM org.apache.catalina.core.AprLifecycleListener initializeSSL INFOS: OpenSSL successfully initialized [OpenSSL 1.1.1 11 Sep 2018] nov. 25, 2018 12:13:58 PM org.apache.coyote.AbstractProtocol init INFOS: Initializing ProtocolHandler ["http-nio-8080"] nov. 25, 2018 12:13:58 PM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector INFOS: Using a shared selector for servlet write/read nov. 25, 2018 12:13:58 PM org.apache.coyote.AbstractProtocol init INFOS: Initializing ProtocolHandler ["ajp-nio-8009"] nov. 25, 2018 12:13:58 PM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector INFOS: Using a shared selector for servlet write/read nov. 25, 2018 12:13:58 PM org.apache.catalina.startup.Catalina load INFOS: Initialization processed in 893 ms nov. 25, 2018 12:13:58 PM org.apache.catalina.core.StandardService startInternal INFOS: D?marrage du service [Catalina] nov. 25, 2018 12:13:58 PM org.apache.catalina.core.StandardEngine startInternal INFOS: Starting Servlet Engine: Apache Tomcat/9.0.13 nov. 25, 2018 12:13:59 PM org.apache.catalina.core.ContainerBase startInternal GRAVE: A child container failed during start java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/EX1TP3]] 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:951) at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:831) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1432) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1422) 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:801) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) at org.apache.catalina.startup.Catalina.start(Catalina.java:695) 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 start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/EX1TP3]] 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$StartChild.call(ContainerBase.java:1432) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1422) 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) ... 21 more Caused by: java.lang.IllegalArgumentException: [s] invalide dans l'association de servlet (servlet mapping) at org.apache.catalina.core.StandardContext.addServletMappingDecoded(StandardContext.java:3136) at org.apache.catalina.Context.addServletMappingDecoded(Context.java:879) at org.apache.catalina.startup.ContextConfig.configureContext(ContextConfig.java:1380) at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1191) at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:769) 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:5007) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) ... 27 more

nov. 25, 2018 12:13:59 PM org.apache.catalina.core.ContainerBase startInternal GRAVE: 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:951) 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:801) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) at org.apache.catalina.startup.Catalina.start(Catalina.java:695) 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:963) at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:831) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1432) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1422) 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) ... 13 more Caused by: java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/EX1TP3]] 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:951) ... 21 more Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/EX1TP3]] 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$StartChild.call(ContainerBase.java:1432) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1422) 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) ... 21 more Caused by: java.lang.IllegalArgumentException: [s] invalide dans l'association de servlet (servlet mapping) at org.apache.catalina.core.StandardContext.addServletMappingDecoded(StandardContext.java:3136) at org.apache.catalina.Context.addServletMappingDecoded(Context.java:879) at org.apache.catalina.startup.ContextConfig.configureContext(ContextConfig.java:1380) at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1191) at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:769) 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:5007) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) ... 27 more

nov. 25, 2018 12:13:59 PM org.apache.catalina.startup.Catalina start GRAVE: 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:963) 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:801) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) at org.apache.catalina.startup.Catalina.start(Catalina.java:695) 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: 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:951) ... 13 more Caused by: org.apache.catalina.LifecycleException: A child container failed during start at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:963) at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:831) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1432) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1422) 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) ... 13 more Caused by: java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/EX1TP3]] 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:951) ... 21 more Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/EX1TP3]] 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$StartChild.call(ContainerBase.java:1432) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1422) 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) ... 21 more Caused by: java.lang.IllegalArgumentException: [s] invalide dans l'association de servlet (servlet mapping) at org.apache.catalina.core.StandardContext.addServletMappingDecoded(StandardContext.java:3136) at org.apache.catalina.Context.addServletMappingDecoded(Context.java:879) at org.apache.catalina.startup.ContextConfig.configureContext(ContextConfig.java:1380) at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1191) at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:769) 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:5007) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) ... 27 more

nov. 25, 2018 12:13:59 PM org.apache.coyote.AbstractProtocol pause INFOS: Pausing ProtocolHandler ["http-nio-8080"] nov. 25, 2018 12:13:59 PM org.apache.coyote.AbstractProtocol pause INFOS: Pausing ProtocolHandler ["ajp-nio-8009"] nov. 25, 2018 12:13:59 PM org.apache.catalina.core.StandardService stopInternal INFOS: Arr?t du service [Catalina] nov. 25, 2018 12:13:59 PM org.apache.coyote.AbstractProtocol destroy INFOS: Destroying ProtocolHandler ["http-nio-8080"] nov. 25, 2018 12:13:59 PM org.apache.coyote.AbstractProtocol destroy INFOS: Destroying ProtocolHandler ["ajp-nio-8009"]

1
Update your question to include the content of Tomcat's log that shows the error. As it stands your question cannot be answered because of the lack of information.skomisa
Done ,i guess .ghassen chaieb

1 Answers

1
votes

For problems like this the first thing to examine is the Tomcat log. The root cause is reported near the bottom of the extract you added:

Caused by: java.lang.IllegalArgumentException: [s] invalide dans l'association de servlet (servlet mapping) 

That message tells you:

  • There is a problem with the servlet mapping, which in your case is being done in your web.xml file.
  • The problem relates to the use of s as a mapping since the message states [s] invalide....

Tomcat would not start because of that issue. This is also reported in the log:

The required Server component failed to start so Tomcat is unable to start.

In web.xml the URL pattern is specified as <url-pattern>s</url-pattern>, which is invalid.

It's worth noting that if you use Eclipse's servlet wizard to create a servlet, and attempt to specify a URL pattern of s in URL Mappings you get a very helpful error message:

"s" is unresolvable URL pattern. URL patterns should start with "/" or "*.".

InvalidUrlPattern

To fix the problem just change the URL pattern to start with a forward slash:

 <url-pattern>/s</url-pattern>

Full details are in the Servlet Specification Version 4.0. See Chapter 12 titled Mapping Requests to Servlets, and in particular section 12.2: "Specification of Mappings".