commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Phil Steitz" <phil.ste...@gmail.com>
Subject Re: Which JAR file contains TesterDriver and supporting classes?
Date Fri, 15 Feb 2008 18:43:15 GMT
On 2/15/08, Steve Perkins <Steve.Perkins@trx.com> wrote:
>
>        I'm trying to use JNDI in a standalone application, following
> the example posted at:
>
> http://commons.apache.org/dbcp/guide/jndi-howto.html
>
>        The example at the bottom of that page runs after I include
> several JAR's in my CLASSPATH (the Sun JNDI JAR's, Commons DBCP, and
> Commons Pool).  However, I'm still getting a ClassNotFoundException at
> runtime, because the test class cannot find
> "org.apache.commons.dbcp.TesterDriver".
>
>        Based on the package name, one would expect that this class
> would be found within the Commons DBCP JAR.  However, it is not present
> there... and I haven't found it even when going back to older versions
> of that JAR in the archive.
>
>        Doing a Google search, I found the text for the
> TesterDriver.java class specifically, and tried putting that source in
> my environment.  However, it in turn has dependencies on other classes
> such as "TesterConnection", etc.  Rather than chase down every single
> dependency class one-by-one, I'd rather figure out what is going on here
> at the root level.  Obviously I am missing some JAR that contains all
> these classes already, can someone point me in the proper direction?
> Thanks in advance!

The example of the web page is from the dbcp unit tests.  Sorry, that
should be made clearer (and in fact the whole example should be
reworked to use a real datasource).  "TesterDriver" and
"TesterConnection" are mock objects used by the unit tests.  You need
to replace the driver class name and url in the example with a real
jdbc driver and connection url for your application.

If you really want to run the example as presented, you need to
compile the unit test classes that can be found in the source
distribution or in the subversion source repository under src/test.

Phil

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


Mime
View raw message