org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'shell': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Cannot specify an availability indicator for 'cluster disconnect' more than once

GitHub | daschl | 3 years ago
  1. 0

    Allow more than one @CliAvailabilityIndicator

    GitHub | 3 years ago | daschl
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'shell': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Cannot specify an availability indicator for 'cluster disconnect' more than once
  2. 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)
  3. 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!
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    SubProtocolWebSocketHandler - No handlers

    Stack Overflow | 2 years ago
    org.springframework.web.context.ContextLoaderListener: org.springframework.context.ApplicationContextException: Failed to start bean 'subProtocolWebSocketHandler'; nested exception is java.lang.IllegalArgumentException: No handlers
  6. 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)
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

    Cannot specify an availability indicator for 'cluster disconnect' more than once

    at org.springframework.util.Assert.isTrue()
  2. Spring Core
    Assert.isTrue
    1. org.springframework.util.Assert.isTrue(Assert.java:65)
    1 frame
  3. org.springframework.shell
    JLineShellComponent.afterPropertiesSet
    1. org.springframework.shell.core.SimpleParser.add(SimpleParser.java:1037)
    2. org.springframework.shell.core.JLineShellComponent.afterPropertiesSet(JLineShellComponent.java:102)
    2 frames
  4. Spring Beans
    DefaultListableBeanFactory.preInstantiateSingletons
    1. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1514)
    2. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452)
    3. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
    4. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
    5. org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
    6. org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
    7. org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
    8. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
    9. org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:609)
    9 frames
  5. Spring Context
    AbstractApplicationContext.refresh
    1. org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918)
    2. org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:469)
    2 frames
  6. org.springframework.shell
    Bootstrap.main
    1. org.springframework.shell.Bootstrap.<init>(Bootstrap.java:93)
    2. org.springframework.shell.Bootstrap.<init>(Bootstrap.java:74)
    3. org.springframework.shell.Bootstrap.main(Bootstrap.java:58)
    3 frames