Closed
Description
AbstractJobRepositoryFactoryBean
provides two overloaded setters for the isolationLevelForCreate
property: one that takes a String
as a parameter, and one that takes an enum org.springframework.transaction.annotation.Isolation
. This can cause ambiguity when Spring tries to set the property in XML configuration when selecting the setter to use, and can lead to:
Caused by: org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'java.lang.String' to required type 'org.springframework.transaction.annotation.Isolation' for property 'isolationLevelForCreate'; Cannot convert value of type 'java.lang.String' to required type 'org.springframework.transaction.annotation.Isolation' for property 'isolationLevelForCreate': no matching editors or conversion strategy found
at org.springframework.beans.AbstractNestablePropertyAccessor.convertIfNecessary(AbstractNestablePropertyAccessor.java:594)
at org.springframework.beans.AbstractNestablePropertyAccessor.convertForProperty(AbstractNestablePropertyAccessor.java:608)
at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:190)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1713)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1670)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1414)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:598)
... 145 more
Caused by: java.lang.IllegalStateException: Cannot convert value of type 'java.lang.String' to required type 'org.springframework.transaction.annotation.Isolation' for property 'isolationLevelForCreate': no matching editors or conversion strategy found
at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:262)
at org.springframework.beans.AbstractNestablePropertyAccessor.convertIfNecessary(AbstractNestablePropertyAccessor.java:589)
... 151 more
The Spring recommendation for this is to use different names for setters. This issue is to rename the setter that takes the Isolation
enum as a parameter to setIsolationLevelForCreateEnum
.