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

前端 未结 10 2460
深忆病人
深忆病人 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

    I was facing the same issue and it got fixed by removing Constructors from my Model class. Adding sample snippet below:

    Map serviceDefinitionMapper = new HashMap<>();
        A def;
        B serviceCharacter;
    
        @Autowired
        public Scan(Map serviceDefinitionMapper, A def,
                B serviceCharacter) {
            super();
            this.serviceDefinitionMapper = serviceDefinitionMapper;
            this.def = def;
            this.serviceCharacter = serviceCharacter;
        }
    

    Please Note: Do not keep any Constructor/@AllArgsConstructor in your Model class unless it is very much needed to be decalred.

提交回复
热议问题