Hello,

I am getting the following error when tomcat starts up:

Cannot create JDBC driver of class ' ' or connect URL 'null'
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.createDataSource(
BasicDataSource.java:1143)
        at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(
BasicDataSource.java:880)

I have global Resource name database entries in my server.xml, and inside of
$CATALINA_HOME/conf/[engine]/[host]/<context> I have resource links to those
resources as this segregates what contexts have access to our given set of
resources.

Below is the syntax from my server.xml

<GlobalNamingResources>
    <Resource name="UserDatabase" auth="Container"
              type="org.apache.catalina.UserDatabase"
              description="User database that can be updated and saved"
              factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
              pathname="conf/tomcat-users.xml" />

<Resource name="jdbc/<db name>" auth="Container" type="javax.sql.DataSource"
                 maxActive="0" maxIdle="50" maxWait="10000"
                 driverClassName="com.mysql.jdbc.Driver"
                  url="jdbc:mysql://<db host>/<dbname>:3306"/>

</GlobalNamingResources>

Syntax from my <context>.xml
<Context path="/<context>" docBase="webapps/<webapp name>">
    <ResourceLink name="jdbc/<dbname>" global="jdbc/<dbname>" type="
javax.sql.DataSource"/>
</Context>

I have the mysql driver in lib, I dont believe that is the issue.

It feels like the linking process between the context and the global
resource isnt happening because the stack trace is complaining of a null
pointer.

Am I doing this incorrectly?  Is my syntax off?  Do I need to add additional
params somewhere?

any help would be much appreciated.
thanks
-dustin

Reply via email to