0

IBM の JRE 1.7 でスプリング バッチ ジョブを起動すると、エラーが発生します。

Spring Batch のバージョンは 3.0.7、Spring のバージョンは 4.3.5

このエラーは、Oracle JDK 1.7 では発生しません。ジョブが開始される前に、Spring Batch XML 構成、jobs-configuration.xml をロードすると表示されます。この問題は、Spring Batch と Spring をアップグレードした後に発生しました: Spring Batch の org.springframework.batch.classify.BackToBackPatternClassifier は org.springframework.classify.BackToBackPatternClassifier になりました (Spring Retry で)

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'classifierCcsb01Writer' defined in class path resource [com/bob/batch/spring/configuration/jobs-configuration.xml]: Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:
PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'routerDelegate' threw exception; nested exception is java.lang.IllegalStateException: More than one non-void public method detected with single argument.
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1523)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1231)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:551)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:351)
    ... 26 more
Caused by: org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:
PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'routerDelegate' threw exception; nested exception is java.lang.IllegalStateException: More than one non-void public method detected with single argument.
    at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:121)
    at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:75)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1519)

ジョブ構成.xml:

<bean id="ItemWriter"
        class="org.springframework.batch.item.support.ClassifierCompositeItemWriter">
        <property name="classifier" ref="classifierCcsb01Writer" />
    </bean>

    <bean id="classifierCcsb01Writer"
        class="org.springframework.classify.BackToBackPatternClassifier">
        <property name="routerDelegate">
            <bean
                class="com.bob.batch.spring.writers.ClassifierCcsb01Writer" />
        </property>
        <property name="matcherMap">
            <map>
                <entry key="create" value-ref="ccsb01Writer" />
                <entry key="ko" value-ref="ccsb01ErrorWriter" />
            </map>
        </property>
    </bean>

ClassifierCcsb01Writer:

package com.bob.batch.spring.writers;

import org.springframework.batch.support.annotation.Classifier;

import com.bob.batch.spring.bean.RoutingBean;

public class ClassifierCcsb01Writer {

    @Classifier
    public String classify(RoutingBean routingBean) {
        return routingBean.getType();
    }

}
4

1 に答える 1