springboot通过使用druid-spring-boot-starter整合Druid后一直报错,问题是之前使用druid依赖整合是没问题的!
先报:
org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is java.lang.NullPointerException
怀疑是版本冲突,把spring-boot版本换成了2.1.10,结果报错:
Caused by: java.lang.ClassNotFoundException: org.springframework.boot.bind.RelaxedPropertyResolver
网上看了下说是少了
<parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.1.10.RELEASE</version> <relativePath/> </parent>
到项目一看,果然没有这个!当时创建springboot项目时,网络太卡,等了很久,就创建了个普通的java项目改造,留下这个大坑!