commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dennis Lundberg <denn...@apache.org>
Subject Re: Error loading DBCP NoClassDefFoundError
Date Fri, 14 Jul 2006 10:22:02 GMT
Benjamin Cuthbert wrote:
> All when i try and use the DBCP code i get the following error
> 
> java.lang.NoClassDefFoundError:
> org/apache/commons/pool/impl/GenericObjectPool
>        at complexcvfeed.OraThin.setupDataSource(OraThin.java:77)
>        at complexcvfeed.OraThin.<init>(OraThin.java:35)
> 
> ANd in my class OraThin line 77 i have
> 
>   public static DataSource setupDataSource(String connectURI) {
>       BasicDataSource ds = null;
>        ds = new BasicDataSource();
>        ds.setDriverClassName("oracle.jdbc.driver.OracleDriver");
>        ds.setUsername("user");
>        ds.setPassword("pass");
>        ds.setUrl(connectURI);
>       return ds;
>   }
> 
> And 35 i have
> 
>        String dbUrl = "jdbc:oracle:thin:user/pass@dbhostname.uk.db.com:1521
> :SID";
>        DataSource dataSource = setupDataSource(dbUrl);
> 
> I have the commons-dbcp-1.2.1.jar in the class path, so i don't understand
> why it does not work
> 

You also need commons-pool in your class path.

"The commons-dbcp package relies on code in the commons-pool package to 
provide the underlying object pool mechanisms that it utilizes."

-- 
Dennis Lundberg

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


Mime
View raw message