Error creating bean with name 'methodValidationPostProcessor' defined in class path resource
阿新 • • 發佈:2018-12-15
異常:Error creating bean with name ‘methodValidationPostProcessor’ defined in class path resource [org/springframework/boot/autoconfigure/validation/ValidationAutoConfiguration.class]: Unsatisfied dependency expressed through method ‘methodValidationPostProcessor’ parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘jotm’ defined in class path resource [applicationContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.hfb.merchant.datasource.JotmFactoryBean]: Constructor threw exception; nested exception is java.lang.NoSuchMethodError: stub class initialization failed
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> <!-- 移除嵌入式tomcat外掛 --> <exclusions> <exclusion> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-tomcat</artifactId> </exclusion> <exclusion> <groupId> org.hibernate</groupId> <artifactId>hibernate-validator</artifactId> </exclusion> </exclusions> </dependency>
如上圖所示加入紅框中的程式碼