java.lang.IllegalArgumentException

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.

  • When PropertyOverrideConfigurer attempts to override a property that is a bean reference, it appears to replace with a String rather than following the bean reference. I have a jar with an embedded application-context.xml that configures a default delegate for the authorizationChecker bean. In the application that uses that jar, I'd like to override that default. The base application-context.xml: ====================================== <bean id="authorizationChecker" class="authorization.AuthorizationChecker"> <property name="order" value="100"/> <property name="delegate" ref="authorizationDelegate" /> </bean> <bean id="authorizationDelegate" class="authorization.NoAccessAuthorizationDelegate"> </bean> <bean id="databaseAuthorizationDelegate" class="authorization.DatabaseAuthorizationDelegate"> <property name="dao" ref="authorizationDao" /> </bean> ==================================== The application specific application-context.xml (uses PropertyOverrideConfigurer) ==================================== <bean class='org.springframework.beans.factory.config.PropertyOverrideConfigurer'> <property name='properties'> <props> <prop key='authorizationChecker.delegate'> databaseAuthorizationDelegate </prop> </props> </property> </bean> ==================================== Trying to start the application, I run into this exception: ==================================== java.lang.IllegalArgumentException: Cannot convert value of type [java.lang.String] to required type [authorization.AuthorizationDelegate] for property 'delegate': no matching editors or conversion strategy found at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:219) at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:138) at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:386) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1287) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1248) ==================================== If I do the same thing but use a PropertyPlaceholderConfigurer and don't specify a default in the jar-enclosed definition, everything seems to work. Looking at the source, it looks like PropertyPlaceholderConfigurer uses a BeanDefinitionVisitor to resolve the runtime bean references, but the PropertyOverrideConfigurer stores the String value as a property rather than resolving it into a bean reference, even if it's originally defined as a ref.
    via by Dan Turkenkopf,
  • When PropertyOverrideConfigurer attempts to override a property that is a bean reference, it appears to replace with a String rather than following the bean reference. I have a jar with an embedded application-context.xml that configures a default delegate for the authorizationChecker bean. In the application that uses that jar, I'd like to override that default. The base application-context.xml: ====================================== <bean id="authorizationChecker" class="authorization.AuthorizationChecker"> <property name="order" value="100"/> <property name="delegate" ref="authorizationDelegate" /> </bean> <bean id="authorizationDelegate" class="authorization.NoAccessAuthorizationDelegate"> </bean> <bean id="databaseAuthorizationDelegate" class="authorization.DatabaseAuthorizationDelegate"> <property name="dao" ref="authorizationDao" /> </bean> ==================================== The application specific application-context.xml (uses PropertyOverrideConfigurer) ==================================== <bean class='org.springframework.beans.factory.config.PropertyOverrideConfigurer'> <property name='properties'> <props> <prop key='authorizationChecker.delegate'> databaseAuthorizationDelegate </prop> </props> </property> </bean> ==================================== Trying to start the application, I run into this exception: ==================================== java.lang.IllegalArgumentException: Cannot convert value of type [java.lang.String] to required type [authorization.AuthorizationDelegate] for property 'delegate': no matching editors or conversion strategy found at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:219) at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:138) at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:386) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1287) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1248) ==================================== If I do the same thing but use a PropertyPlaceholderConfigurer and don't specify a default in the jar-enclosed definition, everything seems to work. Looking at the source, it looks like PropertyPlaceholderConfigurer uses a BeanDefinitionVisitor to resolve the runtime bean references, but the PropertyOverrideConfigurer stores the String value as a property rather than resolving it into a bean reference, even if it's originally defined as a ref.
    via by Dan Turkenkopf,
  • soa-infra not starting
    via by 990182,
  • OIM 9.1 BP 13 with OIA ..Urgent
    via by user608228,
    • java.lang.IllegalArgumentException: Cannot convert value of type [java.lang.String] to required type [authorization.AuthorizationDelegate] for property 'delegate': no matching editors or conversion strategy found at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:219) at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:138) at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:386) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1287) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1248)

    Users with the same issue

    Unknown visitor2 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,