SpringBoot启动报错:Error creating bean with name ‘servletEndpointRegistrar’ defined in class path resource

SpringBoot启动报错:Error creating bean with name ‘servletEndpointRegistrar’ defined in class path resource

SpringBoot启动报错:Error creating bean with name 'servletEndpointRegistrar' defined in class path resource

2021-11-24 15:25:26.381 ERROR 11040 — o.s.b.w.e.t.TomcatStarter : Error starting Tomcat context. Exception: org.springframework.beans.factory.BeanCreationException. Message: Error creating bean with name ‘servletEndpointRegistrar’ defined in class path resource 。

image

往下翻会看到一句:

Error creating bean with name ‘servletEndpointRegistrar’ defined in class path resource

再往下仔细查找,有下面的报错:

Factory method ‘dataSource’ threw exception; nested exception is java.lang.IllegalStateException: Cannot load driver class: org.postgresql.Driver

image

很明显,缺少驱动,检查pom文件,没发现问题。

image

解决问题的操作:

清空缓存重启IDEA

输入maven命令:mvn idea:idea

大T笔记所有文章均为本人原创,转载请您注明来源,并留下原文链接地址,是对我的尊重,也是对知识的尊重,谢谢!
大T笔记 » SpringBoot启动报错:Error creating bean with name ‘servletEndpointRegistrar’ defined in class path resource

大T笔记-我的个人互联网创业和自由职业之路

关于我 我的百宝箱
大T笔记-专注个人互联网创业和自由职业