Chris,
I think you are missing the factory attribute in your Resource tag in your context.xml

        <Resource name="jdbc/MyDb"
                factory"org.apache.commons.dbcp.BasicDataSourceFactory"
                auth="Container"
                type="javax.sql.DataSource"
                maxActive="100" maxIdle="30" maxWait="10000"
                username="xx" password="yy"
                driverClassName="com.mysql.jdbc.Driver"
                url="jdbc:mysql://localhost:3306/MyDb?autoReconnect=true"/>

Do you have your mysql-connector and dbcp jar files in your tomcat's common/lib directory?

-Richard


Chris Marshall wrote:
I am still battling with thisproblem - which is probably very simple
for someone with experience - any help will be much appreciated.
Regards Chris

A GWT/iBatis/MySql application which I am trying to deploy via Tomcat
6 works well in GWT hosted and browser mode, and the GWT client works
fine via Tomcat. The configuration of Tomcat to access the MySql db
via JNDI is throwing the following exception:

org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC
driver of class '' for connect URL 'null'

I have the following configuration files in Tomcat:

File WEB-INF/web.xml:

<?xml version="1.0" encoding="UTF-8"?>
<web-app>

        <servlet>
                <servlet-name>MyAppServer</servlet-name>
                <servlet-class>net.cbtltd.server.MyAppServer</servlet-class>
        </servlet>
        
        <servlet-mapping>
                <servlet-name>MyAppServer</servlet-name>
                <url-pattern>/MyAppService</url-pattern>
        </servlet-mapping>

        <resource-ref>
                <description>DB Connection</description>
                <res-ref-name>jdbc/MyDb</res-ref-name>
                <res-type>javax.sql.DataSource</res-type>
                <res-auth>Container</res-auth>
        </resource-ref>

</web-app>


File WEB-INF/context.xml:

<Context path="/myapp" docBase="myapp" debug="5" reloadable="true">

        <Resource name="jdbc/MyDb"
                auth="Container"
                type="javax.sql.DataSource"
                maxActive="100" maxIdle="30" maxWait="10000"
                username="xx" password="yy"
                driverClassName="com.mysql.jdbc.Driver"
                url="jdbc:mysql://localhost:3306/MyDb?autoReconnect=true"/>

</Context>


File WEB-INF/SqlMapConfig.xml:

<?xml version="1.0" encoding="UTF-8" ?>
<sqlMapConfig>
  <settings useStatementNamespaces="true" />

  <transactionManager type="JDBC">
        <dataSource type="JNDI">
                <property name="DataSource" value="java:/comp/env/jdbc/MyDb"/>
        </dataSource>
   </transactionManager>

   <!-- List of SQL Map XML files.   -->
  <sqlMap resource="net/cbtltd/xml/account_SqlMap.xml"/>
...etc...
</sqlMapConfig>


Reply via email to