I am working on a Spring Boot application v1.4.2.RELEASE with JPA.
I defined interfaces and repository implementations
ARepository
@Repository public interface ARepository extends CrudRepository<A, String>, ARepositoryCustom, JpaSpecificationExecutor<A> { }
ARepositoryCustom
@Repository public interface ARepositoryCustom { Page<A> findA(findAForm form, Pageable pageable); }
ARepositoryImpl
@Repository public class ARepositoryImpl implements ARepositoryCustom { @Autowired private ARepository aRepository; @Override public Page<A> findA(findAForm form, Pageable pageable) { return aRepository.findAll( where(ASpecs.codeLike(form.getCode())) .and(ASpecs.labelLike(form.getLabel())) .and(ASpecs.isActive()), pageable); } }
And service AServiceImpl
@Service public class AServiceImpl implements AService { private ARepository aRepository; public AServiceImpl(ARepository aRepository) { super(); this.aRepository = aRepository; } ... }
My application will not start with a message:
****************************
APPLICATION FAILED TO START
****************************
Description:
The dependencies of some of the beans in the application context form a cycle:
| aRepositoryImpl
└─────┘
I followed all the steps described in http://docs.spring.io/spring-data/jpa/docs/current/reference/html/#repositories.single-repository-behaviour
Please, help!
Laurent
source share