猿问

JavaMailSender 自动注入 显示错误!

Error creating bean with name 'testController': Unsatisfied dependency expressed through field 'mailSender'; nested exception is org.springframework.beans.factory.

NoSuchBeanDefinitionException: No qualifying bean of type 'org.springframework.mail.javamail.JavaMailSender' available: expected at least 1 bean which qualifies as autowire candidate. 

Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}


一加上

@Autowired

JavaMailSender mailSender 

就会报错...

真傻
浏览 13390回答 3
3回答
随时随地看视频慕课网APP

相关分类

Java
我要回答