1. 程式人生 > >Error creating bean with name 'methodValidationPostProcessor' defined in class path resource

Error creating bean with name 'methodValidationPostProcessor' defined in class path resource

異常: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>

在這裡插入圖片描述 如上圖所示加入紅框中的程式碼