项目中遇到的异常

时间:2025-03-25 15:22:24

1、

 

 

: Unable to create a Configuration, because no Bean Validation provider could be found. Add a provider like Hibernate Validator (RI) to your classpath.

 

是一个springmvc的验证异常,原因是缺少jar包

 

解决方法

 

 

	<dependency>
		<groupId></groupId>
		<artifactId>validation-api</artifactId>
		<version>1.1.</version>
	</dependency>
	<dependency>
		<groupId></groupId>
		<artifactId>hibernate-validator</artifactId>
		<version>5.2.</version>
	</dependency>

 

 

 

 

 

贴入上边的坐标,就能解决问题。

 

 

:

 

这是spring框架创建实体类失败的时候产生的异常,根据异常信息往下读,

找到service层创建实体类的时候失败。

发现service的实现类上没有@service注解。

 

 

: Error creating bean with name '': Injection of autowired dependencies failed; nested exception is : Could not autowire field: private  ; nested exception is : No qualifying bean of type [] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@(required=true)}
	at (:288)
	at (:1116)
	at (:376)
	at (:110)
	at (:75)
	at (:312)
	at .junit4.(:211)
	at .junit4.SpringJUnit4ClassRunner$(:288)
	at (:15)
	at .junit4.(:284)
	at .junit4.(:231)
	at .junit4.(:88)
	at $(:231)
	at $(:60)
	at (:229)
	at $000(:50)
	at $(:222)
	at .(:61)
	at .(:71)
	at (:292)
	at .junit4.(:174)
	at ..(:50)
	at (:38)
	at (:467)
	at (:683)
	at (:390)
	at (:197)
Caused by: : Could not autowire field: private  ; nested exception is : No qualifying bean of type [] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@(required=true)}
	at $(:514)
	at (:87)
	at (:285)
	... 26 more
Caused by: : No qualifying bean of type [] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@(required=true)}
	at (:988)
	at (:858)
	at (:770)
	at $(:486)
	... 28 more