我正在使用Springframwork 4.0.6和Spring-Batch 3.0.1,并且在Spring-Batch-Admin(版本1.3.0)中执行作业时得到了一个奇怪的NoSuchMethodError
。我认为这可能是版本问题:
2014-09-04 15:57:03.664 ERROR 7780 --- [rTaskExecutor-3] o.s.batch.core.step.AbstractStep : Encountered an error executing step step1 in job i18n.region.names
java.lang.NoSuchMethodError: org.springframework.classify.BinaryExceptionClassifier.classify(Ljava/lang/Throwable;)Ljava/lang/Boolean;
at org.springframework.batch.core.step.item.SimpleRetryExceptionHandler.handleException(SimpleRetryExceptionHandler.java:81)
at org.springframework.batch.repeat.support.RepeatTemplate.doHandle(RepeatTemplate.java:294)
at org.springframework.batch.repeat.support.RepeatTemplate.executeInternal(RepeatTemplate.java:220)
at org.springframework.batch.repeat.support.RepeatTemplate.iterate(RepeatTemplate.java:144)
at org.springframework.batch.core.step.tasklet.TaskletStep.doExecute(TaskletStep.java:257)
at org.springframework.batch.core.step.AbstractStep.execute(AbstractStep.java:198)
at org.springframework.batch.core.job.SimpleStepHandler.handleStep(SimpleStepHandler.java:148)
at org.springframework.batch.core.job.flow.JobFlowExecutor.executeStep(JobFlowExecutor.java:64)
at org.springframework.batch.core.job.flow.support.state.StepState.handle(StepState.java:67)
at org.springframework.batch.core.job.flow.support.SimpleFlow.resume(SimpleFlow.java:162)
at org.springframework.batch.core.job.flow.support.SimpleFlow.start(SimpleFlow.java:141)
at org.springframework.batch.core.job.flow.FlowJob.doExecute(FlowJob.java:134)
at org.springframework.batch.core.job.AbstractJob.execute(AbstractJob.java:304)
at org.springframework.batch.core.launch.support.SimpleJobLauncher$1.run(SimpleJobLauncher.java:135)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
这是我的工作定义。以防万一。
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:batch="http://www.springframework.org/schema/batch"
xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/batch http://www.springframework.org/schema/batch/spring-batch.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<!-- abstract job -->
<batch:job id="abstractJob" abstract="true">
<batch:listeners>
<batch:listener ref="simpleJobExecutionListener" />
</batch:listeners>
</batch:job>
<!-- Region I18N -->
<batch:job id="i18n.region.names" parent="abstractJob" restartable="true">
<batch:step id="step1">
<batch:tasklet transaction-manager="transactionManager"
task-executor="throttledTaskExecutor" throttle-limit="5">
<batch:chunk reader="regionEntityItemReader" processor="regionEntityItemProcessor"
writer="regionEntityItemWriter" commit-interval="1" skip-limit="200000">
<batch:skippable-exception-classes>
<batch:include class="com.qompa.utils.exceptions.SkippableException" />
</batch:skippable-exception-classes>
</batch:chunk>
</batch:tasklet>
</batch:step>
</batch:job>
<bean id="transactionManager"
class="org.springframework.batch.support.transaction.ResourcelessTransactionManager" />
</beans>
有没有人遇到过类似的问题?
答案 0 :(得分:3)
我的期望是你可能正在使用一个过时版本的Spring Retry(包含该类的库)。使用当前版本的Spring Retry应该可以解决问题。