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].

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • 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}
    via by Nick Padgett,
  • 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}
    via by Nick Padgett,
  • Spring security and authentication provider
    via Stack Overflow by Pascal
    ,
  • Spring Boot | New Dave Site
    via by Unknown author,
    • 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

    Users with the same issue

    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    17 more bugmates