본문 바로가기

WEB BANK-END/SPRING

[Spring] SessionFactory NullPointerException

stackoverflow.com/questions/27971114/the-hibernate-sessionfactory-is-always-null-when-using-spring-dependency-injecti

 

The Hibernate SessionFactory is always null when using Spring dependency injection

I am getting a NullpointerException on my save method in CityDaoImpl. Seems that sessionFactory is not autowired since on debugging it was revealed that sessionFactory is never injected in CityDaoI...

stackoverflow.com

위의 방법도 있지만 나는 controller에서 autoweird(new 대신)객체 선언를 안해서 그렇다.