title: AbstractMethodError with jTDS JDBC Driver on Tomcat 8
body: <p>I am deploying a web app (WAR) to a Tomcat 8 web container.</p>
  
  <p>The WAR includes in the '/WEB-INF/lib' directory the following jTDS JDBC driver:</p>
  
  <pre><code>&lt;dependency org="net.sourceforge.jtds" name="jtds" rev="1.3.1" /&gt;
  </code></pre>
  
  <p>(file is: <code>jtds-1.3.1.jar</code>).</p>
  
  <p>This is how the resource is defined in <code>META-INF/context.xml</code>:</p>
  
  <pre><code>&lt;Resource name="jdbc/jtds/sybase/somedb"
            auth="Container"
            type="javax.sql.DataSource"
            driverClassName="net.sourceforge.jtds.jdbc.Driver"
            url="jdbc:jtds:sybase://localhost:2501/somedb"
            username="someuser" password="somepassword"
  /&gt;
  </code></pre>
  
  <p>In my code I obtain the <a href="https://docs.oracle.com/javase/7/docs/api/javax/sql/DataSource.html" rel="noreferrer">javax.sql.DataSource</a> the normal way:</p>
  
  <pre><code>InitialContext cxt = new InitialContext();
  if ( cxt == null ) {
      throw new RuntimeException("Uh oh -- no context!");
  }
  DataSource ds = (DataSource) cxt.lookup( lookupName );
  </code></pre>
  
  <p>I further verify (by printing) that the DataSource object <code>ds</code> is of the expected type:</p>
  
  <pre><code>org.apache.tomcat.dbcp.dbcp2.BasicDataSource
  </code></pre>
  
  <p>&hellip; but when I try to get a connection out of it:</p>
  
  <pre><code>Connection conn = ds.getConnection();
  </code></pre>
  
  <p>&hellip; I get the following trace:</p>
  
  <pre><code>java.lang.AbstractMethodError
  net.sourceforge.jtds.jdbc.JtdsConnection.isValid(JtdsConnection.java:2833)
  org.apache.tomcat.dbcp.dbcp2.DelegatingConnection.isValid(DelegatingConnection.java:924)
  org.apache.tomcat.dbcp.dbcp2.PoolableConnection.validate(PoolableConnection.java:282)
  org.apache.tomcat.dbcp.dbcp2.PoolableConnectionFactory.validateConnection(PoolableConnectionFactory.java:359)
  org.apache.tomcat.dbcp.dbcp2.BasicDataSource.validateConnectionFactory(BasicDataSource.java:2316)
  org.apache.tomcat.dbcp.dbcp2.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:2299)
  org.apache.tomcat.dbcp.dbcp2.BasicDataSource.createDataSource(BasicDataSource.java:2043)
  org.apache.tomcat.dbcp.dbcp2.BasicDataSource.getConnection(BasicDataSource.java:1543)
  </code></pre>
  
  <p>What gives?</p>