gpt4 book ai didi

spring-batch - 如何修复 java.lang.ClassNotFoundException : org. springframework.batch.classify.BackToBackPatternClassifier

转载 作者:行者123 更新时间:2023-12-02 21:48:04 30 4
gpt4 key购买 nike

我使用以下带有 ClassifierCompositItemWriter 的作业配置文件时收到标题中所述的错误。为什么找不到 BackToBackPatternClassifier?我对此真的很陌生。

我正在使用 - Spring核心版本3.2.2.RELEASE - Spring批量版本2.2.0.RELEASE

<bean id="domain" class="com.my.OneData" />

<job id="readAsString" xmlns="http://www.springframework.org/schema/batch">
<step id="step1">
<tasklet>
<chunk reader="theItemReader" writer="compositeWriter"
commit-interval="1" />
</tasklet>
</step>
</job>

<bean id="theItemReader" class="org.springframework.batch.item.file.FlatFileItemReader">
<property name="resource" value="file:csv/inputs/ad_usage_sample.csv" />
<property name="linesToSkip" value="1"></property>
<property name="lineMapper">
<bean
class="org.springframework.batch.item.file.mapping.PassThroughLineMapper">
</bean>
</property>
</bean>

<bean id="compositeWriter"
class="org.springframework.batch.item.support.ClassifierCompositeItemWriter">
<property name="classifier">
<bean
class="org.springframework.batch.classify.BackToBackPatternClassifier">
<property name="routerDelegate">
<bean class="com.my.LineClassifier" />
</property>
<property name="matcherMap">
<map>
<entry key="abc" value-ref="fileItemWriter1" />
<entry key="xyz" value-ref="fileItemWriter2" />
</map>
</property>
</bean>
</property>
</bean>

<bean id="fileItemWriter1" class="org.springframework.batch.item.file.FlatFileItemWriter">
<property name="resource" value="file:csv/outputs/oneLouderOutput3.csv" />
<property name="appendAllowed" value="true" />
<property name="lineAggregator">
<bean
class="org.springframework.batch.item.file.transform.DelimitedLineAggregator">
<property name="delimiter" value="," />
</bean>
</property>
</bean>

<bean id="fileItemWriter2" class="org.springframework.batch.item.file.FlatFileItemWriter">
<property name="resource" value="file:csv/outputs/oneLouderOutput3.csv" />
<property name="appendAllowed" value="true" />
<property name="lineAggregator">
<bean
class="org.springframework.batch.item.file.transform.DelimitedLineAggregator">
<property name="delimiter" value="," />
</bean>
</property>
</bean>

最佳答案

我刚刚遇到了类似的问题,发现我必须更改分类器的包

org.springframework.batch.classify.BackToBackPatternClassifier

org.springframework.classify.BackToBackPatternClassifier

即删除批处理

我也在使用spring-retry-1.0.3.RELEASE.jar

关于spring-batch - 如何修复 java.lang.ClassNotFoundException : org. springframework.batch.classify.BackToBackPatternClassifier,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19166522/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com