You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Suraj Sashidharan <ss...@hotmail.com> on 2005/06/11 23:38:02 UTC

Vexing problem with Tomcat 5.0.28/Pointbase/JNDI/ConnectionPooling

Hi all,

   Tomcat 5.0.28 with Pointbase - Trying to obtain a database connection 
from the DataSource.

       I saw a zillion places in the web where they've discussed a problem 
quite similar to the exception shown below BUT, none exactly like what I'm 
experiencing. And by the way, I couldn't even find one case where they were 
trying to connect with Pointbase. I followed documentation from all over the 
web, but I don't see anything that I could be missing. To explain, many have 
complained about null values for class and URL in the exception message that 
you see below, but I don't have that problem. What could be wrong?

   I have spent 5 hours trying to fix this.

   (It is not even a case of the JDBC driver not being located as I get a 
different error message when I remove the JDBC driver .jar files 
(pbclient.jar). Pointbase is up and running on port 9092. Funny thing is the 
same error message comes up whether Pointbase is running or not.)

   Please HELP !!

Exception :

org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of 
class 'com.pointbase.jdbc.jdbcDataSource' for connect URL 
'jdbc:pointbase:server://localhost:9092/dbCompany'
        at 
org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:780)
        at 
org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540)
        at dataaccess.UserDatabaseAccessBean.findByUserId(Unknown Source)
        at security.databaseclient.SecurityBean.login(Unknown Source)
        at security.SecurityControllerServlet.doPost(Unknown Source)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
        at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
        at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
        at 
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:704)
        at 
org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:474)
        at 
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:409)
        at 
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:312)
        at framework.MainControllerServlet.processRequest(Unknown Source)
        at framework.MainControllerServlet.doPost(Unknown Source)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
        at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
        at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
        at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
        at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
        at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
        at 
org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
        at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
        at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
        at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
        at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
        at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
        at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
        at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
        at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
        at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
        at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
        at 
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
        at 
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
        at 
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
        at 
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
        at 
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
        at 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
        at java.lang.Thread.run(Thread.java:534)
Caused by: java.sql.SQLException: No suitable driver
        at java.sql.DriverManager.getDriver(DriverManager.java:243)
        at 
org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:773)
        ... 40 more


server.xml portion
------------------

    <Resource name="jdbc/company" type="javax.sql.DataSource"/>
    <ResourceParams name="jdbc/company">
      <parameter>
        <name>maxWait</name>
        <value>5000</value>
      </parameter>
      <parameter>
        <name>maxActive</name>
        <value>4</value>
      </parameter>
      <parameter>
        <name>password</name>
        <value>password</value>
      </parameter>
      <parameter>
        <name>url</name>
        <value>jdbc:pointbase:server://localhost:9092/dbCompany</value>
      </parameter>
      <parameter>
        <name>driverClassName</name>
        <value>com.pointbase.jdbc.jdbcDataSource</value>
      </parameter>
      <parameter>
        <name>maxIdle</name>
        <value>2</value>
      </parameter>
      <parameter>
        <name>username</name>
        <value>username</value>
      </parameter>
    </ResourceParams>

web.xml portion
---------------

  <resource-ref>
    <description>dbCompany database</description>
    <res-ref-name>jdbc/company</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    <res-sharing-scope>Shareable</res-sharing-scope>
  </resource-ref>

Context.xml that gets copied into conf/catalina/localhost as 
{webappname}.xml
--------------------------------------------------------------------------------------------------------------
<?xml version='1.0' encoding='utf-8'?>
<Context displayName="Web Application" docBase="webappname" 
path="/webappname" workDir="work\Catalina\localhost\webappname">
    <ResourceLink name="jdbc/company" type="javax.sql.DataSource" 
global="jdbc/company"/>
</Context>



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Vexing problem with Tomcat 5.0.28/Pointbase/JNDI/ConnectionPooling

Posted by Suraj Sashidharan <ss...@hotmail.com>.
Hi Doug,

    Your suggestion is right on the money. Everything works well now. Thanks 
a lot!

Regards,
Suraj.



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Vexing problem with Tomcat 5.0.28/Pointbase/JNDI/ConnectionPooling

