title: Tomcat error: The markup in the document following the root element must be well-formed
body: <p>Im stuck by getting this error?! I have a simple XML file and a simple java file.</p>
  
  <p>my xml:</p>
  
  <pre><code>&lt;web-app xmlns="http://java.sun.com/xml/ns/javaee"&gt;
  &lt;servlet&gt;
      &lt;servlet-name&gt;hello&lt;/servlet-name&gt;
      &lt;servlet-class&gt;test.HelloServlet&lt;/servlet-class&gt;
  &lt;/servlet&gt;
  &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;hello&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/hello/&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  &lt;/web-app&gt;
  </code></pre>
  
  <p>and my java is:</p>
  
  <pre><code>package test;
  import java.io.*;
  import javax.servlet.http.*;
  import javax.servlet.*;
  
  public class HelloServlet extends HttpServlet {
  
  public void doGet (HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
  PrintWriter out = res.getWriter();
  out.println("Hello, world!");
  out.close();
  }
  }
  </code></pre>
  
  <p>My xml is placed inside the WEB-INF.
  When I do localhost:8080 I get the tomcat page.</p>
  
  <p>Can someone help me?</p>
  
  <pre><code>Jan 24, 2013 3:48:58 PM org.apache.catalina.startup.ContextConfig parseWebXml
  SEVERE: Parse error in application web.xml file at jndi:/localhost/opdracht-les1/WEB-INF/web.xml
  org.xml.sax.SAXParseException; systemId: jndi:/localhost/opdracht-les1/WEB-INF/web.xml; lineNumber: 5; columnNumber: 2; The markup in the document following the root element must be well-formed.
      at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
      at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(Unknown Source)
      at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
      at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
      at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(Unknown Source)
      at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$TrailingMiscDriver.next(Unknown Source)
      at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
      at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
      at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
      at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
      at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
      at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
      at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
      at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1537)
      at org.apache.catalina.startup.ContextConfig.parseWebXml(ContextConfig.java:1878)
      at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1259)
      at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:878)
      at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:369)
      at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
      at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
      at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5173)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
      at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
      at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
      at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
      at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:977)
      at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1655)
      at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
      at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
      at java.util.concurrent.FutureTask.run(Unknown Source)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      at java.lang.Thread.run(Unknown Source)
  
  Jan 24, 2013 3:48:58 PM org.apache.catalina.startup.ContextConfig parseWebXml
  SEVERE: Occurred at line 5 column 2
  Jan 24, 2013 3:48:58 PM org.apache.catalina.startup.ContextConfig configureStart
  SEVERE: Marking this application unavailable due to previous error(s)
  Jan 24, 2013 3:48:58 PM org.apache.catalina.core.StandardContext startInternal
  SEVERE: Error getConfigured
  Jan 24, 2013 3:48:58 PM org.apache.catalina.core.StandardContext startInternal
  SEVERE: Context [/opdracht-les1] startup failed due to previous errors
  Jan 24, 2013 3:53:09 PM org.apache.catalina.startup.HostConfig deleteRedeployResources
  INFO: Undeploying context [/opdracht-les1]
  Jan 24, 2013 3:53:29 PM org.apache.catalina.startup.HostConfig deployWAR
  INFO: Deploying web application archive E:\Program Files\Apache Software Foundation\Tomcat 7.0\webapps\opdracht-les1.war
  </code></pre>