Spring
[Spring] Environment 객체 이용시 Spring Bean 생성이 안되는 이슈
개발자BURI
2019. 11. 19. 12:52
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의 변수명과 자동생성변수명이 달라서 생긴 에러
수정하니 잘 됩니다