Announcement Announcement Module
Collapse
No announcement yet.
Problem with Double type parameters Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problem with Double type parameters

    Hello,

    I'am having problems using Double type parameters in late binding, using it as part of a String.

    Code:
    <beans:bean id="testTasklet" class="test.Testsklet" 
    		scope="step">
    		<beans:property name="concString" value="Test value: string: #{jobParameters[pString]}, double: #{jobParameters[pDouble]}"/>
    	</beans:bean>
    The stacktrace looks like:
    Code:
    10:58:40,952 ERROR main AbstractStep:213 - Encountered an error executing the step
    java.lang.IllegalStateException: Cannot bind to partial key 
    Test value: string: #{jobParameters[pString]}, double: #{jobParameters[pDouble]}
    	at org.springframework.batch.core.scope.util.PlaceholderTargetSource$PlaceholderStringValueResolver.replacePlaceholders(PlaceholderTargetSource.java:436)
    	at org.springframework.batch.core.scope.util.PlaceholderTargetSource$PlaceholderStringValueResolver.resolveStringValue(PlaceholderTargetSource.java:405)
    	at org.springframework.beans.factory.config.BeanDefinitionVisitor.resolveStringValue(BeanDefinitionVisitor.java:265)
    	at org.springframework.batch.core.scope.util.PlaceholderTargetSource$PlaceholderBeanDefinitionVisitor.resolveValue(PlaceholderTargetSource.java:334)
    	at org.springframework.beans.factory.config.BeanDefinitionVisitor.visitPropertyValues(BeanDefinitionVisitor.java:142)
    	at org.springframework.beans.factory.config.BeanDefinitionVisitor.visitBeanDefinition(BeanDefinitionVisitor.java:82)
    	at org.springframework.batch.core.scope.util.PlaceholderTargetSource.getTarget(PlaceholderTargetSource.java:184)
    	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:184)
    Digging in the class org.springframework.batch.core.scope.util.Placehol derTargetSource$PlaceholderStringValueResolver I've noticed that this class don't check for java.lang.Double params

    Code:
    Line 430:
    boolean replaced = replaceIfTypeMatches(result, first, next, key, String.class, typeConverter);
    				replaced |= replaceIfTypeMatches(result, first, next, key, Long.class, typeConverter);
    				replaced |= replaceIfTypeMatches(result, first, next, key, Integer.class, typeConverter);
    				replaced |= replaceIfTypeMatches(result, first, next, key, Date.class, typeConverter);
    Maybe we need to add something like
    Code:
    replaced |= replaceIfTypeMatches(result, first, next, key, Double.class, typeConverter);
    I will need some help here. I don't know how workaround this problem.

    Thank you very much.
Working...
X