Posted by Parsons Technical Services <pa...@earthlink.net>.
Try this:
     <parameter>
        <name>driverClassName</name>
        <value>com.pointbase.jdbc.jdbcUniversalDriver</value>
      </parameter>

in place of:

     <parameter>
        <name>driverClassName</name>
        <value>com.pointbase.jdbc.jdbcDataSource</value>
      </parameter>

Doug

----- Original Message ----- 
From: "Suraj Sashidharan" <ss...@hotmail.com>
To: <to...@jakarta.apache.org>
Sent: Saturday, June 11, 2005 5:38 PM
Subject: Vexing problem with Tomcat 5.0.28/Pointbase/JNDI/ConnectionPooling


> Hi all,
>
>   Tomcat 5.0.28 with Pointbase - Trying to obtain a database connection 
> from the DataSource.
>
>       I saw a zillion places in the web where they've discussed a problem 
> quite similar to the exception shown below BUT, none exactly like what I'm 
> experiencing. And by the way, I couldn't even find one case where they 
> were trying to connect with Pointbase. I followed documentation from all 
> over the web, but I don't see anything that I could be missing. To 
> explain, many have complained about null values for class and URL in the 
> exception message that you see below, but I don't have that problem. What 
> could be wrong?
>
>   I have spent 5 hours trying to fix this.
>
>   (It is not even a case of the JDBC driver not being located as I get a 
> different error message when I remove the JDBC driver .jar files 
> (pbclient.jar). Pointbase is up and running on port 9092. Funny thing is 
> the same error message comes up whether Pointbase is running or not.)
>
>   Please HELP !!
>
> Exception :
>
> org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of 
> class 'com.pointbase.jdbc.jdbcDataSource' for connect URL 
> 'jdbc:pointbase:server://localhost:9092/dbCompany'
>        at 
> org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:780)
>        at 
> org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540)
>        at dataaccess.UserDatabaseAccessBean.findByUserId(Unknown Source)
>        at security.databaseclient.SecurityBean.login(Unknown Source)
>        at security.SecurityControllerServlet.doPost(Unknown Source)
>        at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
>        at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>        at 
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
>        at 
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
>        at 
> org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:704)
>        at 
> org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:474)
>        at 
> org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:409)
>        at 
> org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:312)
>        at framework.MainControllerServlet.processRequest(Unknown Source)
>        at framework.MainControllerServlet.doPost(Unknown Source)
>        at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
>        at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>        at 
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
>        at 
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
>        at 
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
>        at 
> org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
>        at 
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
>        at 
> org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
>        at 
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
>        at 
> org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
>        at 
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
>        at 
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
>        at 
> org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
>        at 
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
>        at 
> org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
>        at 
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
>        at 
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>        at 
> org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
>        at 
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
>        at 
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
>        at 
> org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
>        at 
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
>        at 
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
>        at 
> org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
>        at 
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
>        at java.lang.Thread.run(Thread.java:534)
> Caused by: java.sql.SQLException: No suitable driver
>        at java.sql.DriverManager.getDriver(DriverManager.java:243)
>        at 
> org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:773)
>        ... 40 more
>
>
> server.xml portion
> ------------------
>
>    <Resource name="jdbc/company" type="javax.sql.DataSource"/>
>    <ResourceParams name="jdbc/company">
>      <parameter>
>        <name>maxWait</name>
>        <value>5000</value>
>      </parameter>
>      <parameter>
>        <name>maxActive</name>
>        <value>4</value>
>      </parameter>
>      <parameter>
>        <name>password</name>
>        <value>password</value>
>      </parameter>
>      <parameter>
>        <name>url</name>
>        <value>jdbc:pointbase:server://localhost:9092/dbCompany</value>
>      </parameter>
>      <parameter>
>        <name>driverClassName</name>
>        <value>com.pointbase.jdbc.jdbcDataSource</value>
>      </parameter>
>      <parameter>
>        <name>maxIdle</name>
>        <value>2</value>
>      </parameter>
>      <parameter>
>        <name>username</name>
>        <value>username</value>
>      </parameter>
>    </ResourceParams>
>
> web.xml portion
> ---------------
>
>  <resource-ref>
>    <description>dbCompany database</description>
>    <res-ref-name>jdbc/company</res-ref-name>
>    <res-type>javax.sql.DataSource</res-type>
>    <res-auth>Container</res-auth>
>    <res-sharing-scope>Shareable</res-sharing-scope>
>  </resource-ref>
>
> Context.xml that gets copied into conf/catalina/localhost as 
> {webappname}.xml
> --------------------------------------------------------------------------------------------------------------
> <?xml version='1.0' encoding='utf-8'?>
> <Context displayName="Web Application" docBase="webappname" 
> path="/webappname" workDir="work\Catalina\localhost\webappname">
>    <ResourceLink name="jdbc/company" type="javax.sql.DataSource" 
> global="jdbc/company"/>
> </Context>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Vexing problem with Tomcat 5.0.28/Pointbase/JNDI/ConnectionPooling

