개발

에러 : JavaMailSenderImpl cannot be resolved to a type

Domaya 2022. 12. 29. 10:44

javamail의 mailSender를 설정해주는 중에 에러가 났다.

root-context에도 pom에도 문제가 없어 보이는데, 자바 클래스 파일에서 import를 할 수가 없었다.

servlet-context.xml에

 

 

<context:annotation-config />

이미 등록된 bean에 대해서만 Annotation을 활성화한다.

어딘가에 bean을 등록해놓으면 @Autowired와 @Qualifier Annotation을 해석해서 가져다 쓰겠다는 의미이다.

@Autowired와 @Qualifier 두 가지만 해결한다.

따라서 위 태그를 사용하더라도 xml에 bean을 반드시 선언해야 한다.