Velvet Star Monitor

Standout celebrity highlights with iconic style.

general

Server Tomcat v9.0 Server at localhost failed to start

Writer Mia Lopez

I am using Eclipse Neon and Tomcat server 9.0 and JDK 1.8 It was working well but unfortunately its giving me error 'Server Tomcat v9.0 Server at localhost failed to start.' I tried to change the ports i.e. connection port and other ports too but it did not solve my problem and this error is shown when I start the server or run the web app I am currently working on. Other solution other than change in port because I tried it and it did not resolve my problem?????

2

15 Answers

I had the same problem with Tomcat 9.xx and Eclipse. None of the given solutions helped me.

However, there is a missing step (for some of us) before recreating a new Server in Eclipse you may need to add the path to a jar file. The missing step was browsing to your /Tomcat-Directory/lib/servlet-api and adding servlet-api.jar

Steps:

1- Right click on the project you work on > Build Path > Configure Build Path > Libraries > Add External JARs

2- Select all JAR files from the Tomcat/bin and Tomcat/lib

3- Click "OK"

This made it work for me. I hope it will help you as well.

Thank you.

  1. Delete server by navigating to Window->Show View->Server. Right click on server and delete it.
  2. Delete Servers folder from Project Explorer
  3. Delete .metadata of eclipse workspace (CAUTION: You will loose all your workspace settings (e.g.: key bindings, appearance, ...))
  4. Now restart eclipse and add Apache Tomcat server.

It will work.

Screenshot

1

Have you tried to put / in the webServlet above your class?

@WebServlet("/nameURL")
public class MyClass extends HttpServlet{}

I was facing a similar problem in my spring MVC project. The problem was in the web.xml file. So in Spring 5 before you configure your dispatcher servlet you have to use the tag

<absolute-ordering></absolute-ordering>

Worked fine for me. Happy Coding.

In my case, I had messed up up with my JAR files. My JAR files were corrupted. So delete existing JAR files and upload new JAR files. Hope this works. *Check 'Markers' tab for errors and warnings.

1

If you can't detect which project creates the problem then simply add and remove it in your server and run. If defective project is not anymore added to the server then server will run correctly. After detecting the problem you can simply follow the steps below.

If you are using data base connection with connection pooling then make sure @Resource(name="jdbc/dbName") is written before private DataSource dataSource in your servlet controller class. Just put it like this in your servlet controller class:

@Resource(name="jdbc/sakila")
private DataSource dataSource;

Right click on the project you work on > Build Path > Configure Build Path > Libraries > Add External JARs--servlet-api.jar and jsp-api.jar if you are deploying web Application

There was once I had messed around the server.xml file, and unwittingly added a Context tag telling the server to load a project I wasn't looking to load, and therefore had not compiled. That threw the Server Tomcat v9.0 Server at localhost failed to start, which went away after I deleted that.

  1. Go to directory (your workspace).metadata.plugins\org.eclipse.wst.server.core\tmp0\conf
  2. Open server.xml file on editor
  3. Delete <Context docBase="(your workspace)\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\(your old project)" path="/(your old project)" reloadable="true" source="org.eclipse.jst.jee.server:(your old project)"/>

there might be some left over from your old project. so, only delete projects that have not been used or that were previously deleted. because if you delete one line then your server will be able to run but not with your project. because some of your project lines were deleted too.

I uninstalled tomcat server, deleted the server from eclipse and reinstalled, reattached tomcat. It's running fine now.

  1. Open the 'server.xml' file.picture1

  2. Press ctrl + f and find the 'shutdown' word. Then change the port number.picture2

  3. done. Because when the connection port number and shutdown port number are the same, then it creates conflict. So, one port number we should change.

This happens because your server HTTP port and your shutdown port are the same.

To resolve this, go to the server.xml file and search. There will be a SHUTDOWN port entry. Change it and your server will work.

There is a possibility that you are missing a "/" in your web.xml file probably in: <servlet-mapping></servlet-mapping>

<url-pattern> missing "/" before pattern name </url-pattern>

possible issue

1

If you are using Spring Framework, please check in the WEB.XML Dispatcher Servlet is configured correctly. Also check if there is any spelling/name incorrectness.

This is the best solution. It worked for me.

Steps:-

1- Open the Servers tab from Windows » Show View » Servers menu.

2- Right click on the server and delete it

3-Create a new server by going New » Server on server tab.

4-Click on Configure runtime environments link.

5-Select the Apache Tomcat Server and remove it. This will remove the Tomcat server configuration.

6-Click on OK and exit the screen above now.

7-From the screen below, choose Apache Tomcat server and click on Next button:

8-Browse to Tomcat Installation Directory.

9-Click on Next and choose which project you would like to deploy:

10-Click on Finish after adding your project.

11-Now launch your Server.

1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy