-2

When I start Tomcat v7.0 Server from Servers tab in Eclipse, a problem occurred message box appears saying:

Starting Tomcat v7.0 Server at localhost has encountered a problem.

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

I am a beginner in this area and searched for every similar question on stackoverflow, tried the solutions given by others, but none worked. What can I do to solve the issue?

web.xml is

<?xml version="1.0" encoding="UTF-8"?> 

<web-app xmlns:xsi="w3.org/2001/XMLSchema-instance" ; xmlns="java.sun.com/xml/ns/javaee" ; xsi:schemaLocation="java.sun.com/xml/ns/javaee  java.sun.com/xml/ns/javaee/web-app_3_0.xsd" ; id="WebApp_ID" version="3.0"> 

<display-name>SimpleServletProject</display-name> 

<servlet> <servlet-name>xmlServlet</servlet-name> 

          <servlet-class>org.swechchha.XmlServlet</servlet-class>

 </servlet> 

<servlet-mapping>

     <servlet-name>xmlServlet</servlet-name>

     <url-pattern>xmlServletPath</url-pattern> </servlet-mapping>   

 </web-app> –

Logs are here:

SEVERE: A child container failed during start

Caused by: java.lang.IllegalArgumentException: Invalid <url-pattern> xmlServletPath in servlet mapping
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
Swechchha
  • 38
  • 7
  • If there is any logs written in console please attach them – Aviad Jun 25 '14 at 08:23
  • There should be a details button below the message showing you some more information. Please post that here – Stefan Jun 25 '14 at 10:04
  • I have edited my question and included logs. Please have a look. And details button showed following text: Server Tomcat v7.0 Server at localhost (2) failed to start. – Swechchha Jun 25 '14 at 12:52
  • "java.lang.IllegalArgumentException: Invalid xmlServletPath in servlet mapping ", that reads to me like there is a mistake in the web.xml. – Gimby Jun 25 '14 at 12:53
  • web.xml is SimpleServletProject xmlServlet org.swechchha.XmlServlet xmlServlet xmlServletPath – Swechchha Jun 25 '14 at 12:56
  • Any reason why upon seeing that posting XML as a comment is not a good idea you are not fixing your mistake and adding it to your question instead? – Gimby Jun 25 '14 at 13:05

2 Answers2

0

This solution doesn't work for you?

To resolve this issue, you have to delete the .snap file located in the directory :

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

After deleting this file, you could start Eclipse with no problem.

Aviad
  • 1,539
  • 1
  • 9
  • 24
0

got the solution. did a silly mistake in web.xml file. missed a '/' .It must be

    <url-patterns>/xmlServletPath</url-patterns>

If still the server doesn't start, it may be it needs more time, increase the timeout entry from default '45' by double clicking your server in 'Servers' tab.

Swechchha
  • 38
  • 7