"Server Tomcat v7.0 Server on the local host could not start" without a stack trace when it is running in the terminal

So, this project turned out, which worked perfectly until the weekend (there are other problems, but at least Tomcat is running). Now, when I try to start the Tomcat server, it immediately gives the following error:

Server Tomcat v7.0 Server at localhost failed to start. 

However, I can start Tomcat just fine through Terminal, and this problem occurs in Eclipse (Eclipse Java EE IDE for web developers. Version: Juno Service Release 1 Build id: 20121004-1855)

I looked through several forums, trying to find a solution, but to no avail! Please help someone in need.

+73
eclipse tomcat
Nov 06
source share
28 answers

To fix this problem, you need to delete the .snap file located in the directory:

 <workspace-directory>\.metadata\.plugins\org.eclipse.core.resources 

After deleting this file, you can start Eclipse without any problems.

+55
Nov 06
source share

** 1. Open the "Servers" tab from the menu "Windows> Show View"> "Servers"

  • Right click on the server and delete it

  • Create a new server by choosing New> Server on Server

  • Click the link "Configure runtime ..."

  • Select the Apache Tomcat v7.0 server and uninstall it. This will remove the Tomcat server configuration. Here many are mistaken - they delete the server, but do not delete the runtime.

  • Click "OK" and exit the screen above.

  • On the next screen, select the Apache Tomcat v7.0 server and click the following button:

  • Search the Tomcat installation directory

  • Click "Next" and select which project you want to deploy:

  • Click Finish after adding the project.

  • Now start your server. This will eliminate the server timeout or any problems setting up the old server. This solution can also be used to fix port upgrade issues. **

+96
Jul 08 '13 at 6:13
source share

To fix this problem, you should delete the tmp folder in the following directory

 <workspace-directory>\.metadata\.plugins\org.eclipse.wst.server.core 

If you have problems deleting this folder, restart eclipse and then delete this folder.

+38
Aug 01 '13 at 6:30
source share

In my case, the problem was in the xml code somehow.

My web.xml looked like this:

 <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd" > <web-app> <display-name>Archetype Created Web Application</display-name> <servlet> <servlet-name>index</servlet-name> <jsp-file>index.jsp</jsp-file> </servlet> <servlet-mapping> <servlet-name>index</servlet-name> <url-pattern>/</url-pattern> </servlet-mapping> </web-app> 

but I changed it to look like

 <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd" > <web-app> <display-name>Archetype Created Web Application</display-name> </web-app> 

and now the server is loading correctly. It’s strange.

+21
Aug 29 '14 at 3:53
source share

Server Tomcat v7.0 Server on the local host did not start.

This error occurs after three cases.

Project and server 1.Clean

or

2. Remove the .snap file from this directory

 <workspace-directory>\.metadata\.plugins\org.eclipse.core.resources 

or

3. Change the temporary file from this directory

 <workspace-directory>\.metadata\.plugins\org.eclipse.wst.server.core 
+12
Nov 23 '13 at 16:53
source share

I ran into this problem because I am defining a servlet mapping in the servlet class and web.xml.

You have to be careful to make sure that you define a servlet mapping in your servlet class and web.xml

1) delete @WebServlet("...")

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

OR

2) delete <servlet></servlet> <servlet-mapping></servlet-mapping>

 <servlet> <servlet-name>ServletLogin</servlet-name> <servlet-class>Login</servlet-class> </servlet> <servlet-mapping> <servlet-name>ServletLogin</servlet-name> <url-pattern>/login</url-pattern> </servlet-mapping> 



Cause:

I am using apache tomcat 7.0 which supports servlet 3.0.

With Java EE annotations, the standard web.xml deployment descriptor is

not necessary. According to the servlet 3.0 specification on

http://jcp.org/en/jsr/detail?id=315

+12
May 09 '15 at 12:43
source share

In my case, the problem was in the web.xml file, where I forgot to precede the url template with "/" (for example, / login.do).

What I decided to solve, as @ Ajak6 mentioned above, by adding the servlet API as an external JAR library for the project.

However, I found a better way by adding Tomcat to the target runtime, as shown below:

