Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

caused by:java.lang.NoClassDefRoundError:com/mchange/v2/ser/indirector

When I try to use c3p0 to test a mysql database connection, Eclipse shows the following error:

caused by:java.lang.NoClassDefFoundError:com/mchange/v2/ser/indirector,

I googled and was unable to find an answer.

Could anyone help me? I am a java rookie, thanks!

like image 763
triven Avatar asked Mar 17 '23 19:03

triven


1 Answers

First, make sure that your project is properly loading mchange-commons-java, where the stuff you are com.mchange.v2.ser.* lives. It is a transitive dependency of c3p0.

Hopefully you are using c3p0-0.9.5. Try changing the c3p0 config param contextClassLoaderSource to library to avoid some ClassLoader confusions.

like image 150
Steve Waldman Avatar answered Apr 25 '23 21:04

Steve Waldman