title: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null'
body: <p>Hi
  When I try to connect to the datasource using JNDI, I am getting this error:</p>
  
  <pre><code>    [org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null'
      at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createConnectionFactory(BasicDataSource.java:1452)
      at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1371)
      at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
      at org.apache.roller.weblogger.business.DatabaseProvider.getConnection(DatabaseProvider.java:179)
      at org.apache.roller.weblogger.business.DatabaseProvider.&lt;init&gt;(DatabaseProvider.java:141)
      at org.apache.roller.weblogger.business.startup.WebloggerStartup.prepare(WebloggerStartup.java:171)
      at org.apache.roller.weblogger.ui.core.RollerContext.contextInitialized(RollerContext.java:138)
      at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4205)
      at org.apache.catalina.core.StandardContext.start(StandardContext.java:4704)
      at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)
      at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
      at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601)
      at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1079)
      at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:1002)
      at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:506)
      at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1315)
      at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324)
      at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
      at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1061)
      at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
      at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
      at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
      at org.apache.catalina.core.StandardService.start(StandardService.java:525)
      at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
      at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
      at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
  Caused by: java.lang.NullPointerException
      at sun.jdbc.odbc.JdbcOdbcDriver.getProtocol(JdbcOdbcDriver.java:507)
      at sun.jdbc.odbc.JdbcOdbcDriver.knownURL(JdbcOdbcDriver.java:476)
      at sun.jdbc.odbc.JdbcOdbcDriver.acceptsURL(JdbcOdbcDriver.java:307)
      at java.sql.DriverManager.getDriver(DriverManager.java:253)
      at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createConnectionFactory(BasicDataSource.java:1437)
      ... 30 more]
  </code></pre>
  
  <p><strong>Context.xml</strong></p>
  
  <pre><code>&lt;Context path="/roller" docBase="c:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\roller" debug="0"&gt;
      &lt;Resource name="jdbc/rollerdb" auth="Container"
          type="javax.sql.DataSource"
          driverClassName="com.mysql.jdbc.Driver"
          url="jdbc:mysql://localhost:3306/rollerdb?autoReconnect=true&amp;amp;useUnicode=true&amp;amp;characterEncoding=utf8-&amp;amp;mysqlEncoding=utf8"
          username="roller_user"
          password="password"
          maxActive="20" maxIdle="3" removeAbandoned="true"
          maxWait="3000" 
      /&gt;
      &lt;Resource name="mail/Session"
          auth="Container"
          type="javax.mail.Session"
          username="username@gmail.com"
          password="password"
          mail.debug="false"
          mail.user="username@gmail.com"
          mail.password="password"
          mail.smtp.from="username@gmail.com"
          mail.transport.protocol="smtp"
          mail.smtp.port="465"
          mail.smtp.host="smtp.gmail.com"
          mail.smtp.auth="true"
          mail.smtp.starttls.enable="true"
          mail.smtp.socketFactory.port="465"
          mail.smtp.socketFactory.class="javax.net.ssl.SSLSocketFactory"
          mail.smtp.socketFactory.fallback="false" 
      /&gt;
  &lt;/Context&gt;
  </code></pre>
  
  <p><strong>web.xml</strong></p>
  
  <pre><code>&lt;web-app .. &gt;
  ...
      &lt;!-- jndi resources --&gt;
      &lt;resource-ref&gt;
          &lt;res-ref-name&gt;jdbc/rollerdb&lt;/res-ref-name&gt;
          &lt;res-type&gt;javax.sql.DataSource&lt;/res-type&gt;
          &lt;res-auth&gt;Container&lt;/res-auth&gt;
      &lt;/resource-ref&gt;
  
      &lt;resource-ref&gt;
          &lt;res-ref-name&gt;mail/Session&lt;/res-ref-name&gt;
          &lt;res-type&gt;javax.mail.Session&lt;/res-type&gt;
          &lt;res-auth&gt;Container&lt;/res-auth&gt;
      &lt;/resource-ref&gt;
  
  &lt;/web-app&gt;
  </code></pre>
  
  <p><strong>roller-custom.properties</strong></p>
  
  <pre><code>installation.type=auto
  database.configurationType=jndi
  database.jndi.name=jdbc/rollerdb
  mail.configurationType=jndi
  mail.jndi.name=mail/Session
  </code></pre>
  
  <p>I've got mysql-connector-java-5.1.15-bin.jar, activation.jar and mail.jar in tomcat's lib diectory and the web application roller in tomcat's webapps folder.</p>
  
  <p>I've not been able to understand what I am doing wrong here. Could someone help me understand what am I missing here?</p>
  
  <p>Thanks.</p>
  
  <p>Thanks.</p>