1) project> properties

2) in the side menu, select "Target runtime"

3) select Tomcat (click "Apply")

4) click ok

+7
Jan 20 '16 at 15:09
source share

None of the answers mentioned above worked for me. I am using Tomcat 9 in my Eclipse IDE. So I tried the following steps on my Eclipse Neon.

Step # 1: Click the Servers tab to see your server. In my case, it looks like this:

enter image description here

Step # 2: Right-click on the server, select Properties , you will see the following window. Click Switch Location , it will change the location to the image shown in the image below, by default. Click Apply , and then OK to close the window.

enter image description here

Step # 3 Double-click on the Tomcat server, which will open the Overview parameter, as shown in the figure below. The Server Locations was active for me when I did this (it seemed inactive in the image because I already did it on my end and my server is working), and I selected the second switch option, which is equal to Use Tomcat installation (takes control of Tomcat installation) . Then I closed this option, saved the changes when prompted, and started my server. He began to work normally.

enter image description here

+7
Jun 09 '17 at 18:53 on
source share

Creating a new workspace can also solve this problem.

+6
Jul 20 '13 at 6:54
source share

open the web.xml file. (if you don’t know where it is, then just go to Google). it is something like this:

 <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" id="WebApp_ID" version="3.1"> . . . . </web-app> 

just below the line <?xml version="1.0" encoding="UTF-8"?> , add the <element> and close it at the very bottom with the </element> . Done.

+6
Mar 29 '17 at 14:28
source share

I had the same problem on my tomcat server, but when I checked, I found that I was adding a new tag to my web.xml file and the server wasn’t accepting it, so check the file if there was any update and then restart your cat will be fine.

+5
Apr 25 '14 at
source share

Everything worked fine for one second, and then my server started giving me this error. I reviewed all the answers mentioned here and for me this was a simple solution:

Removing the server and then setting up a new one

If you are sure that you haven’t changed anything and just got an error, DO NOT start deleting .snap files or other temporary files. This will cause more problems. And if the error occurred due to some changes you made, this error will definitely be due to some errors in the web.xml file.

PS Changing the workspace will not do you absolutely good, because if the problem is in your project, it will happen in the new workspace anyway when you import the project!

+3
Aug 08 '16 at 10:23
source share

Try to remove the existing tomcat server in the server console, if you do not have a console, you can go to "View View → Server" and then delete the server by right-clicking on it. Add a new server, this will help you.

+2
Mar 11 '14 at 6:58
source share

I had the same problem, and not the answers here helped my case. So after several hours of searching, I found a solution for me, and I hope this helps someone else.

This solution is for those who get the server "Tomcat v7.0 Server on the local host." after setting up the tomcat server in eclipse and trying to run a project on it.

After setting up the tomcat server in eclipse, you need to copy the "WEB-INF" directory from your tomcat. C: \ ...% TOMCAT_HOME% \ webapps \ ROOT and you will find them "WEB-INF", just copy and paste it into your WebContent folder in the eclipse project (overwrite the web.xml file).

Hope this helps.

+2
Sep 29 '14 at 19:17
source share

in my case, the error was that he could not find servlet-api.jar. I do not know why suddenly he began to give an error for this. Because before he worked without any problems. After providing servlet-api.jar in the build path option, the server successfully started.

+2
Jan 21 '15 at 10:24
source share

In my case, I laid out my tomcat folder (the one with all the files in it) in a different place.

Then, when I started eclipse and tried to start my project using jsp and servlets, I got the same error.

I tried all the answers here, but didn’t change anything. The solution for me was to put all the Tomcat JAR files into the project library as follows:

  • Go to Eclipse
  • Right-click on the project you are working on> Build Path> Configure Build Path ...> Libraries> Add External JARs
  • select all JAR files from Tomcat / bin and Tomcat / lib
  • Click "Ok"

You should now find them in the Libraries folder of your project, and then it should work.

+1
Apr 03 '14 at 11:20
source share

In the eclipse workspace, this was allowed by following these steps. Window → Settings → Network Connections → Change “Active Provider” to “Direct”, instead of “Native”. You can try.