Posted by Suraj Sashidharan <ss...@hotmail.com>.
Hi David,

    Your suggestion solved the problem. I never realized that I had put in a 
wrong class for the driver. (I didn't have to do any of the other 
suggestions that you'd made in order to make it work). Thanks so much for 
spending your time on this and helping me out.

Thanks again!

>From: David Smith <dn...@cornell.edu>
>Reply-To: "Tomcat Users List" <to...@jakarta.apache.org>
>To: Tomcat Users List <to...@jakarta.apache.org>
>Subject: Re: Vexing problem with Tomcat 
>5.0.28/Pointbase/JNDI/ConnectionPooling
>Date: Sun, 12 Jun 2005 13:49:52 -0400
>
>This tells me a lot:  > Caused by: java.sql.SQLException: No suitable 
>driver
>
>Make sure the driver .jar file is in common/lib and the driverClassName 
>parameter of your <ResourceParams> element references the correct driver 
>class (don't use a DataSource class here). In your case, I think that 
>should be 'com.pointbase.jdbc.jdbcUniversalDriver'.  If you move the driver 
>file into common/lib, restart Tomcat so it can see the jar file.
>
>--David
>
>Suraj Sashidharan wrote:
>
>>Hi all,
>>
>>   Tomcat 5.0.28 with Pointbase - Trying to obtain a database connection 
>>from the DataSource.
>>
>>       I saw a zillion places in the web where they've discussed a problem 
>>quite similar to the exception shown below BUT, none exactly like what I'm 
>>experiencing. And by the way, I couldn't even find one case where they 
>>were trying to connect with Pointbase. I followed documentation from all 
>>over the web, but I don't see anything that I could be missing. To 
>>explain, many have complained about null values for class and URL in the 
>>exception message that you see below, but I don't have that problem. What 
>>could be wrong?
>>
>>   I have spent 5 hours trying to fix this.
>>
>>   (It is not even a case of the JDBC driver not being located as I get a 
>>different error message when I remove the JDBC driver .jar files 
>>(pbclient.jar). Pointbase is up and running on port 9092. Funny thing is 
>>the same error message comes up whether Pointbase is running or not.)
>>
>>   Please HELP !!
>>
>>Exception :
>>
>>org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of 
>>class 'com.pointbase.jdbc.jdbcDataSource' for connect URL 
>>'jdbc:pointbase:server://localhost:9092/dbCompany'
>>        at 
>>org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:780)
>>
>>        at 
>>org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540)
>>
>>        at dataaccess.UserDatabaseAccessBean.findByUserId(Unknown Source)
>>        at security.databaseclient.SecurityBean.login(Unknown Source)
>>        at security.SecurityControllerServlet.doPost(Unknown Source)
>>        at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
>>        at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>>        at 
>>org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
>>
>>        at 
>>org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
>>
>>        at 
>>org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:704)
>>
>>        at 
>>org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:474)
>>
>>        at 
>>org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:409)
>>
>>        at 
>>org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:312)
>>
>>        at framework.MainControllerServlet.processRequest(Unknown Source)
>>        at framework.MainControllerServlet.doPost(Unknown Source)
>>        at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
>>        at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>>        at 
>>org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
>>
>>        at 
>>org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
>>
>>        at 
>>org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
>>
>>        at 
>>org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
>>
>>        at 
>>org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
>>
>>        at 
>>org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
>>
>>        at 
>>org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
>>
>>        at 
>>org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
>>
>>        at 
>>org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
>>
>>        at 
>>org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
>>
>>        at 
>>org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
>>
>>        at 
>>org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
>>
>>        at 
>>org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
>>
>>        at 
>>org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
>>
>>        at 
>>org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>>
>>        at 
>>org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
>>
>>        at 
>>org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
>>
>>        at 
>>org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
>>        at 
>>org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
>>        at 
>>org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
>>
>>        at 
>>org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
>>
>>        at 
>>org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
>>
>>        at 
>>org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
>>
>>        at java.lang.Thread.run(Thread.java:534)
>>Caused by: java.sql.SQLException: No suitable driver
>>        at java.sql.DriverManager.getDriver(DriverManager.java:243)
>>        at 
>>org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:773)
>>
>>        ... 40 more
>>
>>
>>server.xml portion
>>------------------
>>
>>    <Resource name="jdbc/company" type="javax.sql.DataSource"/>
>>    <ResourceParams name="jdbc/company">
>>      <parameter>
>>        <name>maxWait</name>
>>        <value>5000</value>
>>      </parameter>
>>      <parameter>
>>        <name>maxActive</name>
>>        <value>4</value>
>>      </parameter>
>>      <parameter>
>>        <name>password</name>
>>        <value>password</value>
>>      </parameter>
>>      <parameter>
>>        <name>url</name>
>>        <value>jdbc:pointbase:server://localhost:9092/dbCompany</value>
>>      </parameter>
>>      <parameter>
>>        <name>driverClassName</name>
>>        <value>com.pointbase.jdbc.jdbcDataSource</value>
>>      </parameter>
>>      <parameter>
>>        <name>maxIdle</name>
>>        <value>2</value>
>>      </parameter>
>>      <parameter>
>>        <name>username</name>
>>        <value>username</value>
>>      </parameter>
>>    </ResourceParams>
>>
>>web.xml portion
>>---------------
>>
>>  <resource-ref>
>>    <description>dbCompany database</description>
>>    <res-ref-name>jdbc/company</res-ref-name>
>>    <res-type>javax.sql.DataSource</res-type>
>>    <res-auth>Container</res-auth>
>>    <res-sharing-scope>Shareable</res-sharing-scope>
>>  </resource-ref>
>>
>>Context.xml that gets copied into conf/catalina/localhost as 
>>{webappname}.xml
>>--------------------------------------------------------------------------------------------------------------
>>
>><?xml version='1.0' encoding='utf-8'?>
>><Context displayName="Web Application" docBase="webappname" 
>>path="/webappname" workDir="work\Catalina\localhost\webappname">
>>    <ResourceLink name="jdbc/company" type="javax.sql.DataSource" 
>>global="jdbc/company"/>
>></Context>
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Vexing problem with Tomcat 5.0.28/Pointbase/JNDI/ConnectionPooling

