Getting exception when try get connection on datasource:
Cannot create JDBC driver of
class '' for connect URL 'null'
Context
web.xml
</context-param>
<resource-ref>
<res-ref-name>jdbc/shop_MYSQL</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
Pom
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.11</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-jdbc</artifactId>
<version>8.0.20</version>
</dependency>
code:
Context ctx = new InitialContext();
ds = (DataSource) ctx.lookup("java:comp/env/jdbc/shop_MYSQL");
Connection conn = ds.getConnection();