org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.integration.config.RouterFactoryBean#1': Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'java.util.LinkedHashMap' to required type 'java.util.Map' for property 'channelMappings'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [com.example.common.type.EventType] to required type [java.lang.String] for property 'channelMappings[CREATE]': no matching editors or conversion strategy found

Spring JIRA | Adam Pounder | 3 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    When defining a generic router in the XML using SpEL the result of the mapping value is tried to be cast into a String. It doesn't seem to be documented that router only works for String. But when the following is attempted: {code} public enum EventType { SIMPLE1, SIMPLE2, COMPLEX1, COMPLEX2, COMPLEX3 } <router input-channel="eventForProcessing" expression="payload.getEventType()" default-output-channel="simpleEventProcessing"> <mapping value="#{ T(com.example.EventType).COMPLEX1 }" channel="complexProcessingType1" /> <mapping value="#{ T(com.example.EventType).COMPLEX2 }" channel="complexProcessingType2" /> <mapping value="#{ T(com.example.EventType).COMPLEX3 }" channel="complexProcessingType3" /> </router> {code} then the context fails to initialise with errors: {code} org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.integration.config.RouterFactoryBean#1': Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'java.util.LinkedHashMap' to required type 'java.util.Map' for property 'channelMappings'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [com.example.common.type.EventType] to required type [java.lang.String] for property 'channelMappings[CREATE]': no matching editors or conversion strategy found at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:547) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:684) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:760) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482) at org.springframework.context.support.ClassPathXmlApplicationContext. (ClassPathXmlApplicationContext.java:139) at org.springframework.context.support.ClassPathXmlApplicationContext. (ClassPathXmlApplicationContext.java:105) at com.example.common.service.ConfigurableExampleService.start(ConfigurableExampleService.java:109) at com.example.service.Bootstrap. (Bootstrap.java:30) at com.example.service.Bootstrap.main(Bootstrap.java:23) Caused by: org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'java.util.LinkedHashMap' to required type 'java.util.Map' for property 'channelMappings'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [com.example.common.type.EventType] to required type [java.lang.String] for property 'channelMappings[CREATE]': no matching editors or conversion strategy found at org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:474) at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:511) at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:505) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1502) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1461) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1197) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537) ... 13 more Caused by: java.lang.IllegalStateException: Cannot convert value of type [com.example.common.type.EventType] to required type [java.lang.String] for property 'channelMappings[CREATE]': no matching editors or conversion strategy found at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:267) at org.springframework.beans.TypeConverterDelegate.convertToTypedMap(TypeConverterDelegate.java:621) at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:208) at org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:459) ... 19 more {code}

    Spring JIRA | 3 years ago | Adam Pounder
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.integration.config.RouterFactoryBean#1': Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'java.util.LinkedHashMap' to required type 'java.util.Map' for property 'channelMappings'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [com.example.common.type.EventType] to required type [java.lang.String] for property 'channelMappings[CREATE]': no matching editors or conversion strategy found
  2. 0

    When defining a generic router in the XML using SpEL the result of the mapping value is tried to be cast into a String. It doesn't seem to be documented that router only works for String. But when the following is attempted: {code} public enum EventType { SIMPLE1, SIMPLE2, COMPLEX1, COMPLEX2, COMPLEX3 } <router input-channel="eventForProcessing" expression="payload.getEventType()" default-output-channel="simpleEventProcessing"> <mapping value="#{ T(com.example.EventType).COMPLEX1 }" channel="complexProcessingType1" /> <mapping value="#{ T(com.example.EventType).COMPLEX2 }" channel="complexProcessingType2" /> <mapping value="#{ T(com.example.EventType).COMPLEX3 }" channel="complexProcessingType3" /> </router> {code} then the context fails to initialise with errors: {code} org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.integration.config.RouterFactoryBean#1': Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'java.util.LinkedHashMap' to required type 'java.util.Map' for property 'channelMappings'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [com.example.common.type.EventType] to required type [java.lang.String] for property 'channelMappings[CREATE]': no matching editors or conversion strategy found at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:547) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:684) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:760) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482) at org.springframework.context.support.ClassPathXmlApplicationContext. (ClassPathXmlApplicationContext.java:139) at org.springframework.context.support.ClassPathXmlApplicationContext. (ClassPathXmlApplicationContext.java:105) at com.example.common.service.ConfigurableExampleService.start(ConfigurableExampleService.java:109) at com.example.service.Bootstrap. (Bootstrap.java:30) at com.example.service.Bootstrap.main(Bootstrap.java:23) Caused by: org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'java.util.LinkedHashMap' to required type 'java.util.Map' for property 'channelMappings'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [com.example.common.type.EventType] to required type [java.lang.String] for property 'channelMappings[CREATE]': no matching editors or conversion strategy found at org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:474) at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:511) at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:505) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1502) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1461) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1197) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537) ... 13 more Caused by: java.lang.IllegalStateException: Cannot convert value of type [com.example.common.type.EventType] to required type [java.lang.String] for property 'channelMappings[CREATE]': no matching editors or conversion strategy found at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:267) at org.springframework.beans.TypeConverterDelegate.convertToTypedMap(TypeConverterDelegate.java:621) at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:208) at org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:459) ... 19 more {code}

    Spring JIRA | 3 years ago | Adam Pounder
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.integration.config.RouterFactoryBean#1': Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'java.util.LinkedHashMap' to required type 'java.util.Map' for property 'channelMappings'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [com.example.common.type.EventType] to required type [java.lang.String] for property 'channelMappings[CREATE]': no matching editors or conversion strategy found
  3. 0

    技術検証2日目 | 男はロマン

    otokoroman.com | 9 months ago
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'enableRedisKeyspaceNotificationsInitializer' defined in class path resource [org/springframework/session/data/redis/config/annotation/web/http/RedisHttpSessionConfiguration.class]: Invocation of init method failed; nested exception is org.springframework.data.redis.RedisConnectionFailureException: Cannot get Jedis connection; nested exception is redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Hessian Webservice with REST, Java Spring

    Stack Overflow | 4 years ago | Cid Immacula
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping#0': Initialization of bean failed; nested exception is java.lang.IllegalStateException: Ambiguous mapping found. Cannot map 'photoService' bean method public java.lang.Object mppiwebservices.photoservices.impl.photo.PhotoServicesImpl.savePhoto(javax.servlet.http.HttpServletRequest,java.lang.String,java.lang.String,mppiwebservices.photoservices.pojo.Photo,org.springframework.validation.BindingResult,org.springframework.web.bind.support.SessionStatus) to {[/{user}/{folder_name}/savephoto/],methods=[POST],params=[],headers=[],consumes=[],produces=[],custom=[]}: There is already 'photoServicesImpl' bean method public java.lang.Object mppiwebservices.photoservices.impl.photo.PhotoServicesImpl.savePhoto(javax.servlet.http.HttpServletRequest,java.lang.String,java.lang.String,mppiwebservices.photoservices.pojo.Photo,org.springframework.validation.BindingResult,org.springframework.web.bind.support.SessionStatus) mapped.
  6. 0

    Unable to create job repository with isolation level repeatable read

    Stack Overflow | 2 years ago | mpkorstanje
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jobBuilders' defined in class path resource [org/springframework/batch/core/configuration/annotation/ModularBatchConfiguration.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.batch.core.configuration.annotation.JobBuilderFactory org.springframework.batch.core.configuration.annotation.AbstractBatchConfiguration.jobBuilders() throws java.lang.Exception] threw exception; nested exception is java.lang.IllegalArgumentException: Superclass has no null constructors but no arguments were given

  1. Andreas Häber 2 times, last 2 weeks ago
  2. treefolk 1 times, last 3 weeks ago
  3. mauritius 2 times, last 2 months ago
  4. jpvee 1 times, last 2 months ago
  5. rlovtangen 1 times, last 3 months ago
23 more registered users
72 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. org.springframework.beans.factory.BeanCreationException

    Error creating bean with name 'org.springframework.integration.config.RouterFactoryBean#1': Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'java.util.LinkedHashMap' to required type 'java.util.Map' for property 'channelMappings'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [com.example.common.type.EventType] to required type [java.lang.String] for property 'channelMappings[CREATE]': no matching editors or conversion strategy found

    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean()
  2. Spring Beans
    DefaultListableBeanFactory.preInstantiateSingletons
    1. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:547)
    2. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)
    3. org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304)
    4. org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
    5. org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300)
    6. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195)
    7. org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:684)
    7 frames
  3. Spring Context
    AbstractApplicationContext.refresh
    1. org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:760)
    2. org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482)
    2 frames