将逆向生成的文件粘贴到项目中,出现以下报错
相关截图:
问题描述:
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.zaxxer.hikari.HikariDataSource]: Factory method 'dataSource' threw exception; nested exception is java.lang.IllegalStateException: Cannot load driver class: com.mysql.jdbc.Driver
3
收起
正在回答
1回答
参考一下逆向工具里的数据源,你的数据库不匹配就是要改的,其实控制台里的报错也很明显,直接复制粘贴换一下就行。
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星