Spring batch Spring批处理中的内存中作业资源管理器定义
我试图将内存中的jobRepository共享给jobExplorer。但它抛出了一个错误 嵌套异常是Spring batch Spring批处理中的内存中作业资源管理器定义,spring-batch,Spring Batch,我试图将内存中的jobRepository共享给jobExplorer。但它抛出了一个错误 嵌套异常是 org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type '$Proxy1 implementing org.springframework.batch.core.repository.JobRepository,org. springframework
org.springframework.beans.ConversionNotSupportedException:
Failed to convert property value of type '$Proxy1 implementing
org.springframework.batch.core.repository.JobRepository,org.
springframework.aop.SpringProxy,org.springframework.aop.framework.Advised'
to required type
甚至在传递给jobExplorer进行共享时,我也尝试在jobRepository之前加上“&”符号。但尝试的结果是徒劳的
我使用的是Spring Batch 2.2.1
jobExplorer的依赖关系是否只是数据库不在内存中
定义是
<bean id="jobRepository"
class="com.test.repository.BatchRepositoryFactoryBean">
<property name="cache" ref="cache" />
<property name="transactionManager" ref="transactionManager" />
</bean>
<bean id="jobOperator" class="test.batch.LauncherTest.TestBatchOperator">
<property name="jobExplorer" ref="jobExplorer" />
<property name="jobRepository" ref="jobRepository" />
<property name="jobRegistry" ref="jobRegistry" />
<property name="jobLauncher" ref="jobLauncher" />
</bean>
<bean id="jobExplorer" class="test.batch.LauncherTest.TestBatchExplorerFactoryBean">
<property name="repositoryFactory" ref="&jobRepository" />
</bean>
<bean id="transactionManager"
class="org.springframework.batch.support.transaction.ResourcelessTransactionManager" />
<bean id="jobLauncher" class="com.scb.smartbatch.core.BatchLauncher">
<property name="jobRepository" ref="jobRepository" />
</bean>
<!-- To store Batch details -->
<bean id="jobRegistry" class="com.scb.smartbatch.repository.SmartBatchRegistry" />
<bean id="jobRegistryBeanPostProcessor"
class="org.springframework.batch.core.configuration.support.JobRegistryBeanPostProcessor">
<property name="jobRegistry" ref="jobRegistry" />
</bean>
<!--Runtime cache of batch executions -->
<bean id="cache" class="com.scb.cache.TCRuntimeCache" />
通常您必须连接接口而不是实现。
否则,您可能需要添加
,通常您需要连接接口而不是实现。
否则,您可能需要添加,谢谢您宝贵的意见
但是我用了“&;”代码>在作业存储库引用之前,这允许我将其作为共享资源用于作业资源管理器
问题解决了
谢谢。感谢您的宝贵意见
但是我用了“&;”代码>在作业存储库引用之前,这允许我将其作为共享资源用于作业资源管理器
问题解决了
很好。你能发布你的工作配置吗?谢谢你的回复Kenston,我已经在我的帖子中包含了定义。你有
指令吗?没有,我没有设置。你能详细说明它在spring batch中的用法吗?谢谢你在类中连接实现而不是接口吗?你能发布你的作业配置吗?谢谢你的回复Kenston,我已经在我的帖子中包含了定义。你有
指令吗?没有,我没有设置。你能详细说明它在spring batch中的用法吗?谢谢,您是在类中连接实现而不是接口吗?