org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.integration.filter.MethodInvokingSelector#0': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.integration.filter.MethodInvokingSelector]: Constructor threw exception; nested exception is java.lang.IllegalArgumentException: Failed to find any valid Message-handling methods named 'accept' on target class [class org.springframework.integration.file.PatternMatchingFileListFilter].

Spring JIRA | Nick Padgett | 7 years ago
  1. 0

    I would like to use the {{org.springframework.integration.file.PatternMatchingFileListFilter}} class as a filter, however, the {{accept}} method is not public and results in the error below. Will you please make the accept method public? I'd like to use it like so: {code:xml} <filter method="accept"> <beans:bean class="org.springframework.integration.file.PatternMatchingFileListFilter"> <beans:constructor-arg value="^.*\\.wmv$" /> </beans:bean> </filter> {code} {noformat} org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.integration.filter.MethodInvokingSelector#0': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.integration.filter.MethodInvokingSelector]: Constructor threw exception; nested exception is java.lang.IllegalArgumentException: Failed to find any valid Message-handling methods named 'accept' on target class [class org.springframework.integration.file.PatternMatchingFileListFilter]. at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:285) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:977) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:879) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:478) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:449) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:289) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:286) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:188) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:528) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:716) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:383) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83) at com.playonsports.automator.Main.main(Main.java:14) Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.integration.filter.MethodInvokingSelector]: Constructor threw exception; nested exception is java.lang.IllegalArgumentException: Failed to find any valid Message-handling methods named 'accept' on target class [class org.springframework.integration.file.PatternMatchingFileListFilter]. at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:143) at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:104) at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:277) ... 14 more Caused by: java.lang.IllegalArgumentException: Failed to find any valid Message-handling methods named 'accept' on target class [class org.springframework.integration.file.PatternMatchingFileListFilter]. at org.springframework.util.Assert.notEmpty(Assert.java:268) at org.springframework.integration.handler.MessageMappingMethodInvoker.createResolverForMethodName(MessageMappingMethodInvoker.java:220) at org.springframework.integration.handler.MessageMappingMethodInvoker.<init>(MessageMappingMethodInvoker.java:91) at org.springframework.integration.handler.MessageMappingMethodInvoker.<init>(MessageMappingMethodInvoker.java:84) at org.springframework.integration.filter.MethodInvokingSelector.<init>(MethodInvokingSelector.java:45) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:128) ... 16 more {noformat}

    Spring JIRA | 7 years ago | Nick Padgett
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.integration.filter.MethodInvokingSelector#0': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.integration.filter.MethodInvokingSelector]: Constructor threw exception; nested exception is java.lang.IllegalArgumentException: Failed to find any valid Message-handling methods named 'accept' on target class [class org.springframework.integration.file.PatternMatchingFileListFilter].
  2. 0

    I would like to use the {{org.springframework.integration.file.PatternMatchingFileListFilter}} class as a filter, however, the {{accept}} method is not public and results in the error below. Will you please make the accept method public? I'd like to use it like so: {code:xml} <filter method="accept"> <beans:bean class="org.springframework.integration.file.PatternMatchingFileListFilter"> <beans:constructor-arg value="^.*\\.wmv$" /> </beans:bean> </filter> {code} {noformat} org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.integration.filter.MethodInvokingSelector#0': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.integration.filter.MethodInvokingSelector]: Constructor threw exception; nested exception is java.lang.IllegalArgumentException: Failed to find any valid Message-handling methods named 'accept' on target class [class org.springframework.integration.file.PatternMatchingFileListFilter]. at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:285) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:977) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:879) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:478) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:449) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:289) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:286) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:188) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:528) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:716) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:383) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83) at com.playonsports.automator.Main.main(Main.java:14) Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.integration.filter.MethodInvokingSelector]: Constructor threw exception; nested exception is java.lang.IllegalArgumentException: Failed to find any valid Message-handling methods named 'accept' on target class [class org.springframework.integration.file.PatternMatchingFileListFilter]. at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:143) at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:104) at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:277) ... 14 more Caused by: java.lang.IllegalArgumentException: Failed to find any valid Message-handling methods named 'accept' on target class [class org.springframework.integration.file.PatternMatchingFileListFilter]. at org.springframework.util.Assert.notEmpty(Assert.java:268) at org.springframework.integration.handler.MessageMappingMethodInvoker.createResolverForMethodName(MessageMappingMethodInvoker.java:220) at org.springframework.integration.handler.MessageMappingMethodInvoker.<init>(MessageMappingMethodInvoker.java:91) at org.springframework.integration.handler.MessageMappingMethodInvoker.<init>(MessageMappingMethodInvoker.java:84) at org.springframework.integration.filter.MethodInvokingSelector.<init>(MethodInvokingSelector.java:45) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:128) ... 16 more {noformat}

    Spring JIRA | 7 years ago | Nick Padgett
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.integration.filter.MethodInvokingSelector#0': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.integration.filter.MethodInvokingSelector]: Constructor threw exception; nested exception is java.lang.IllegalArgumentException: Failed to find any valid Message-handling methods named 'accept' on target class [class org.springframework.integration.file.PatternMatchingFileListFilter].
  3. 0

    Simple Login using Spring Security and Hibernate

    Stack Overflow | 4 years ago | Jayesh
    java.lang.IllegalArgumentException: No authentication providers were found in the application context
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Why does the addition of @EnableAutoConfiguration cause spring-boot to fail with "Unable to find JPA packages to scan"

    Stack Overflow | 3 years ago | KapudanPasha
    java.lang.IllegalArgumentException: Unable to find JPA packages to scan, please define a @ComponentScan annotation or disable JpaAutoConfiguration
  6. 0

    Spring security and authentication provider

    Stack Overflow | 7 years ago | Pascal
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name '_methodSecurityInterceptor': Cannot resolve reference to bean '_authenticationManager' while setting bean property 'authenticationManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '_authenticationManager': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: No authentication providers were found in the application context

    15 unregistered visitors
    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

      Failed to find any valid Message-handling methods named 'accept' on target class [class org.springframework.integration.file.PatternMatchingFileListFilter].

      at org.springframework.util.Assert.notEmpty()
    2. Spring Core
      Assert.notEmpty
      1. org.springframework.util.Assert.notEmpty(Assert.java:268)
      1 frame
    3. Spring Integration Core
      MethodInvokingSelector.<init>
      1. org.springframework.integration.handler.MessageMappingMethodInvoker.createResolverForMethodName(MessageMappingMethodInvoker.java:220)
      2. org.springframework.integration.handler.MessageMappingMethodInvoker.<init>(MessageMappingMethodInvoker.java:91)
      3. org.springframework.integration.handler.MessageMappingMethodInvoker.<init>(MessageMappingMethodInvoker.java:84)
      4. org.springframework.integration.filter.MethodInvokingSelector.<init>(MethodInvokingSelector.java:45)
      4 frames
    4. Java RT
      Constructor.newInstance
      1. sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      2. sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
      3. sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
      4. java.lang.reflect.Constructor.newInstance(Unknown Source)
      4 frames
    5. Spring Beans
      DefaultListableBeanFactory.preInstantiateSingletons
      1. org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:128)
      2. org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:104)
      3. org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:277)
      4. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:977)
      5. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:879)
      6. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:478)
      7. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:449)
      8. org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:289)
      9. org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
      10. org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:286)
      11. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:188)
      12. org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:528)
      12 frames
    6. Spring Context
      ClassPathXmlApplicationContext.<init>
      1. org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:716)
      2. org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:383)
      3. org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
      4. org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83)
      4 frames
    7. com.playonsports.automator
      Main.main
      1. com.playonsports.automator.Main.main(Main.java:14)
      1 frame