Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Can't get JNDI DataSource working

Help
2007-02-11
2013-04-08
  • I'm trying to set up nemesis-forum in apache-tomcat-5.5.20 to use PostgreSQL and I keep getting this error:

    ERROR jdbc.DataSourceConnectionProvider  - Could not retrieve Connection from DataSource
    org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null'

    I did some research and found this document: http://paperstack.com/tips/tomcat_config.html

    I changed the datasource configuration from this:

    <ResourceParams name="jdbc/MyDataSource">
        <parameter>
            <name>username</name>
            <value>"jspUser"</value>
        </parameter>
        <parameter>
            <name>password</name>
            <value>"jspUserPass"</value>
        </parameter>
        <parameter>
            <name>driverClassName</name>
            <value>"org.postgresql.Driver"</value>
        </parameter>
        <parameter>
            <name>url</name>
            <value>"jdbc:postgresql://localhost:5432/yazd"</value>
        </parameter>
        <parameter>
          <name>maxActive</name>
          <value>8</value>
        </parameter>
        <parameter>
          <name>maxIdle</name>
          <value>4</value>
        </parameter>
    </ResourceParams>

    to this:

    <Resource
        name="jdbc/MyDataSource" auth="Container"
        type="javax.sql.DataSource"
        driverClassName="org.postgresql.Driver"
        url="jdbc:postgresql://localhost:5432/yazd"
        username="jspUser"
        password="jspUserPass"
        maxActive="8"
        maxIdle="4"
    />

    as that article suggests, but it didn't make any difference.