Spring Framework Autowired Null Pointer Exception

前端 未结 3 1887
既然无缘
既然无缘 2021-01-24 23:42

I\'m learning Spring and I\'m having some problems trying to set up a relatively basic Spring project. I\'m creating an application to simply read from a database, but I\'m havi

3条回答
  •  天命终不由人
    2021-01-25 00:14

    Problem is with below line

    GetCustomerEvent ev = new GetCustomerEvent();
    

    You manually created instance using "new". Spring does not have idea about this object. See Why is my Spring @Autowired field null? for details.

提交回复
热议问题