title: Embedded Tomcat 8 Fails to to start
body: <p>I have a jar that deploys and runs in a standalone tomcat 8.0.28 server with Java 8.0.66</p>
  
  <p>I wish to run it from an embedded Tomcat to run integration tests.
  The war deploys but fails to start, I ran out of ideas, I am getting the following error:</p>
  
  <pre><code>Dec 07, 2015 6:11:46 PM org.apache.coyote.AbstractProtocol init
  INFO: Initializing ProtocolHandler ["http-nio-9191"]
  Dec 07, 2015 6:11:46 PM org.apache.tomcat.util.net.NioSelectorPool 
  getSharedSelector
  INFO: Using a shared selector for servlet write/read
  Dec 07, 2015 6:11:46 PM org.apache.catalina.core.StandardService 
  startInternal
  INFO: Starting service Tomcat
  Dec 07, 2015 6:11:46 PM org.apache.catalina.core.StandardEngine startInternal
  INFO: Starting Servlet Engine: Apache Tomcat/8.0.28
  Dec 07, 2015 5:43:47 PM org.apache.catalina.startup.ContextConfig 
  getDefaultWebXmlFragment
  INFO: No global web.xml found
  Dec 07, 2015 5:43:47 PM org.apache.catalina.core.ContainerBase startInternal
  SEVERE: A child container failed during start
  java.util.concurrent.ExecutionException: 
  org.apache.catalina.LifecycleException: Failed to start component 
  [StandardEngine[Tomcat].StandardHost[localhost].
  StandardContext[/StrateboBackEnd]]
  ...
  Caused by: org.apache.catalina.LifecycleException: 
  Failed to start component StandardEngine[Tomcat].StandardHost[localhost].
  StandardContext[/myApp]]
  at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
  ... 6 more
  Caused by: java.lang.NoSuchMethodError:   
  javax.servlet.ServletContext.getClassLoader()Ljava/lang/ClassLoader;
  </code></pre>
  
  <p>I have the following setup for the embed tomcat</p>
  
  <pre><code>final Tomcat tomcat = new Tomcat();
  tomcat.setPort(9191);
  File baseDir = new File(".");
  Context context = tomcat.addContext("", baseDir.getAbsolutePath());
  tomcat.addWebapp("/Myapp", "C://Users//Add//git//Myapp//build//libs//Myapp-1.1.war");
  tomcat.enableNaming();
  ContextResource res = new ContextResource();
  res.setName("jdbc/myDatabase");
  res.setType("javax.sql.DataSource");
  res.setAuth("Container");
  res.setProperty("username", "username");
  res.setProperty("password", "password");
  res.setProperty("driverClassName","net.sourceforge.jtds.jdbc.Driver");
  res.setProperty("url", "jdbc:jtds:sqlserver://127.0.0.1:1433//myDatabase");
  res.setProperty("maxTotal", "10");
  res.setProperty("maxIdle", "10");
  res.setProperty("maxWaitMillis", "10000");
  res.setProperty("removeAbandonedTimeout","300"); 
  res.setProperty("defaultAutoCommit","true"); 
  context.getNamingResources().addResource(res);
  tomcat.start();
  tomcat.getServer().await();
  </code></pre>
  
  <p>I have a context.xml that I use for normal deployment but this does not get read in embedded from what I can tell.</p>
  
  <p>Since the jar works on a standalone I know that the jar is not the problem</p>
  
  <p>There is this Info line
  INFO: No global web.xml found
  Which might point to an issue but could not find a reference
  Just in case here is the relevant part of my gradle file for dependencies</p>
  
  <pre><code>compile 'org.apache.tomcat:tomcat-util:8.0.28'
  compile 'org.apache.tomcat.embed:tomcat-embed-core:8.0.28'
  compile 'org.apache.tomcat.embed:tomcat-embed-jasper:8.0.28'
  compile 'org.apache.tomcat.embed:tomcat-embed-logging-juli:8.0.28'
  compile 'org.apache.tomcat:tomcat-dbcp:8.0.28'
  </code></pre>
  
  <p>Any suggestions greatly appreciated?
  For an extra point is there any way to get tomcat to give better feedback as to what it is not liking?</p>