[Spring] Environment 객체 이용시 Spring Bean 생성이 안되는 이슈

[Spring] Environment 객체 이용시 Spring Bean 생성이 안되는 이슈

Exception in thread "main" org.springframework.beans.factory.BeanCreationException:

Error creating bean with name 'adminConnection' defined in class path resource [applicationContext.xml]:

Invocation of init method failed; nested exception is java.lang.NullPointerException

자바파일 생성시 인터페이스 추가로 EnvironmentAware 추가시, 변수명이 자동적으로 environment로 정해진다.

setEnv의 변수명과 자동생성변수명이 달라서 생긴 에러

수정하니 잘 됩니다

불러오는 중입니다...

from http://devsurimlee.tistory.com/8 by ccl(S) rewrite - 2020-03-07 03:55:47

댓글

이 블로그의 인기 게시물

데이터 바인딩 추상화 - propertyEditor

[sts] spring boot groovy 적용 실행 하기

2020 LCK 롤챔스 Spring 경기 재개 및 일정