강의

멘토링

커뮤니티

Inflearn Community Q&A

n2tjrgns9682's profile image
n2tjrgns9682

asked

Developing Spring and JPA based web applications

Sign-up submission processing

autoController에 Javamailsender 의존성 추가 에러

Written on

·

3.4K

4

@Controller
@RequiredArgsConstructor
public class AccountController {

private final SignUpFormValidator signUpFormValidator;
private final AccountRepository accountRepository;
private final JavaMailSender javaMailSender;

의존성을 추가해줬는데

왜 해당 컨트롤러 클래스에서 javaMailSend를 찾지못하는지 이류를 모르겠습니다.

@Component가 빠진부분도 없어서 빈 등록은 제대로 해주었는데 무엇이 문제일까요

WARN 6760 --- [  restartedMain] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'accountController' defined in file [/Users/seokhun/IdeaProjects/jpastudywebapp/build/classes/java/main/com/jpa/studywebapp/account/AccountController.class]: Unsatisfied dependency expressed through constructor parameter 2; 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: {}

Description:

Parameter 2 of constructor in com.jpa.studywebapp.account.AccountController required a bean of type 'org.springframework.mail.javamail.JavaMailSender' that could not be found.

Action:

Consider defining a bean of type 'org.springframework.mail.javamail.JavaMailSender' in your configuration.

thymeleafspring-bootspringjavaJPA

Answer 1

3

n2tjrgns9682님의 프로필 이미지
n2tjrgns9682
Questioner

해결하였습니다.

아무래도 값을 제대로 읽지 못해온것같아서 확인해보니

properties 파일의 local 설정을 yml로 바꾸다가 제대로 해주지 못했네요.

초보적인 실수였습니다.

n2tjrgns9682's profile image
n2tjrgns9682

asked

Ask a question