org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'customEditorConfigurer' defined in file [....xml]: Initialization of bean failed; nested exception is org.springframework.core.convert.ConversionFailedException: Unable to convert value {org.springframework.batch.item.file.transform.Range[]=class org.springframework.batch.item.file.transform.RangeArrayPropertyEditor} from type 'java.util.LinkedHashMap' to type 'java.util.Map'; nested exception is java.lang.IllegalArgumentException: Left-hand side type must not be null

Spring JIRA | Dave Syer | 7 years ago
  1. 0

    ConversionService fails with CustomEditorConfigurer. While it is not recommended to mix the two in the same context it is unavoidable if users want to use Spring Batch and a ConversionService (because Batch is 2.5.6 compatible and installs its own converter). So if you install a CustomEditorConfigurer like this {code} <bean id="customEditorConfigurer" class="org.springframework.beans.factory.config.CustomEditorConfigurer"> <property name="customEditors"> <map key-type="java.lang.String" value-type="java.lang.Class"> <entry key="org.springframework.batch.item.file.transform.Range[]" value="org.springframework.batch.item.file.transform.RangeArrayPropertyEditor"/> </map> </property> </bean> {code} and then a ConversionService using the factory bean, you get an exception on startup saying that the ConversionService cannot convert the map in the CustomEditorConfigurer: {noformat}Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'customEditorConfigurer' defined in file [....xml]: Initialization of bean failed; nested exception is org.springframework.core.convert.ConversionFailedException: Unable to convert value {org.springframework.batch.item.file.transform.Range[]=class org.springframework.batch.item.file.transform.RangeArrayPropertyEditor} from type 'java.util.LinkedHashMap' to type 'java.util.Map'; nested exception is java.lang.IllegalArgumentException: Left-hand side type must not be null at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1008) at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:604) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:398) at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:84) at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:1) at org.springframework.test.context.TestContext.loadApplicationContext(TestContext.java:280) at org.springframework.test.context.TestContext.getApplicationContext(TestContext.java:304) ... 24 more Caused by: org.springframework.core.convert.ConversionFailedException: Unable to convert value {org.springframework.batch.item.file.transform.Range[]=class org.springframework.batch.item.file.transform.RangeArrayPropertyEditor} from type 'java.util.LinkedHashMap' to type 'java.util.Map'; nested exception is java.lang.IllegalArgumentException: Left-hand side type must not be null at org.springframework.core.convert.support.ConversionUtils.invokeConverter(ConversionUtils.java:40) at org.springframework.core.convert.support.GenericConversionService.convert(GenericConversionService.java:135) at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:199) at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:154) at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:452) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1351) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1310) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1067) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:511) ... 36 more Caused by: java.lang.IllegalArgumentException: Left-hand side type must not be null at org.springframework.util.Assert.notNull(Assert.java:112) at org.springframework.util.ClassUtils.isAssignable(ClassUtils.java:806) at org.springframework.core.convert.TypeDescriptor.isTypeAssignableTo(TypeDescriptor.java:459) at org.springframework.core.convert.TypeDescriptor.isAssignableTo(TypeDescriptor.java:373) at org.springframework.core.convert.support.MapToMapConverter.convert(MapToMapConverter.java:81) at org.springframework.core.convert.support.ConversionUtils.invokeConverter(ConversionUtils.java:37) ... 44 more {noformat}

    Spring JIRA | 7 years ago | Dave Syer
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'customEditorConfigurer' defined in file [....xml]: Initialization of bean failed; nested exception is org.springframework.core.convert.ConversionFailedException: Unable to convert value {org.springframework.batch.item.file.transform.Range[]=class org.springframework.batch.item.file.transform.RangeArrayPropertyEditor} from type 'java.util.LinkedHashMap' to type 'java.util.Map'; nested exception is java.lang.IllegalArgumentException: Left-hand side type must not be null
  2. 0

    ConversionService fails with CustomEditorConfigurer. While it is not recommended to mix the two in the same context it is unavoidable if users want to use Spring Batch and a ConversionService (because Batch is 2.5.6 compatible and installs its own converter). So if you install a CustomEditorConfigurer like this {code} <bean id="customEditorConfigurer" class="org.springframework.beans.factory.config.CustomEditorConfigurer"> <property name="customEditors"> <map key-type="java.lang.String" value-type="java.lang.Class"> <entry key="org.springframework.batch.item.file.transform.Range[]" value="org.springframework.batch.item.file.transform.RangeArrayPropertyEditor"/> </map> </property> </bean> {code} and then a ConversionService using the factory bean, you get an exception on startup saying that the ConversionService cannot convert the map in the CustomEditorConfigurer: {noformat}Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'customEditorConfigurer' defined in file [....xml]: Initialization of bean failed; nested exception is org.springframework.core.convert.ConversionFailedException: Unable to convert value {org.springframework.batch.item.file.transform.Range[]=class org.springframework.batch.item.file.transform.RangeArrayPropertyEditor} from type 'java.util.LinkedHashMap' to type 'java.util.Map'; nested exception is java.lang.IllegalArgumentException: Left-hand side type must not be null at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1008) at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:604) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:398) at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:84) at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:1) at org.springframework.test.context.TestContext.loadApplicationContext(TestContext.java:280) at org.springframework.test.context.TestContext.getApplicationContext(TestContext.java:304) ... 24 more Caused by: org.springframework.core.convert.ConversionFailedException: Unable to convert value {org.springframework.batch.item.file.transform.Range[]=class org.springframework.batch.item.file.transform.RangeArrayPropertyEditor} from type 'java.util.LinkedHashMap' to type 'java.util.Map'; nested exception is java.lang.IllegalArgumentException: Left-hand side type must not be null at org.springframework.core.convert.support.ConversionUtils.invokeConverter(ConversionUtils.java:40) at org.springframework.core.convert.support.GenericConversionService.convert(GenericConversionService.java:135) at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:199) at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:154) at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:452) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1351) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1310) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1067) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:511) ... 36 more Caused by: java.lang.IllegalArgumentException: Left-hand side type must not be null at org.springframework.util.Assert.notNull(Assert.java:112) at org.springframework.util.ClassUtils.isAssignable(ClassUtils.java:806) at org.springframework.core.convert.TypeDescriptor.isTypeAssignableTo(TypeDescriptor.java:459) at org.springframework.core.convert.TypeDescriptor.isAssignableTo(TypeDescriptor.java:373) at org.springframework.core.convert.support.MapToMapConverter.convert(MapToMapConverter.java:81) at org.springframework.core.convert.support.ConversionUtils.invokeConverter(ConversionUtils.java:37) ... 44 more {noformat}

    Spring JIRA | 7 years ago | Dave Syer
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'customEditorConfigurer' defined in file [....xml]: Initialization of bean failed; nested exception is org.springframework.core.convert.ConversionFailedException: Unable to convert value {org.springframework.batch.item.file.transform.Range[]=class org.springframework.batch.item.file.transform.RangeArrayPropertyEditor} from type 'java.util.LinkedHashMap' to type 'java.util.Map'; nested exception is java.lang.IllegalArgumentException: Left-hand side type must not be null
  3. 0

    Spring Cache Abstraction & custom converter

    Stack Overflow | 3 years ago | user2652217
    org.springframework.expression.AccessException: Problem invoking method: public java.lang.String java.lang.String.concat(java.lang.String)
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    DynamicSpecifications 对时间类型的字符串的解析

    GitHub | 4 years ago | boliza
    org.springframework.core.convert.ConversionFailedException: Failed to convert from type java.lang.String to type java.util.Date for value '2012-11-23 00:00:00'; nested exception is java.lang.IllegalArgumentException
  6. 0

    springframework mongoDb ConversionFailedException

    Stack Overflow | 2 years ago
    org.springframework.core.convert.ConversionFailedException: Failed to convert from type null to type long for value 'null'; nested exception is java.lang.IllegalArgumentException: A null value cannot be assigned to a primitive type

  1. Malcshour 1 times, last 5 months ago