+1
Jul 03 '14 at 12:01
source share

This weekend I ran into a similar problem. I tried all of the above tricks, but none of them worked with me. (Work at Eclipse LUNA)

Then I analyzed that before creating a specific servlet, I successfully launched Apache Tomcat v7.0. What was the "RefreshServlet" as shown below:

RefreshServlet.java

So practicing servlets understand the function of AutoRefresh. When I remove this servlet from my application, it works fine, but when I try to add and run this servlet, it gives the same error "Apache Tomcat v7.0 failed to start"

I don't know why, but just removing this servlet is great for running the rest of my application.

So, the suggestion from my bottom line will be that if some other trick doesn't work, try deleting any last servlet or any class you just created before getting this error, and this might work for you too for the rest of the application.

Any further explanation would be appreciated. Thanks

+1
Aug 23 '15 at 6:00
source share

Check your web descriptor (web.xml) or on your servlets (where you are commenting, check something like "@WebServlet" ("/ servlet_name") "for any duplicates. If they are deleted,

+1
Aug 05 '16 at 8:53 on
source share

You can right-click on apache-tomcat, select properties, click Restore to Default.

0
Nov 05 '13 at 22:07
source share

In my case, the problem was caused by a syntax error in the passed arguments. I had a space between the key and the value when using '-D'

i.e.

 -DMyArg= MyValue 

instead

 -DMyArg=MyValue 
0
Feb 11 '14 at
source share

double-click the Apache server in the eclipse server tab. now change the tomacat admin port to 8010, the http port will change to 8082 and the Ajp port will change to 8011.

0
May 18 '14 at 18:58
source share

If the whole given answer does not work for you, just change the current workspace.

file-> switch workspace

This will solve your problem.

0
May 31 '15 at 15:49
source share

In my case, the problem was related to another instance of Tomcat. I stopped it from the services and the problem was resolved.

0
Jul 25 '16 at 5:46
source share

After performing all the above steps, the problem has not been resolved.

Finally, he allowed the following steps.

1- Check the .log file inside the workspace directory. Java version issue

"Caused by: java.io.IOException: cannot start program" C: \ jdk1.7.0_45 \ bin \ java ": error CreateProcess = 193,% 1 is not a valid Win32 application in java.lang.ProcessBuilder.start (Unknown source) in java.lang.Runtime.exec (Unknown source) in java.lang.Runtime.exec (Unknown source) on org.eclipse.debug.core.DebugPlugin.exec (DebugPlugin.java:869) ... 80 more

Called: java.io.IOException: Error CreateProcess = 193,% 1 is not a valid Win32 application in java.lang.ProcessImpl.create (native method) in java.lang.ProcessImpl. (Unknown source) in java.lang.ProcessImpl.start (Unknown source) "

I installed the correct OS compatible JDK and the problem was resolved. PS: I explicitly set the JDK path through eclipse (Window-> preference-> installed JRE), but after setting the correct JDK path, it works fine for me.

0
Oct 21 '16 at 11:02
source share

The first check in your Web.xml is that there are several <display of servlets> tags with different names. If so, delete the unnecessary and run .. This should work fine

OR

To fix this problem, you need to delete the .snap file located in the directory.

Open your Eclipse workspace, which you Using Path → workspace.metadata.plugins \ org.eclipse.core.resources \ snapfile

Delete the snap file.

After deleting this file, Uninstall Tomcat Server Then, also remove the server runtime selected as Apache tomcat. Then add the server again and select "Project" → "Properties" → "Project Boundaries" → "Right" you will find the tabs "Details" and "Tabs". Click Runtimes and check the Apache checkbox that already exists (if not, add it)

Change the port numbers and run it.

0
Apr 14 '17 at 12:54 on
source share

try removing all project dependencies from the local maven repository (.m2).

Path: C: \ Users \ username \ .m2 \ repository

close eclipse and open it again, it will automatically download all the dependencies.

0
Aug 27 '17 at 15:00
source share

I solved my problem by simply closing all other projects in eclipse.

0
Nov 07 '17 at 16:26
source share



All Articles