1

I am using tomcat 6.0 with Eclipse Indigo for Spring 3.0 and mybatis 3.0 application and I use Java 7. My problem is that tomcat is not starting and I am getting dialog with below message:

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

I have tried with increasing timeout to 2 minutes but still I am getting same message. In console where tomcat startup messages are printed below line is printed as last line:

INFO: Loading XML bean definitions from ServletContext resource
[/WEB-INF/rest-servlet.xml]

It was working fine earlier. But today I am starting to get timeout messages when running tomcat.

What could the be problem?

Universal Electricity
  • 769
  • 1
  • 12
  • 26
anujprashar
  • 6,092
  • 6
  • 44
  • 79
  • You're getting exactly the same message after changing the timeout to 2 mins? Where did you edit the timeout? – Jan Jul 24 '15 at 07:12
  • Well, you should go in the tomcat folder, open conf directory, open server.xml and you will find there something like – We are Borg Jul 24 '15 at 07:24
  • @anujprashar were you able to resolve ? – Vedant Kekan Jul 24 '15 at 08:19
  • @WeareBorg, I tried changing timeout according to your message but it did not work. – anujprashar Jul 24 '15 at 08:38
  • You must restart the server, I did the same thing on my machine. Also, edit the connection timeout for other connectors, especially 8443. And set value to 200000. Or better yet, paste your server.xml in your main post. – We are Borg Jul 24 '15 at 08:42

2 Answers2

1

Solution 1:

Change Timeout Time:

  • open your servers view
  • doubleclick on the server
  • check Timeouts (add a big number for Start) say 20000

Solution 2:

Sometimes it is just a library or a source folder which is out-of-synch. Please be sure that you clean your working directories, clean your projects and republish them.

Solution 3:

Completely remove server and its reconfiguration and add it again to Eclipse Check steps here

Solution 4:

Go to Windows option -> select preference.

Than Select General -> Network Connection.

Than select the Active Provider as Manual.

Then restart the tomcat and run.

Solution 5:

Configure the java compiler and WTP tomcat runtime s' to same JVM version

Both versions must be same, if you use a lower version of JVM to run a class file that is compiled using an higher version of Java Compiler it might give error.

  • The version of the Java Compiler is configured in the Project Properties ->Java Build Path-->Libraries Tab---> Select "JRE System Library" -->Edit
  • Tomcat: Servers View --> double click your tomcat server --> Runtime Environment

Please remove all breakpoints, Hope any one of the solution works

Note: This way we can analyse server problem in eclipse: Apache Tomcat 6.0 Server Unable to Start

Vedant Kekan
  • 7,962
  • 4
  • 55
  • 62
-1

I am able to solve this. After cleaning project tomcat started but problem again occurred on next launch. In console I found below errors-

WARNING: Ignored XML validation warning org.xml.sax.SAXParseException; lineNumber: 15; columnNumber: 31; schema_reference.4: Failed to read schema document 'http://www.springframework.org/schema/context/spring-context-4.0.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not . at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source) at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.warning(Unknown Source) Jul 24, 2015 2:31:11 PM org.springframework.web.servlet.FrameworkServlet initServletBean SEVERE: Context initialization failed org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 15 in XML document from ServletContext resource [/WEB-INF/rest-servlet.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 15; columnNumber: 31; cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'context:annotation-config'.

Caused by: org.xml.sax.SAXParseException; lineNumber: 15; columnNumber: 31; cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'context:annotation-config'.

Jul 24, 2015 2:31:11 PM org.apache.catalina.core.ApplicationContext log SEVERE: StandardWrapper.Throwable org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 15 in XML document from ServletContext resource [/WEB-INF/rest-servlet.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 15; columnNumber: 31; cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'context:annotation-config'.

Caused by: org.xml.sax.SAXParseException; lineNumber: 15; columnNumber: 31; cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'context:annotation-config'.

So I checked my servlet.xml file in WEB-INF folder and I found that xsi:schemaLocation declarations is using 4.0 version but in my lib folder I have 3.0.5 version jars of spring. So I changed to 3.0 in servlet.xml and problem is fixed. So if anyone facing timeout problem in tomcat and server while starting is stuck at this line in console-

INFO: Loading XML bean definitions from ServletContext resource
[/WEB-INF/rest-servlet.xml]

then please check version of spring jars and version in servlet.xml file.

I am wondering how it was able to run previously, may be it was loading definations from web.

anujprashar
  • 6,092
  • 6
  • 44
  • 79