1 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

    Left-hand side type must not be null

    at org.springframework.util.Assert.notNull()
  2. Spring Core
    GenericConversionService.convert
    1. org.springframework.util.Assert.notNull(Assert.java:112)
    2. org.springframework.util.ClassUtils.isAssignable(ClassUtils.java:806)
    3. org.springframework.core.convert.TypeDescriptor.isTypeAssignableTo(TypeDescriptor.java:459)
    4. org.springframework.core.convert.TypeDescriptor.isAssignableTo(TypeDescriptor.java:373)
    5. org.springframework.core.convert.support.MapToMapConverter.convert(MapToMapConverter.java:81)
    6. org.springframework.core.convert.support.ConversionUtils.invokeConverter(ConversionUtils.java:37)
    7. org.springframework.core.convert.support.ConversionUtils.invokeConverter(ConversionUtils.java:40)
    8. org.springframework.core.convert.support.GenericConversionService.convert(GenericConversionService.java:135)
    8 frames
  3. Spring Beans
    AbstractBeanFactory.getBean
    1. org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:199)
    2. org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:154)
    3. org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:452)
    4. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1351)
    5. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1310)
    6. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1067)
    7. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:511)
    8. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
    9. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
    10. org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
    11. org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
    12. org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)
    13. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
    13 frames
  4. Spring Context
    AbstractApplicationContext.refresh
    1. org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1008)
    2. org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:604)
    3. org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:398)
    3 frames
  5. Spring TestContext
    TestContext.getApplicationContext
    1. org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:84)
    2. org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:1)
    3. org.springframework.test.context.TestContext.loadApplicationContext(TestContext.java:280)
    4. org.springframework.test.context.TestContext.getApplicationContext(TestContext.java:304)
    4 frames