Posted by David Smith <dn...@cornell.edu>.
This tells me a lot:  > Caused by: java.sql.SQLException: No suitable driver

Make sure the driver .jar file is in common/lib and the driverClassName 
parameter of your <ResourceParams> element references the correct driver 
class (don't use a DataSource class here). In your case, I think that 
should be 'com.pointbase.jdbc.jdbcUniversalDriver'.  If you move the 
driver file into common/lib, restart Tomcat so it can see the jar file.

--David

Suraj Sashidharan wrote:

> Hi all,
>
>   Tomcat 5.0.28 with Pointbase - Trying to obtain a database 
> connection from the DataSource.
>
>       I saw a zillion places in the web where they've discussed a 
> problem quite similar to the exception shown below BUT, none exactly 
> like what I'm experiencing. And by the way, I couldn't even find one 
> case where they were trying to connect with Pointbase. I followed 
> documentation from all over the web, but I don't see anything that I 
> could be missing. To explain, many have complained about null values 
> for class and URL in the exception message that you see below, but I 
> don't have that problem. What could be wrong?
>
>   I have spent 5 hours trying to fix this.
>
>   (It is not even a case of the JDBC driver not being located as I get 
> a different error message when I remove the JDBC driver .jar files 
> (pbclient.jar). Pointbase is up and running on port 9092. Funny thing 
> is the same error message comes up whether Pointbase is running or not.)
>
>   Please HELP !!
>
> Exception :
>
> org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver 
> of class 'com.pointbase.jdbc.jdbcDataSource' for connect URL 
> 'jdbc:pointbase:server://localhost:9092/dbCompany'
>        at 
> org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:780) 
>
>        at 
> org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540) 
>
>        at dataaccess.UserDatabaseAccessBean.findByUserId(Unknown Source)
>        at security.databaseclient.SecurityBean.login(Unknown Source)
>        at security.SecurityControllerServlet.doPost(Unknown Source)
>        at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
>        at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>        at 
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237) 
>
>        at 
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157) 
>
>        at 
> org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:704) 
>
>        at 
> org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:474) 
>
>        at 
> org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:409) 
>
>        at 
> org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:312) 
>
>        at framework.MainControllerServlet.processRequest(Unknown Source)
>        at framework.MainControllerServlet.doPost(Unknown Source)
>        at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
>        at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>        at 
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237) 
>
>        at 
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157) 
>
>        at 
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214) 
>
>        at 
> org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) 
>
>        at 
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) 
>
>        at 
> org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198) 
>
>        at 
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152) 
>
>        at 
> org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) 
>
>        at 
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) 
>
>        at 
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137) 
>
>        at 
> org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) 
>
>        at 
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118) 
>
>        at 
> org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102) 
>
>        at 
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) 
>
>        at 
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) 
>
>        at 
> org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) 
>
>        at 
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) 
>
>        at 
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
>        at 
> org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
>        at 
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799) 
>
>        at 
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705) 
>
>        at 
> org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577) 
>
>        at 
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683) 
>
>        at java.lang.Thread.run(Thread.java:534)
> Caused by: java.sql.SQLException: No suitable driver
>        at java.sql.DriverManager.getDriver(DriverManager.java:243)
>        at 
> org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:773) 
>
>        ... 40 more
>
>
> server.xml portion
> ------------------
>
>    <Resource name="jdbc/company" type="javax.sql.DataSource"/>
>    <ResourceParams name="jdbc/company">
>      <parameter>
>        <name>maxWait</name>
>        <value>5000</value>
>      </parameter>
>      <parameter>
>        <name>maxActive</name>
>        <value>4</value>
>      </parameter>
>      <parameter>
>        <name>password</name>
>        <value>password</value>
>      </parameter>
>      <parameter>
>        <name>url</name>
>        <value>jdbc:pointbase:server://localhost:9092/dbCompany</value>
>      </parameter>
>      <parameter>
>        <name>driverClassName</name>
>        <value>com.pointbase.jdbc.jdbcDataSource</value>
>      </parameter>
>      <parameter>
>        <name>maxIdle</name>
>        <value>2</value>
>      </parameter>
>      <parameter>
>        <name>username</name>
>        <value>username</value>
>      </parameter>
>    </ResourceParams>
>
> web.xml portion
> ---------------
>
>  <resource-ref>
>    <description>dbCompany database</description>
>    <res-ref-name>jdbc/company</res-ref-name>
>    <res-type>javax.sql.DataSource</res-type>
>    <res-auth>Container</res-auth>
>    <res-sharing-scope>Shareable</res-sharing-scope>
>  </resource-ref>
>
> Context.xml that gets copied into conf/catalina/localhost as 
> {webappname}.xml
> -------------------------------------------------------------------------------------------------------------- 
>
> <?xml version='1.0' encoding='utf-8'?>
> <Context displayName="Web Application" docBase="webappname" 
> path="/webappname" workDir="work\Catalina\localhost\webappname">
>    <ResourceLink name="jdbc/company" type="javax.sql.DataSource" 
> global="jdbc/company"/>
> </Context>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org