[eclipse] Tomcat Server not starting with in 45 seconds

Server Tomcat v7.0 Server at localhost was unable to start within 101 seconds. If the server requires more time, try increasing the timeout in the server editor.

This is my error. I searched a lot but I can't able to find a solution for this please help me someone I changed time from 45 secs to 101 secs still not solved, I removed eclipse and tomcat and I re-installed again but same problem occurs, plz give some solution.

This question is related to eclipse tomcat7

The answer is


Just for knowledge.. Also had the same issue and solved it stopping and starting again the mysql service... I think that was some conflict between mysql-service and tomcat.

Good Luck


Turns out that MySQL wasn't running in my case. I've started MySQL service, and it worked.


I stoped the tomcat on the computer and started the service (tomcat) using the eclipse IDE.


Open servers view, open Timeouts and set up Start

add start


Below worked for me.

Removed all Breakpoints. Then did a clean on server as below.

Right click on server-->Click clean.


Tomcat Server not starting with in 45 seconds

right click on the configured server go to properties->select monitoring -> Add ->HTTP protocol 8080

after run server it will deploy.


You need to check if your spring context have this statement

<property name="MaxTotal" value="30"></property>

If your project has more than 7 DAOs won't work, because it won't create 8 connections.

my project:

<bean id="mysqlDataSource" class="org.apache.commons.dbcp2.BasicDataSource">
    <property name="driverClassName" value="com.mysql.jdbc.Driver"></property>
    <property name="url" value="jdbc:mysql://localhost/(name of your schema)"></property>
    <property name="username" value="root"></property>
    <property name="password" value="root"></property>
    <property name="MaxTotal" value="(numbers of DAO)"></property>
</bean>

In my case tomcat was configured to start not on localhost(guess it came from servers.xml connector entry) so Eclipse fails to find it running after start. Changed Host name on Servers tab to my 192.168.xxx.yyy ip.

Had the same error message, though tomcat did start sucessfully, but then Eclipse shuts it down.


try clean Tomcat working directory,it works for me


None of the above worked for me but this - 1. Remove any project if configured already while installing Tomcat. 2. Right click on configured server -> clean and -> Clean tomcat working directory

Did couple of times and the issue resolved. Thanks.


I got the solution for your requirement.

I'm also getting the same error in my eclipse Luna.

Go to Windows option -> select preference.

Than Select General -> Network Connection.

Than select the Active Provider as Manual.

Then restart the tomcat and run. It will work.

Hope it will help you.


Just remove or delete the server from eclipse and reconfigure it or add it again to Eclipse.


Is your browser making calls to the server while it is starting? if yes, you probably should close it e.g. if your browser is currently set to http://localhost, close it before attempting to start the server.


Disabling my antivirus does the trick for me ...


Try remove all breakpoints.Also you can increase start up time.

Open the Servers view -> double click tomcat -> drop down the Timeouts section

enter image description here


Open the Servers view -> double click tomcat -> drop down the Timeouts section you can increase the startup time for each particular server. like 45 to 450


Nothing of the above helped me but setting:

-Djava.net.preferIPv4Stack=true

as VM Argument in the VM Arguments tab of the Tomcat Server Debug Configuration Settings solved the problem. (Tomcat 8, Windows 10, Eclipse Mars)


I know it's a bit late, but I've tried everything above and nothing worked. The real problem was that I'm using hibernate, so it was trying to connect to mysql but was not able, thats why it showed time out.

Just to let u guys know, I'm using RDS(Amazon), so just to make a test I changed to my local mysql and it worked perfectly.

Hope that this answer helps somebody.

Thanks.


I had tried increasing the Server Start up time for tomcat server, removed server and created new server, removed server and changed run-time environment configurations. Those thing didn't work for me. At last, i found deployment descriptor(url pattern of servlet-mapping) is the one that making the trouble.


It's JVM space capacity (heap and Permanent area) issue in my case, it works after add Argument Config for Tomcat Server (Run Configuration, Arguments).

-Xms512m -Xmx1536m -XX:MaxPermSize=512m -Djava.util.Arrays.useLegacyMergeSort=true

Timeouts:

  • Start: 200
  • Stop: 45

..and then Window → Preferences → General → Network Connection.

Set "Active Provider" = Manual (to mark all the checkboxes).


Just go with below points. Open Eclipse Windows -> show View -> server -> double click tomcat/press Fn + F3 -> Timeouts -> increase start time Save setting and Restart eclipse also delete .metadata folder from work space if you don't need Check Now... All The Best


Well, I tried all the solutions:

  • increasing timeout seconds;
  • deleting the server instance in Eclipse along with the Run Config.

None of them worked.

