Parameter 0 of constructor in required a bean of type 'java.lang.String' that could not be found

前端 未结 10 2455
深忆病人
深忆病人 2021-02-07 01:41

I am working on spring batch with spring boot 2.X application, actually its existing code i am checked out from git. While running the application it fails due to below error on

10条回答
  •  盖世英雄少女心
    2021-02-07 01:59

    Since you do not provide the public default constructor and you added your own non-default constructor the instantiation will fail. I would suggest you to define the input file path as property like @Value("${inputFilePath}"). If you need further initialization in your bean define a void method and annotate it with @PostConstruct and do the initialization within.

提交回复
热议问题