title: Jetty 9 in an OSGI environment with JSP support does not start
body: <p>I am trying to run Jetty 9.0.3 in an OSGI environment and deploy a WAR with a special manifest parameters (in fact it is a jar, JettyTest-0.0.0.jar below). I am following the instructions on
  <a href="http://www.eclipse.org/jetty/documentation/current/framework-jetty-osgi.html" rel="nofollow">http://www.eclipse.org/jetty/documentation/current/framework-jetty-osgi.html</a></p>
  
  <p>It works fine if I do not include JSP support, i.e., if I remove the following lines from the run configuration</p>
  
  <pre><code>osgi.identity;filter:='(osgi.identity=org.eclipse.jetty.osgi.boot.jsp)'
  org.eclipse.jetty.osgi.boot.jsp;version='[9.0.3,9.0.4)',\
  </code></pre>
  
  <p>but if I include them and thus include the org.eclipse.jetty.osgi.boot.jsp bundle I get the following error message</p>
  
  <pre><code>! Failed to start bundle org.eclipse.jetty.osgi.boot-9.0.3.v20130506, exception activator error org/xml/sax/ErrorHandler from: org.eclipse.jetty.osgi.boot.jasper.JSTLBundleDiscoverer:fixupDtdResolution#216
  </code></pre>
  
  <p>I have searched for over a week now for this error I have looked at the source org.eclipse.jetty.osgi.boot.jasper.JSTLBundleDiscoverer on line 216 I cannot see any obvious mistake.</p>
  
  <p>The error is the same if even if I don't include the JettyTest-0.0.0.jar in the run configuration. </p>
  
  <p>Reading the documentation of Jetty it seems that I should be able to do what I want. I want to know the reason for this error and fix it, I do not want to include pax-web or any other major change in my setup.</p>
  
  <p>Have anyone had a similar problem? or have you done this without problems? Please help me find the root cause of the error.</p>
  
  <p>Here are the files I use:</p>
  
  <h2>JettyTest-0.0.0.jar</h2>
  
  <pre><code>META-INF
      MANIFEST.MF
  WEB-INF
      classes
      lib
      web.xml
  index.html
  test.jsp
  </code></pre>
  
  <h2>MANIFEST.MF</h2>
  
  <pre><code>Manifest-Version: 1.0
  Class-Path: 
  Bundle-ManifestVersion: 2
  Bundle-SymbolicName: JettyTest
  Import-Package: javax.servlet,javax.servlet.http
  </code></pre>
  
  <h2>web.xml</h2>
  
  <pre><code>&lt;?xml version="1.0" encoding="ISO-8859-1"?&gt;
  &lt;web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
  xmlns="http://java.sun.com/xml/ns/javaee" 
  xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" 
  xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" 
  version="3.0"&gt;
    &lt;display-name&gt;Example&lt;/display-name&gt;
    &lt;welcome-file-list&gt;
      &lt;welcome-file&gt;index.html&lt;/welcome-file&gt;
    &lt;/welcome-file-list&gt;
  &lt;/web-app&gt;
  </code></pre>
  
  <h2>index.html</h2>
  
  <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"&gt;
  &lt;title&gt;Insert title here&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  Hello World?
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <h2>test.jsp</h2>
  
  <pre><code>&lt;%@ page language="java" contentType="text/html; charset=ISO-8859-1"
  pageEncoding="ISO-8859-1"%&gt;
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"&gt;
  &lt;title&gt;Insert title here&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;%= "Hello World!" %&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <h2>run.bndrun</h2>
  
  <pre><code>-runfw: org.apache.felix.framework;version='[4.2.1,4.2.1]'
  -runee: JavaSE-1.7
  -resolve.effective: active
  -runrequires: osgi.identity;filter:='(osgi.identity=org.eclipse.jetty.deploy)',\
      osgi.identity;filter:='(osgi.identity=org.eclipse.jetty.http)',\
      osgi.identity;filter:='(osgi.identity=org.eclipse.jetty.security)',\
      osgi.identity;filter:='(osgi.identity=org.eclipse.jetty.server)',\
      osgi.identity;filter:='(osgi.identity=org.eclipse.jetty.servlet)',\
      osgi.identity;filter:='(osgi.identity=org.eclipse.jetty.util)',\
      osgi.identity;filter:='(osgi.identity=org.eclipse.jetty.webapp)',\
      osgi.identity;filter:='(osgi.identity=org.eclipse.jetty.osgi.boot)',\
      osgi.identity;filter:='(osgi.identity=org.eclipse.jetty.io)',\
      osgi.identity;filter:='(osgi.identity=org.eclipse.jetty.xml)',\
      osgi.identity;filter:='(osgi.identity=com.sun.el)',\
      osgi.identity;filter:='(osgi.identity=javax.el)',\
      osgi.identity;filter:='(osgi.identity=javax.servlet.jsp)',\
      osgi.identity;filter:='(osgi.identity=javax.servlet.jsp.jstl)',\
      osgi.identity;filter:='(osgi.identity=org.apache.taglibs.standard.glassfish)',\
      osgi.identity;filter:='(osgi.identity=org.apache.jasper.glassfish)',\
      osgi.identity;filter:='(osgi.identity=org.eclipse.jdt.core.compiler.batch)',\
      osgi.identity;filter:='(osgi.identity=JettyTest)',\
      osgi.identity;filter:='(osgi.identity=org.eclipse.jetty.osgi.boot.jsp)'
  -runrepos: Releases,\
      Local,\
      Bndtools Hub
  -resolve: auto
  -runbundles: JettyTest;version='[0.0.0,0.0.1)',\
      com.sun.el;version='[2.2.0,2.2.1)',\
      javax.el;version='[2.2.0,2.2.1)',\
      javax.servlet;version='[3.0.0,3.0.1)',\
      javax.servlet.jsp;version='[2.2.0,2.2.1)',\
      javax.servlet.jsp.jstl;version='[1.2.0,1.2.1)',\
      org.apache.felix.configadmin;version='[1.4.0,1.4.1)',\
      org.apache.felix.log;version='[1.0.1,1.0.2)',\
      org.apache.jasper.glassfish;version='[2.2.2,2.2.3)',\
      org.apache.taglibs.standard.glassfish;version='[1.2.0,1.2.1)',\
      org.eclipse.jdt.core.compiler.batch;version='[3.8.2,3.8.3)',\
      org.eclipse.jetty.deploy;version='[9.0.3,9.0.4)',\
      org.eclipse.jetty.http;version='[9.0.3,9.0.4)',\
      org.eclipse.jetty.io;version='[9.0.3,9.0.4)',\
      org.eclipse.jetty.osgi.boot;version='[9.0.3,9.0.4)',\
      org.eclipse.jetty.osgi.boot.jsp;version='[9.0.3,9.0.4)',\
      org.eclipse.jetty.security;version='[9.0.3,9.0.4)',\
      org.eclipse.jetty.server;version='[9.0.3,9.0.4)',\
      org.eclipse.jetty.servlet;version='[9.0.3,9.0.4)',\
      org.eclipse.jetty.util;version='[9.0.3,9.0.4)',\
      org.eclipse.jetty.webapp;version='[9.0.3,9.0.4)',\
      org.eclipse.jetty.xml;version='[9.0.3,9.0.4)',\
      osgi.cmpn;version='[4.2.0,4.2.1)'
  -runvm: -Djetty.home.bundle=org.eclipse.jetty.osgi.boot
  </code></pre>
  
  <h2>UPDATE</h2>
  
  <p>After some improved logging I found the full error message. I seem to miss a JAR with org.xml.sax.ErrorHandler, anyone knows a Apache Felix jar that I can use, or any other library that contains this class?</p>
  
  <pre><code>ERROR: Bundle org.eclipse.jetty.osgi.boot [20] Error starting osgi-dp:org.eclipse.jetty.osgi.boot (org.osgi.framework.BundleException: Activator start error in
  bundle org.eclipse.jetty.osgi.boot [20].)
  java.lang.NoClassDefFoundError: org/xml/sax/ErrorHandler
          at org.eclipse.jetty.osgi.boot.jasper.JSTLBundleDiscoverer.fixupDtdResolution(JSTLBundleDiscoverer.java:216)
          at org.eclipse.jetty.osgi.boot.jasper.JSTLBundleDiscoverer.&lt;init&gt;(JSTLBundleDiscoverer.java:91)
          at org.eclipse.jetty.osgi.boot.jsp.FragmentActivator.start(FragmentActivator.java:57)
          at org.eclipse.jetty.osgi.boot.utils.internal.PackageAdminServiceTracker.invokeFragmentActivators(PackageAdminServiceTracker.java:280)
          at org.eclipse.jetty.osgi.boot.utils.internal.PackageAdminServiceTracker.setup(PackageAdminServiceTracker.java:87)
          at org.eclipse.jetty.osgi.boot.utils.internal.PackageAdminServiceTracker.&lt;init&gt;(PackageAdminServiceTracker.java:67)
          at org.eclipse.jetty.osgi.boot.JettyBootstrapActivator.start(JettyBootstrapActivator.java:87)
          at org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:645)
          at org.apache.felix.framework.Felix.activateBundle(Felix.java:1977)
          at org.apache.felix.framework.Felix.startBundle(Felix.java:1895)
          at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1191)
          at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:295)
          at java.lang.Thread.run(Unknown Source)
  Caused by: java.lang.ClassNotFoundException: org.xml.sax.ErrorHandler not found
  by org.apache.jasper.glassfish [32]
          at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1460)
          at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:72)
          at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1843)
          at java.lang.ClassLoader.loadClass(Unknown Source)
          ... 13 more
  </code></pre>