And:

  • there was no breakpoint in my code;
  • I don't use any antivirus.

I realized that some people - who had the same problem - were using Eclipse Helios (so was I).

I switched to Eclipse Kepler and it worked perfectly.

Maybe it can be a solution. I wanted to use Helios, but Kepler is okay.


I also had the issue of the Eclipse Tomcat Server timing out and tried every suggestion including:

  • increasing timeout seconds
  • deleting various .metadata files in workspace directory
  • deleting the server instance in Eclipse along with the Run Config

Nothing worked until I read a comment on a related issue and realized that I had added a breakpoint in an interceptor class after a big code change and had forgotten to toggle it off. I removed it and all other breakpoints and Tomcat started right up as it usually did.


URL pattern of <servlet-mapping>:

Check project explorer → Deployment descriptor → Servlet Mapping → check that all mapping present in controller package. ref. image as below:

shop project ref

if there is any mapping not available, Then remove that <servlet> and <servlet-mapping> tag in web.xml.


If you are running into this on Mac and you installed Tomcat using brew, one good way to get round that is to install Tomcat using a zip file instead.

Go here, download a zip file, unzip it, and in Eclipse, create a new server and specify "Tomcat installation directory" as the unzipped file.


If some one had the same issue like me about the timeout of the server where you can found it. This response can help you.

Click on window > Show View > Server. When you are on the server, you will see the server that you have configured before. After that, right click on your server configuration, go to Properties > General and click on Switch Location. After you clicking on "Switch Location", the server configuration will be appear on the Package Explorer of eclipse. Then Double click on the server file in the package explorer you will see where the timeout located.

Thank you.


If you are trying to debug the application on server, just check out the breakpoints. You might had include the whole class as breakpoint. So remove that breakpoint.

This thing worked in my case when i was trying to debug.


If you are using any Databases such as Oracle/Mysql then first check this databases services are start


Folks, I had this same problem and tried raising the timeout, deleting the server and creating again and did not work. I was running Eclipse Kepler in Linux. The solution proposed by @Phoenix is what worked for me:

Window -> Preferences -> General -> Network Connections

Set Active Providers in manual and then configure or not the proxy. I had this option in "Native".

Then I realized I had the variable http_proxy set. It was set in the ~/.bashrc file. This environment variable is the culprit of many problems.

Once I set http_proxy to empty

export http_proxy=

to check it:

echo $http_proxy

I was able to leave option "Active Provider" in "Native" and solve the timeout problem. This is useful because Eclipse adopts the native configuration, in case you change it often.

In my case, where I had configured http_proxy in ~./bashrc, I had to close Eclipse and even log out and log in again.


I had the same problem I deleted the server from the server tab, and also the server folder under your eclipse workspace, restarted eclipse, set up a new server, and it appears to be running OK now.


In my case I was using spring+hibernate and forgot to run my MYSQL server due to which hibernate was not getting loaded and thus was throwing error


I was too facing similar issue and here I found another solution for it.

I have just started Eclipse Luna and not developed/deployed any project yet. I tried adding Tomcat v7.0 Server and got same error.

In order to resolve the issue I went to Server Perspective (it's actually server tab next to the console tab located below Project code). Double click on Server which is added to Eclipse. It will open up Overview page. Look for Server Location and select Use workspace metadata(does not modify Tomcat location). Now restart the Server and error will go away.

Server > (double click) Tomcat v7.0 Server at localhost > (Overview page) Server Location > Select -- Use workspace metadata(does not modify Tomcat location).


Examples related to eclipse

How do I get the command-line for an Eclipse run configuration? My eclipse won't open, i download the bundle pack it keeps saying error log strange error in my Animation Drawable How to uninstall Eclipse? How to resolve Unable to load authentication plugin 'caching_sha2_password' issue Class has been compiled by a more recent version of the Java Environment Eclipse No tests found using JUnit 5 caused by NoClassDefFoundError for LauncherFactory How to downgrade Java from 9 to 8 on a MACOS. Eclipse is not running with Java 9 "The POM for ... is missing, no dependency information available" even though it exists in Maven Repository The origin server did not find a current representation for the target resource or is not willing to disclose that one exists. on deploying to tomcat

Examples related to tomcat7

Could not load the Tomcat server configuration INFO: No Spring WebApplicationInitializer types detected on classpath Name [jdbc/mydb] is not bound in this Context I cannot access tomcat admin console? Tomcat 7.0.43 "INFO: Error parsing HTTP request header" jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class Tomcat Server not starting with in 45 seconds HTTP Status 500 - Servlet.init() for servlet Dispatcher threw exception How to fix JSP compiler warning: one JAR was scanned for TLDs yet contained no TLDs? java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver