一、问题现象
报错日志如下
2021-10-14 11:42:52.749947776 /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
2021-10-14 11:42:52.749952344 ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
2021-10-14 11:42:52.749957622 \\/ ___)| |_)| | | | | || (_| | ) ) ) )
2021-10-14 11:42:52.749992623 ' |____| .__|_| |_|_| |_\__, | / / / /
2021-10-14 11:42:52.749998196 =========|_|==============|___/=/_/_/_/
2021-10-14 11:42:52.754652753 :: Spring Boot :: (v2.0.0.RELEASE)
2021-10-14 11:42:52.754679023
0001-01-01 08:00:00.000000000 org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor': Invocation of init method failed; nested exception is java.lang.AbstractMethodError: org.hibernate.validator.internal.engine.ConfigurationImpl.getDefaultParameterNameProvider()Ljavax/validation/ParameterNameProvider;
2021-10-14 11:42:55.984653643 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1710)
解决方式:
找了很多网络资料,都是这个解决方式,一试果然就好了,可惜不知道为啥,说是版本冲突,但是很笼统,比较迷茫,后续知道了再更新下。
由于hibernate-validator版本兼容问题,导致出现这个错误;
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<artifactId>hibernate-validator</artifactId>
<groupId>org.hibernate.validator</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>6.0.13.Final</version>
</dependency>