0

I am getting the following error:

APPLICATION FAILED TO START
***************************

Description:

Parameter 0 of constructor in mn.ailab.bankcg.cashout.service.bankservice.BankSelector required a bean of type 'mn.ailab.bankcg.cashout.service.bankservice.CgwBankRepository' that could not be found.


Action:

Consider defining a bean of type 'mn.ailab.bankcg.cashout.service.bankservice.CgwBankRepository' in your configuration.

My project structure: Project Structure

I have configured base packages:

@ComponentScan(basePackages = {"mn.ailab", "mn.invescore.ailab"})
@EnableJpaRepositories(basePackages = {"mn.ailab", "mn.invescore.ailab"})
@EntityScan(basePackages = {"mn.ailab", "mn.invescore.ailab"})
@SpringBootApplication
@EnableCaching
@EnableScheduling
public class AccountingApplication {

    public static void main(String[] args) {
        SpringApplication.run(AccountingApplication.class, args);
    }

}

CgwBankRepository.java


import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
interface CgwBankRepository extends CrudRepository<CgwBank, String> {

    List<CgwBank> findAllBy();
}

I have changed base package different ways. But still get same error.

  • Is the interface not public?@Repository seems redundant. – HUTUTU Feb 10 '22 at 09:38
  • Does this answer your question? [Consider defining a bean of type 'package' in your configuration \[Spring-Boot\]](https://stackoverflow.com/questions/40384056/consider-defining-a-bean-of-type-package-in-your-configuration-spring-boot) – pringi Feb 10 '22 at 11:17

0 Answers0