Note that there are some explanatory texts on larger screens.

plurals
  1. POFaiure Exceptions returning Empty when accessing using JobExplorer
    primarykey
    data
    text
    <p>I have a web application and I upload a file as soon as i upload a file i launch the job using job launcher and async task executor. So tehcnically the job runs in its own thread. The spring batch job spits out csv, imports into database and does some validations on the data. So any kind of exceptions during any of the steps like error parsing flat file due to an invalid date all the exceptions I get using </p> <pre><code>jobExecution.getAllFailureExceptions() </code></pre> <p>are sent out in error email at the end of the job using a listner. And the user who uploaded the file I make the thread sleep for 4 minutes </p> <pre><code>while(isJobRunning(jobId)) { if(count == 0) break; Thread.sleep(sleepMilliSeconds); count--; } </code></pre> <p>and then if the job has completed before the time I show the user in the UI all the validation error messages at the step level and job level. So now I use </p> <pre><code> jobExecution = jobExplorer.getJobExecution(jobExecution.getId()); </code></pre> <p>now when I do this to get the <code>jobExecution.getAllFailureExceptions()</code> it returns empty exceptions. I see the step exceptions and job level exceptions in the database job repository in the column 'EXIT_MESSAGE' BATCH_JOB_EXECUTION and BATCH_JOB_STEP_EXECUTION but they are not loaded when i retreive jobexecution using job explorer. Is there any workaround ? I have to create custom queries to retreive the step execution exceptions and job exceptions? please help me. </p> <p>Below are my job repository, jobexplorer and taskexecutor config</p> <pre><code>&lt;bean id="jobRepository" class="org.springframework.batch.core.repository.support.JobRepositoryFactoryBean"&gt; &lt;property name="dataSource" ref="batchDataSource" /&gt; &lt;property name="transactionManager" ref="batchTransactionManager" /&gt; &lt;property name="databaseType" value="Oracle" /&gt; &lt;property name="isolationLevelForCreate" value="ISOLATION_DEFAULT" /&gt; &lt;/bean&gt; &lt;bean id="jobLauncher" class="org.springframework.batch.core.launch.support.SimpleJobLauncher"&gt; &lt;property name="jobRepository" ref="jobRepository" /&gt; &lt;property name="taskExecutor" ref="taskExecutor" /&gt; &lt;/bean&gt; &lt;bean id="taskExecutor" class="org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor"&gt; &lt;property name="corePoolSize" value="1" /&gt; &lt;property name="maxPoolSize" value="3" /&gt; &lt;/bean&gt; &lt;bean id="jobExplorer" class="org.springframework.batch.core.explore.support.JobExplorerFactoryBean"&gt; &lt;property name="dataSource" ref="batchDataSource"/&gt; &lt;/bean&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload