I've started using Spring Batch 2.1 but I'm having a problem when trying to add a MapJobExplorerFactoryBean to my application context. Here is my configuration via XML:
As my application starts, I receive the following exception:Code:<?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:context="http://www.springframework.org/schema/context" xmlns:batch="http://www.springframework.org/schema/batch" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd http://www.springframework.org/schema/batch http://www.springframework.org/schema/batch/spring-batch-2.1.xsd"> <!-- use for production with database: JobExplorerFactoryBean --> <bean id="jobExplorer" class="org.springframework.batch.core.explore.support.MapJobExplorerFactoryBean"> <property name="repositoryFactory" ref="jobRepository" /> </bean> <!-- In memory job repository for testing --> <bean id="jobRepository" class="org.springframework.batch.core.repository.support.MapJobRepositoryFactoryBean"> <property name="transactionManager" ref="transactionManager"/> </bean> <bean id="jobLauncher" class="org.springframework.batch.core.launch.support.SimpleJobLauncher"> <property name="jobRepository" ref="jobRepository" /> </bean> <bean id="jobRegistry" class="org.springframework.batch.core.configuration.support.MapJobRegistry" /> <!-- Add a register post-processor to automatically register all jobs as they're created --> <bean id="jobRegistryBeanPostProcessor" class="org.springframework.batch.core.configuration.support.JobRegistryBeanPostProcessor"> <property name="jobRegistry" ref="jobRegistry"/> </bean> <bean id="jobOperator" class="org.springframework.batch.core.launch.support.SimpleJobOperator"> <property name="jobExplorer" ref="jobExplorer" /> <property name="jobRepository" ref="jobRepository" /> <property name="jobRegistry" ref="jobRegistry" /> <property name="jobLauncher" ref="jobLauncher" /> </bean> <bean id="sampleTasklet" class="com.myorg.task.ExampleTask" /> <batch:job id="sampleJob"> <batch:step id="step0"> <batch:tasklet ref="sampleTasklet" /> </batch:step> </batch:job> </beans>
I don't understand how to create a MapJobExplorerFactoryBean in XML. I think I'm missing something about how a JobRepository and MapJobExplorerFactoryBean are related. Any help is appreciated. Thanks,Code:Caused by: java.lang.IllegalStateException: Cannot convert value of type [$Proxy25 implementing org.springframework.batch.core.repository.JobRepository,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised] to required type [org.springframework.batch.core.repository.support.MapJobRepositoryFactoryBean] for property 'repositoryFactory': no matching editors or conversion strategy found
Andrew
(And yes, I would like to get this working in memory before I put a real database behind it)


Reply With Quote
