java.lang.NoClassDefFoundError: Could not initialize class 解决方法

在配置数据库连接池的时候抛出Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class异常

经过苦苦查询之后发现是缺少commons-logging.jar包

导入commons-logging.jar依赖再运行就能成功连接数据库了

原文地址:https://www.cnblogs.com/code-xu/p/14430413.html