[Spring] org.springframework.beans.factory.BeanCreationException 에러

eunoia73·2024년 4월 24일

trouble shooting

목록 보기
1/16

org.springframework.beans.factory.BeanCreationException

❗️ 에러문구

  • org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'joinService' defined in file [/Users/sookyung/Dev/ide/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/110_Join_04/WEB-INF/classes/context-root.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'emailUtil' of bean class [com.portfolio.www.service.JoinService]: Bean property 'emailUtil' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?

💡 에러 해결 방법

  • context-root.xml에 mailUtil 수동 빈 등록 다 하고 나서 JoinService에 setter로 추가 안 해줘서 에러 발생.

  • JoinService에 mailUtil setter 추가했더니 에러 해결!

private EmailUtil emailUtil;
	public void setEmailUtil(EmailUtil emailUtil) {
		this.emailUtil = emailUtil;
	}

0개의 댓글