java.lang.IllegalArgumentException: Paging query needs to have a Pageable parameter! Offending method public abstract org.springframework.data.elasticsearch.core.FacetedPage pl.bpo.archiwumallegro.repositories.AuctionIndexRepository.search(org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'auctionIndexRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Paging query needs to have a Pageable parameter! Offending method public abstract org.springframework.data.elasticsearch.core.FacetedPage pl.bpo.archiwumallegro.repositories.AuctionIndexRepository.search(org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder)

Stack Overflow | rad11 | 4 months ago
  1. 0

    Spring boot creating beans error

    Stack Overflow | 4 months ago | rad11
    java.lang.IllegalArgumentException: Paging query needs to have a Pageable parameter! Offending method public abstract org.springframework.data.elasticsearch.core.FacetedPage pl.bpo.archiwumallegro.repositories.AuctionIndexRepository.search(org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'auctionIndexRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Paging query needs to have a Pageable parameter! Offending method public abstract org.springframework.data.elasticsearch.core.FacetedPage pl.bpo.archiwumallegro.repositories.AuctionIndexRepository.search(org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder)
  2. 0

    Given the following method signature {code}@Override public Page<SolrMediaEntity> findMediaByFilter(String type, PageRequest pageRequest); {code} I receive the following error: {code}Caused by: java.lang.IllegalArgumentException: Paging query needs to have a Pageable parameter! Offending method public abstract org.springframework.data.domain.Page <package>.ICustomSolrMediaRepository.findMediaByFilter(java.lang.String,org.springframework.data.domain.PageRequest) at org.springframework.util.Assert.isTrue(Assert.java:65) at org.springframework.data.repository.query.QueryMethod.<init>(QueryMethod.java:84) {code} Debugging into class Parameters suggests the cause may be due to this line: {code} this.pageableIndex = types.indexOf(Pageable.class); {code} one of the parameter types is {{org.springframework.data.domain.PageRequest}}, which implements Pageable, but since indexOf will not match on PageRequest, property {{pageableIndex}} becomes -1 which causes o.s.d.r.q.Parameters#hasPageableParameter to return false in the constructor of QueryMethod: {code} Assert.isTrue(this.parameters.hasPageableParameter(), ... {code} and triggers the exception. I would expect iterating the parameter types and checking for {{Pageable.class.isAssignableFrom(parameterType)}} might be required. But maybe I am missing something?

    Spring JIRA | 6 months ago | David Rekowski
    java.lang.IllegalArgumentException: Paging query needs to have a Pageable parameter! Offending method public abstract org.springframework.data.domain.Page <package>.ICustomSolrMediaRepository.findMediaByFilter(java.lang.String,org.springframework.data.domain.PageRequest)
  3. 0

    Given the following method signature {code}@Override public Page<SolrMediaEntity> findMediaByFilter(String type, PageRequest pageRequest); {code} I receive the following error: {code}Caused by: java.lang.IllegalArgumentException: Paging query needs to have a Pageable parameter! Offending method public abstract org.springframework.data.domain.Page <package>.ICustomSolrMediaRepository.findMediaByFilter(java.lang.String,org.springframework.data.domain.PageRequest) at org.springframework.util.Assert.isTrue(Assert.java:65) at org.springframework.data.repository.query.QueryMethod.<init>(QueryMethod.java:84) {code} Debugging into class Parameters suggests the cause may be due to this line: {code} this.pageableIndex = types.indexOf(Pageable.class); {code} one of the parameter types is {{org.springframework.data.domain.PageRequest}}, which implements Pageable, but since indexOf will not match on PageRequest, property {{pageableIndex}} becomes -1 which causes o.s.d.r.q.Parameters#hasPageableParameter to return false in the constructor of QueryMethod: {code} Assert.isTrue(this.parameters.hasPageableParameter(), ... {code} and triggers the exception. I would expect iterating the parameter types and checking for {{Pageable.class.isAssignableFrom(parameterType)}} might be required. But maybe I am missing something?

    Spring JIRA | 6 months ago | David Rekowski
    java.lang.IllegalArgumentException: Paging query needs to have a Pageable parameter! Offending method public abstract org.springframework.data.domain.Page <package>.ICustomSolrMediaRepository.findMediaByFilter(java.lang.String,org.springframework.data.domain.PageRequest)
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Application startup failed with org.hibernate:hibernate-search-orm.XYZ on class path

    GitHub | 2 years ago | dirkrathje
    java.lang.IllegalArgumentException: @ConditionalOnMissingBean annotations must specify at least one bean (type, name or annotation)
  6. 0

    Issue of pagination in Spring Data JPA

    Stack Overflow | 5 years ago | Tom
    java.lang.IllegalArgumentException: Paging query needs to have a Pageable parameter!
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.lang.IllegalArgumentException

    Paging query needs to have a Pageable parameter! Offending method public abstract org.springframework.data.elasticsearch.core.FacetedPage pl.bpo.archiwumallegro.repositories.AuctionIndexRepository.search(org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder)

    at org.springframework.util.Assert.isTrue()
  2. Spring Core
    Assert.isTrue
    1. org.springframework.util.Assert.isTrue(Assert.java:65)
    1 frame
  3. Spring Data Core
    QueryMethod.<init>
    1. org.springframework.data.repository.query.QueryMethod.<init>(QueryMethod.java:89)
    1 frame
  4. Spring Data Elasticsearch
    ElasticsearchRepositoryFactory$ElasticsearchQueryLookupStrategy.resolveQuery
    1. org.springframework.data.elasticsearch.repository.query.ElasticsearchQueryMethod.<init>(ElasticsearchQueryMethod.java:37)
    2. org.springframework.data.elasticsearch.repository.support.ElasticsearchRepositoryFactory$ElasticsearchQueryLookupStrategy.resolveQuery(ElasticsearchRepositoryFactory.java:97)
    2 frames
  5. Spring Data Core
    RepositoryFactoryBeanSupport.afterPropertiesSet
    1. org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.<init>(RepositoryFactorySupport.java:408)
    2. org.springframework.data.repository.core.support.RepositoryFactorySupport.getRepository(RepositoryFactorySupport.java:206)
    3. org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.initAndReturn(RepositoryFactoryBeanSupport.java:251)
    4. org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.afterPropertiesSet(RepositoryFactoryBeanSupport.java:237)
    4 frames
  6. Spring Data Elasticsearch
    ElasticsearchRepositoryFactoryBean.afterPropertiesSet
    1. org.springframework.data.elasticsearch.repository.support.ElasticsearchRepositoryFactoryBean.afterPropertiesSet(ElasticsearchRepositoryFactoryBean.java:55)
    1 frame
  7. Spring Beans
    DefaultListableBeanFactory.preInstantiateSingletons
    1. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1633)
    2. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1570)
    3. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
    4. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
    5. org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
    6. org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
    7. org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
    8. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
    9. org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1120)
    10. org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1044)
    11. org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:942)
    12. org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:813)
    13. org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:741)
    14. org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:185)
    15. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1139)
    16. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1042)
    17. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504)
    18. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
    19. org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
    20. org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
    21. org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
    22. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
    23. org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1120)
    24. org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1044)
    25. org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:942)
    26. org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:813)
    27. org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:741)
    28. org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:185)
    29. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1139)
    30. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1042)
    31. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504)
    32. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
    33. org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
    34. org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
    35. org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
    36. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
    37. org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:755)
    37 frames
  8. Spring Context
    AbstractApplicationContext.refresh
    1. org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757)
    2. org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)
    2 frames
  9. Spring Boot
    SpringApplication.run
    1. org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118)
    2. org.springframework.boot.SpringApplication.refresh(SpringApplication.java:687)
    3. org.springframework.boot.SpringApplication.run(SpringApplication.java:321)
    4. org.springframework.boot.SpringApplication.run(SpringApplication.java:967)
    5. org.springframework.boot.SpringApplication.run(SpringApplication.java:956)
    5 frames
  10. pl.bpo.archiwumallegro
    ArchiwumAllegro.main
    1. pl.bpo.archiwumallegro.ArchiwumAllegro.main(ArchiwumAllegro.java:15)
    1 frame