title: Using embedded Jetty using JSP gives error "web-jsptaglibrary_1_2.dtd not found"
body: <p>I am using embedded Jetty to launch a webapp and I use JSP pages as views.</p>
  
  <p>Using the maven-jetty-plugin works fine for testing, which makes me think I am missing some dependencies when bootstrapping the server (and which is the root cause of the problem).</p>
  
  <p>I bootstrap Jetty with command:</p>
  
  <pre><code>java $JAVA_OPTS -cp target/classes:target/dependency/* xxx.Main
  </code></pre>
  
  <p>I have used the dependency plugin in Maven to be sure to get all deps on the classpath (outside the packaged war-file):</p>
  
  <pre><code>&lt;execution&gt;
  &lt;id&gt;copy-dep&lt;/id&gt;
  &lt;goals&gt;
  &lt;goal&gt;copy-dependencies&lt;/goal&gt;
  &lt;/goals&gt;
  &lt;/execution&gt;
  </code></pre>
  
  <p>The Main class looks like this:</p>
  
  <pre><code>      Server server = new Server(8080);
      WebAppContext root = new WebAppContext();
      root.setContextPath("/");
      root.setWar("target/app.war");
      server.setHandler(root);
      server.start();
      server.join();
  </code></pre>
  
  <p>The embedded Jetty server starts without errors, but when navigating to the URL that returns the JSP page I always get this error.</p>
  
  <p>The stacktrace:</p>
  
  <pre><code>PWC6181: File /javax/servlet/jsp/resources/web-jsptaglibrary_1_2.dtd not found
  
  Caused by:
  
  org.xml.sax.SAXException: PWC6181: File /javax/servlet/jsp/resources/web-jsptaglibrary_1_2.dtd not found
  at org.apache.jasper.xmlparser.MyEntityResolver.resolveEntity(ParserUtils.java:566)
  at com.sun.org.apache.xerces.internal.util.EntityResolverWrapper.resolveEntity(EntityResolverWrapper.java:107)
  at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.resolveEntityAsPerStax(XMLEntityManager.java:1018)
  at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDriver.dispatch(XMLDocumentScannerImpl.java:1192)
  at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDriver.next(XMLDocumentScannerImpl.java:1090)
  at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:1003)
  at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
  at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
  at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511)
  at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)
  at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
  at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
  at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:235)
  at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:284)
  at org.apache.jasper.xmlparser.ParserUtils.parseXMLDocument(ParserUtils.java:296)
  at org.apache.jasper.xmlparser.ParserUtils.parseXMLDocument(ParserUtils.java:366)
  at org.apache.jasper.runtime.TldScanner.scanTld(TldScanner.java:526)
  at org.apache.jasper.runtime.TldScanner.scanJar(TldScanner.java:379)
  at org.apache.jasper.runtime.TldScanner.scanJars(TldScanner.java:607)
  at org.apache.jasper.runtime.TldScanner.scanTlds(TldScanner.java:282)
  at org.apache.jasper.runtime.TldScanner.getLocation(TldScanner.java:255)
  </code></pre>
  
  <p>I use Jetty 8 and my web.xml is configured for Servlet 3.0.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"&gt;
  </code></pre>