question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Repository bean not found

See original GitHub issue

Hi,

I am using spring jpa 2.2.6.RELEASE and spring-data-jpa-entity-graph 2.2.8. I have added @EnableJpaRepositories(repositoryFactoryBeanClass = EntityGraphJpaRepositoryFactoryBean.class) to config class.

Repository bean is Extending EntityGraphJpaRepository<T, Integer>,EntityGraphQuerydslPredicateExecutor<T>.

I have followed all steps as mentiioned in the docs.

JPA Config. ` @Configuration @EnableJpaAuditing(auditorAwareRef = “auditorAware”) @EnableJpaRepositories(repositoryFactoryBeanClass = EntityGraphJpaRepositoryFactoryBean.class) //@EnableJpaRepositories public class JpaConfig {

        @Bean
        public AuditorAware<String> auditorAware() {
            return new AuditorImpl();
        }
        
        @Bean
        public JPAQueryFactory jpaQueryFactory(EntityManager entityManager)
        {
            return new JPAQueryFactory(entityManager);
        }
        } `

Repository:.

        `
        public interface GeneralRepository<T> extends EntityGraphJpaRepository<T, Integer>,EntityGraphQuerydslPredicateExecutor<T> {

        }
        `

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
ylcinyakupcommented, May 18, 2020

@Configuration @EnableJpaRepositories(repositoryFactoryBeanClass = EntityGraphJpaRepositoryFactoryBean.class, basePackages = {“com.dummy.app.repository”}) public class RepositoryConfig { }

0reactions
Rahul1dcommented, May 18, 2020

The basePackage was missing . Thanks @ylcinyakup .

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't Autowire @Repository annotated interface in Spring Boot
Spring test with @DataJpaTest can't autowire class with @Repository (but with interface repository works!) 4 · Could not autowire. No beans of ` ......
Read more >
Spring Boot - Fixing Autowire Bean Not found | GyanBlog
Fixing Autowire Bean not found in Spring boot, and application failed to start.
Read more >
Spring Data repository is not recognized as bean sometimes
I have a maven based SpringBoot project and I'm using Spring Data JPA. IntelliJ suddenly starts complaining of not being able to find...
Read more >
1. Working with Spring Data Repositories
The central interface in Spring Data repository abstraction is Repository (probably not that much of a surprise). It takes the the domain class...
Read more >
Autowired cant find repository bean identified with @Repository
I have a Junit test which cant load the a repository bean. The full context is as follows which may be where the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found