Hi have have a job configured to persist the job repository to a db (oracle)
The unit test runs ok, but it will only run once then i get an exception
org.springframework.batch.core.repository.JobExecu tionAlreadyRunningException: A job execution for this job is already running: JobInstance:
If I look in the BATCH_JOB_EXECUTION the status set to STARTING.
here is my config
Code:<beans xmlns="http://www.springframework.org/schema/beans" xmlns:jee="http://www.springframework.org/schema/jee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-2.5.xsd"> <bean id="hello" class="player.profile.ProfileOutput"> <property name="message" value="my" /> </bean> <bean id="apa" class="com.bossmedia.gem.components.player.profile.ProfileOutput"> <property name="message" value="test" /> </bean> <bean id="taskletStep" abstract="true" class="org.springframework.batch.core.step.tasklet.TaskletStep"> <property name="jobRepository" ref="jobRepository" /> <property name="transactionManager" ref="transactionManager" /> </bean> <bean id="simpleJob" class="org.springframework.batch.core.job.SimpleJob"> <property name="name" value="simpleJob" /> <property name="steps"> <list> <bean parent="taskletStep"> <property name="tasklet" ref="hello" /> </bean> <bean parent="taskletStep"> <property name="tasklet" ref="apa" /> </bean> </list> </property> <property name="jobRepository" ref="jobRepository" /> </bean> <bean id="jobLauncher" class="org.springframework.batch.core.launch.support.SimpleJobLauncher"> <property name="jobRepository" ref="jobRepository" /> </bean> <!-- change to map here for in-memory --> <bean id="jobRepository" class="org.springframework.batch.core.repository.support.JobRepositoryFactoryBean"> <property name="transactionManager" ref="transactionManager" /> <property name="dataSource" ref="dataSource"/> <property name="databaseType" value="oracle" /> <property name="tablePrefix" value="batch_"/> </bean> <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"> <property name="driverClassName" value="oracle.jdbc.driver.OracleDriver" /> <property name="url" value="jdbc:oracle:thin:@localhost:1521:XE" /> <property name="username" value="user" /> <property name="password" value="psw" /> </bean> <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> <property name="dataSource" ref="dataSource" /> </bean> </beans>


Reply With Quote