NoClassDefFoundError: org/apache/commons/pool/KeyedObjectPoolFactory BasicDataSource Spring
You're mixing up the versions. The KeyedObjectPoolFactory
class exists in the 1.x branch of commons-pool
, but not in 2.x. You should try with commons-pool-1.5.4
instead (which is the correct version dependency for commons-dbcp-1.4
)
And may I suggest using eg. Maven to manage your dependencies - you'll get the transitive dependencies versioned correctly for free (mostly at least...)
Cheers,
you could import the .Class by youself.import org.apache.commons.pool.KeyedObjectPoolFactory;