天道酬勤,学无止境

cannot load application context from junit for spring batch job

I am having trouble loading application context from junit tests for my spring batch tests. I referred spring documentation https://docs.spring.io/spring-batch/trunk/reference/html/testing.html as well as every available information I could find on web, but still cannot get a simple junit test work.

I am using annotations to load the app context, code below. My aim is to be able to test individual steps.

I also cloned some examples from web, but when run in my local machine, they give me same error- unable to load application context... this got me thinking on how these tests are suppose to run? Run As -> junit tests is how all the unit tests run... isn't it?

@RunWith(SpringRunner.class)
@ContextConfiguration(classes = {BatchProcessingConfiguration.class, RestTemplateConfig.class, SftpConfig.class, DbConfig.class, RuntimeSessionFactoryLocator.class}, 
                      loader = AnnotationConfigContextLoader.class)
public class BatchProcessingJobApplicationTests extends AbstractTransactionalJUnit4SpringContextTests {

   @Autowired
   private JobLauncherTestUtils jobLauncherTestUtils;

   @Bean
   public DataSource dataSource() {
      DriverManagerDataSource dataSource = new DriverManagerDataSource();
      dataSource.setDriverClassName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
      dataSource.setUrl("url");
      dataSource.setUsername("username");
      dataSource.setPassword("password");

      return dataSource;
   }



   @Test
   public void testJob() throws Exception {

      JobExecution jobExecution = jobLauncherTestUtils.launchJob();

      Assert.assertEquals("COMPLETED", jobExecution.getExitStatus().getExitCode());
   }


}

Code is from spring documentation.

I am new to this stuff. Thanks for your help.

Stacktrace:

java.lang.IllegalStateException: Failed to load ApplicationContext 
   at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:124) 
   at org.springframework.test.context.support.DefaultTestContext.getApplicationContext(DefaultTestContext.java:83) 

... ...

WORKING CODE:

 @RunWith(SpringRunner.class)
    @SpringBatchTest
    @ContextConfiguration(classes = {BatchProcessingJobApplication.class, DataSourceConfiguration.class, JobconfigurationTest.class, BatchProperties.class}, initializers=ConfigFileApplicationContextInitializer.class)
    @ActiveProfiles("test")
    public class BatchProcessingJobApplicationTests {

       @Autowired
       private JobLauncherTestUtils jobLauncherTestUtils;

    @Test
public void testStep() throws Exception {
    // given
    JobParameters jobParameters = jobLauncherTestUtils.getUniqueJobParameters();

    // when
    JobExecution jobExecution = jobLauncherTestUtils.launchStep("jobName", jobParameters);

    // then
    Assert.assertEquals(ExitStatus.COMPLETED, jobExecution.getExitStatus());
}

    }


    public class DataSourceConfiguration {
    @Bean
        public DataSource dataSource(){

            SQLServerConnectionPoolDataSource dataSource = new SQLServerConnectionPoolDataSource();
              dataSource.setURL(url);
              dataSource.setUser(username);
              dataSource.setPassword(password);
              return dataSource;
        }
    }

    @Configuration
    public class JobconfigurationTest {
          @Bean
          public JobLauncherTestUtils jobLauncherTestUtils() {
                return new JobLauncherTestUtils();
          }

    }

Hope this helps someone like me.

评论

My aim is to be able to test individual steps.

You can use JobLauncherTestUtils#launchStep(String stepName) to launch a particular step and not the whole job. If you want to unit test a particular step, I would recommend to import only the configuration needed to test the step (I'm referring to RestTemplateConfig, SftpConfig, etc unless the step really need those).

Please note that the job under test should be declared as a bean in the test context because it is autowired in the JobLauncherTestUtils. In your case, I assume it is defined in the BatchProcessingConfiguration class.

A typical step test would be something like:

import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;

import org.springframework.batch.core.ExitStatus;
import org.springframework.batch.core.JobExecution;
import org.springframework.batch.core.JobParameters;
import org.springframework.batch.test.JobLauncherTestUtils;
import org.springframework.batch.test.context.SpringBatchTest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringRunner;

@RunWith(SpringRunner.class)
@SpringBatchTest
@ContextConfiguration(classes = {JobConfiguration.class}) // contains the job/step definition
public class JobTest {

   @Autowired
   private JobLauncherTestUtils jobLauncherTestUtils;

   @Test
   public void testStep() throws Exception {
      // given
      JobParameters jobParameters = jobLauncherTestUtils.getUniqueJobParameters();

      // when
      JobExecution jobExecution = jobLauncherTestUtils.launchStep("myStep", jobParameters);

      // then
      Assert.assertEquals(ExitStatus.COMPLETED, jobExecution.getExitStatus());
   }

}

NB: SpringBatchTest has been added in v4.1.

EDIT for additional comments: When the application context contains multiple job beans, it is not possible to know which one to inject in the JobLauncherTestUtils. In this case, the JobLauncherTestUtils should be created manually and configured with the job under test. Here is an example:

import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;

import org.springframework.batch.core.ExitStatus;
import org.springframework.batch.core.Job;
import org.springframework.batch.core.JobExecution;
import org.springframework.batch.core.JobParametersIncrementer;
import org.springframework.batch.core.JobParametersValidator;
import org.springframework.batch.core.configuration.annotation.EnableBatchProcessing;
import org.springframework.batch.core.job.DefaultJobParametersValidator;
import org.springframework.batch.core.launch.JobLauncher;
import org.springframework.batch.core.repository.JobRepository;
import org.springframework.batch.test.JobLauncherTestUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.lang.Nullable;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringRunner;

/*
 * This test class shows how to use the JobLauncherTestUtils when the application
 * context contains multiple jobs. Since the job is autowired in JobLauncherTestUtils (see setter),
 * it is not possible to autowire one job (ambiguous injection). Hence, it is required to either:
 *  - Not autowire the JobLauncherTestUtils (as shown in this class)
 *  - Or separate job definitions and use a test class for each job (better solution IMO, each job has its own test)
 */
@RunWith(SpringRunner.class)
@ContextConfiguration(classes = TestMultipleJobsWithJobLauncherTestUtils.JobsConfiguration.class)
public class TestMultipleJobsWithJobLauncherTestUtils {

    // don't autowire the JobLauncherTestUtils in this case otherwise No qualifying bean of type 'org.springframework.batch.core.Job' available: expected single matching bean but found 2: job1,job2
    private JobLauncherTestUtils jobLauncherTestUtils = new JobLauncherTestUtils();

    @Autowired
    private Job job1;

    @Autowired
    private Job job2;

    @Autowired
    private JobLauncher jobLauncher;
    @Autowired
    private JobRepository jobRepository;

    @Before
    public void setUp() {
        jobLauncherTestUtils.setJobLauncher(jobLauncher);
        jobLauncherTestUtils.setJobRepository(jobRepository);
    }

    @Test
    public void testJob1() throws Exception {
        // given
        jobLauncherTestUtils.setJob(job1);

        // when
        JobExecution jobExecution = jobLauncherTestUtils.launchJob();

        // then
        Assert.assertEquals(ExitStatus.COMPLETED, jobExecution.getExitStatus());
    }

    @Test
    public void testJob2() throws Exception {
        // given
        jobLauncherTestUtils.setJob(job2);

        // when
        JobExecution jobExecution = jobLauncherTestUtils.launchJob();

        // then
        Assert.assertEquals(ExitStatus.COMPLETED, jobExecution.getExitStatus());
    }

    @Configuration
    @EnableBatchProcessing
    public static class JobsConfiguration {

        @Bean
        public Job job1() {
            return new SimpleJob("job1");
        }

        @Bean
        public Job job2() {
            return new SimpleJob("job2");
        }

        // Don't declare the JobLauncherTestUtils as a bean to avoid dependecy injection
//      @Bean
//      public JobLauncherTestUtils jobLauncherTestUtils() {
//          return new JobLauncherTestUtils();
//      }

    }

    static class SimpleJob implements Job {

        private String name;

        public SimpleJob(String name) {
            this.name = name;
        }

        @Override
        public String getName() {
            return name;
        }

        @Override
        public boolean isRestartable() {
            return false;
        }

        @Override
        public void execute(JobExecution execution) {
            System.out.println("Executing job " + this.name);
            execution.setExitStatus(ExitStatus.COMPLETED);
        }

        @Nullable
        @Override
        public JobParametersIncrementer getJobParametersIncrementer() {
            return null;
        }

        @Override
        public JobParametersValidator getJobParametersValidator() {
            return new DefaultJobParametersValidator();
        }

    }
}

Hope this helps.

受限制的 HTML

  • 允许的HTML标签:<a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>
  • 自动断行和分段。
  • 网页和电子邮件地址自动转换为链接。

相关推荐
  • Spring batch scope issue while using spring boot
    I'm having Standalone spring batch job. This works perfectly fine when in JUNIT @RunWith(SpringJUnit4ClassRunner.class) //@SpringApplicationConfiguration(classes = KPBootApplication.class) @ContextConfiguration(locations={"classpath:kp-sb.xml"}) public class KPBootApplicationTests { private final static Logger LOG=LoggerFactory.getLogger(KPBootApplicationTests.class); @Autowired ApplicationContext context; @Autowired private JobLauncher jobLauncher; @Autowired private Job job; @Test public void testJob() { final JobParameters jobParameters = new JobParametersBuilder() .toJobParameters()
  • 使用Spring Boot时出现Spring Batch范围问题(Spring batch scope issue while using spring boot)
    问题 我正在执行独立的春季批处理作业。 在JUNIT中运行时效果很好 @RunWith(SpringJUnit4ClassRunner.class) //@SpringApplicationConfiguration(classes = KPBootApplication.class) @ContextConfiguration(locations={"classpath:kp-sb.xml"}) public class KPBootApplicationTests { private final static Logger LOG=LoggerFactory.getLogger(KPBootApplicationTests.class); @Autowired ApplicationContext context; @Autowired private JobLauncher jobLauncher; @Autowired private Job job; @Test public void testJob() { final JobParameters jobParameters = new JobParametersBuilder() .toJobParameters(); JobExecution execution; try { execution =
  • Spring Batch @StepScope cannot generate CGLIB subclass
    EDIT I created a test project that replicates the issue. It can be found at https://github.com/tomverelst/test-batch. First run the maven command exec:java to start a HSQL database. Then you can run the JUnit test MigrationJobConfigurationTest to load the Spring application context. Original question When starting my Spring Batch application, I get the following exception when Spring is loading my job's configuration: Caused by: org.springframework.aop.framework.AopConfigException: Could not generate CGLIB subclass of class [class com.sun.proxy.$Proxy34]: Common causes of this problem include
  • Spring Batch @StepScope 无法生成 CGLIB 子类(Spring Batch @StepScope cannot generate CGLIB subclass)
    问题 编辑 我创建了一个测试项目来复制这个问题。 它可以在 https://github.com/tomverelst/test-batch 上找到。 首先运行maven命令exec:java启动一个HSQL数据库。 然后您可以运行 JUnit 测试MigrationJobConfigurationTest来加载 Spring 应用程序上下文。 原始问题 启动我的 Spring Batch 应用程序时,当 Spring 加载我的作业配置时,我收到以下异常: Caused by: org.springframework.aop.framework.AopConfigException: Could not generate CGLIB subclass of class [class com.sun.proxy.$Proxy34]: Common causes of this problem include using a final class or a non-visible class; nested exception is java.lang.IllegalArgumentException: Cannot subclass final class class com.sun.proxy.$Proxy34 这是由我的作业配置中的@StepScope注释引起的。
  • Spring Batch JUnit测试多个作业(Spring Batch JUnit test for multiple jobs)
    问题 我在一个上下文文件中配置了两个作业 <batch:job id="JobA" restartable="true"> <batch:step id="abc"> <batch:tasklet > <batch:chunk reader="reader" writer="writer" processor="processor" /> </batch:tasklet> </batch:step> </batch:job> <batch:job id="JobB" restartable="true"> <batch:step id="abc"> <batch:tasklet > <batch:chunk reader="reader" writer="writer" processor="processor" /> </batch:tasklet> </batch:step> </batch:job> 当我使用JobLauncherTestUtils对JobA进行单元测试并测试作业启动时,它抛出异常 No unique bean of type [org.springframework.batch.core.Job;] is defined: expected single matching bean but found 2: [JobA, JobB] 我尝试使用
  • 在spring batch admin中加载外部配置文件(load external config file in spring batch admin)
    问题 我在github仓库中下载了spring批处理管理应用程序,并将其导入了eclipse中。 它完美地工作。 然后,我问自己如何将外部配置文件导入到我的工作定义类中可以使用的应用程序中。 我尝试了这个: VM参数 -Dspring.config.location=C:/path/to/config/file/application.properties 作业配置 src/main/java org.springframework.batch.admin.sample.job ------------------------------------------- @Configuration public class JobConfiguration { //I try to import this properties from an external config file. @Value("${folder.input.files}") private String pathToFiles; @Autowired public JobBuilderFactory jobBuilderFactory; @Autowired public StepBuilderFactory stepBuilderFactory; @Bean @JobScope public
  • load external config file in spring batch admin
    I downloaded the spring batch admin application in the github repo and I imported it in eclipse. it works perfectly. Then, I asked myself how to import an external config file into the application that I can use in my job definition class. I tried this : VM Arguments -Dspring.config.location=C:/path/to/config/file/application.properties Job configuration src/main/java org.springframework.batch.admin.sample.job ------------------------------------------- @Configuration public class JobConfiguration { //I try to import this properties from an external config file. @Value("${folder.input.files}")
  • Partitioner for JdbcCursorItemReader - Reader must be open before it can be read
    I had a working spring batch job which when I tried to make multi-threaded using a partitioner I started getting Reader must be open before it can be read. org.springframework.batch.item.ReaderNotOpenException: Reader must be open before it can be read. at org.springframework.batch.item.database.AbstractCursorItemReader.doRead(AbstractCursorItemReader.java:443) ~[spring-batch-infrastructure-3.0.7.RELEASE.jar:3.0.7.RELEASE] at org.springframework.batch.item.support.AbstractItemCountingItemStreamItemReader.read(AbstractItemCountingItemStreamItemReader.java:88) ~[spring-batch-infrastructure-3.0.7
  • JdbcCursorItemReader 的分区器 - Reader 必须打开才能被读取(Partitioner for JdbcCursorItemReader - Reader must be open before it can be read)
    问题 我有一个有效的春季批处理作业,当我尝试使用分区程序进行多线程处理时,我开始让 Reader 必须打开才能被读取。 org.springframework.batch.item.ReaderNotOpenException: Reader must be open before it can be read. at org.springframework.batch.item.database.AbstractCursorItemReader.doRead(AbstractCursorItemReader.java:443) ~[spring-batch-infrastructure-3.0.7.RELEASE.jar:3.0.7.RELEASE] at org.springframework.batch.item.support.AbstractItemCountingItemStreamItemReader.read(AbstractItemCountingItemStreamItemReader.java:88) ~[spring-batch-infrastructure-3.0.7.RELEASE.jar:3.0.7.RELEASE] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na
  • 一个 ItemReader,2 个 SQL 查询,jdbcTemplate?(One ItemReader, 2 SQL Query, jdbcTemplate?)
    问题 我有一个要求,我在两个不同的Query从数据库中读取。 每个Query都有自己的SQL 。 SQLs是相似的,并且在大多数情况下都使用相同的表集,只有细微的差别。 我想检查一下我是否可以在ItemReader有两个SQLs ,或者是否可以使用jdbctemplate ? 任何想法,示例代码? 回答1 如果您想“重用”现有的JdbcCursorItemReader (或其他 Spring Batch Jdbc*ItemReaders 之一),您可以通过利用 step 范围动态切换 SQL。 下面是一个基于sqlKey属性切换 SQL 的配置JobParameters 。 声明的来源是一张简单的地图。 <?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:util="http://www.springframework.org/schema/util" xsi:schemaLocation="http:/
  • Spring Batch Admin + Spring Boot - 模糊映射。 无法映射“org.springframework.batch.admin.web.JobController#1”方法(Spring Batch Admin + Spring Boot - Ambiguous mapping. Cannot map 'org.springframework.batch.admin.web.JobController#1' method)
    问题 我正在尝试使用 spring-batch-admin-samples 项目拥有 Spring Batch Admin UI。 我的工作使用 Spring Boot,并且我已经更改了我的主应用程序类,以便使用此链接可以部署到 Weblogic。 所以应用程序类看起来像, @SpringBootApplication(exclude = { HypermediaAutoConfiguration.class, MultipartAutoConfiguration.class }) @EnableBatchAdmin public class MyApplication extends SpringBootServletInitializer implements WebApplicationInitializer { @Override protected SpringApplicationBuilder configure( SpringApplicationBuilder builder) { return configureApplication(builder); } public static void main(String[] args) { configureApplication(new SpringApplicationBuilder()).run(args)
  • 无法执行 CommandLineRunner - Spring Batch(Failed to execute CommandLineRunner - Spring Batch)
    问题 嗨,我对 Spring 批处理非常陌生,但出现以下异常,但无法解决: java.lang.IllegalStateException: Failed to execute CommandLineRunner at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:800) [spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE] at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:781) [spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:335) [spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1255) [spring-boot-2.0.1.RELEASE
  • Spring Batch JUnit test for multiple jobs
    I am having two jobs configured in one context file <batch:job id="JobA" restartable="true"> <batch:step id="abc"> <batch:tasklet > <batch:chunk reader="reader" writer="writer" processor="processor" /> </batch:tasklet> </batch:step> </batch:job> <batch:job id="JobB" restartable="true"> <batch:step id="abc"> <batch:tasklet > <batch:chunk reader="reader" writer="writer" processor="processor" /> </batch:tasklet> </batch:step> </batch:job> When i am doing unit testing for the JobA using JobLauncherTestUtils and testing the job launch it is throwing an exception saying No unique bean of type [org
  • Spring Batch Admin + Spring Boot - Ambiguous mapping. Cannot map 'org.springframework.batch.admin.web.JobController#1' method
    I am trying to have Spring Batch Admin UI using spring-batch-admin-samples project. My job uses Spring Boot and I have changed my main application class to be deployable to Weblogic using this link. So application class looks like, @SpringBootApplication(exclude = { HypermediaAutoConfiguration.class, MultipartAutoConfiguration.class }) @EnableBatchAdmin public class MyApplication extends SpringBootServletInitializer implements WebApplicationInitializer { @Override protected SpringApplicationBuilder configure( SpringApplicationBuilder builder) { return configureApplication(builder); } public
  • Spring Batch 3.0中对Job Scope Bean的多线程访问(Multi-threaded acces to Job Scope beans in Spring Batch 3.0)
    问题 在Spring Batch 3.0中,我试图在分区和多线程步骤(使用task:executor bean配置)中为bean使用新的Job Scope功能,在两种情况下,我都遇到了异常 Caused by: java.lang.IllegalStateException: No context holder available for job scope at org.springframework.batch.core.scope.JobScope.getContext(JobScope.java:153) at org.springframework.batch.core.scope.JobScope.get(JobScope.java:92) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:338) 但是,如果我将bean步骤范围设置为正常,则可以。 我注意到JobSynchronizationManager上的评论说 注意,每个{@link Job}实现的责任是确保{@link JobContext}在可能与作业执行有关的每个线程(包括池中的工作线程)上可用。 所以我想知道是否需要做一些设置来设置它
  • Multi-threaded acces to Job Scope beans in Spring Batch 3.0
    In Spring Batch 3.0 I'm trying to use the new Job Scope functionality for beans in both partitioned and multi-threaded steps (configured with an task:executor bean), and in both cases I'm getting the exception Caused by: java.lang.IllegalStateException: No context holder available for job scope at org.springframework.batch.core.scope.JobScope.getContext(JobScope.java:153) at org.springframework.batch.core.scope.JobScope.get(JobScope.java:92) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:338) but if i make the beans step scope it works OK. I
  • Spring Boot + Spring Batch 无数据源(Spring boot + spring batch without DataSource)
    问题 我正在尝试在 spring boot 项目中配置 spring 批处理,我想在没有数据源的情况下使用它。 我发现ResourcelessTransactionManager是要走的路,但我不能让它工作。 问题是我已经定义了另外 3 个数据源,但我不想在 springBatch 中使用它们中的任何一个。 我已经检查了默认实现DefaultBatchConfigurer ,如果它无法找到 dataSource,它将完全按照我的意愿行事。 问题是我有 3 个并且不想使用任何一个。 请不要建议在内存数据库中使用 hsql 或其他,因为我不想要那样。 回答1 我通过扩展 DefaultBatchConfigurer 类来解决这个问题,以便它忽略任何数据源,因此它将配置基于映射的 JobRepository。 例子: @Configuration @EnableBatchProcessing public class BatchConfig extends DefaultBatchConfigurer { @Override public void setDataSource(DataSource dataSource) { //This BatchConfigurer ignores any DataSource } } 回答2 就我而言,我将数据保存到 Cassandra。
  • 分区作业完成后不能自行停止? 春批(Partitioned Job can't stop by itself after finishing? Spring Batch)
    问题 我写了一个两步作业,其中两步之一是分区步骤。 分区步骤使用 TaskExecutorPartitionHandler 并在线程中运行 5 个从步骤。 作业在 main() 方法中启动。 但它并没有在每个从属 ItemReader 返回 null 后停止 - 完成符号。 即使在程序运行超过 main() 方法中的最后一行代码(即 System.out.println("Finished"))之后,程序进程也不会停止,挂在内存中什么也不做。 我必须按下 Eclipse 面板上的停止按钮才能停止程序。 以下是 JobLauncher.run() 返回的 JobExecution 的内容,表示 Job 运行的成功状态。 JobExecution: id=0, version=2, startTime=Fri Nov 27 06:05:23 CST 2015, endTime=Fri Nov 27 06:05:39 CST 2015, lastUpdated=Fri Nov 27 06:05:39 CST 2015, status =COMPLETED, exitStatus=exitCode=COMPLETED;exitDescription=, job=[JobInstance: id=0, version=0, Job=[jobCensoredPages]]
  • spring-batch-admin 的附加属性文件(Additional properties files for spring-batch-admin)
    问题 我有一个使用 spring-batch 的 Web 应用程序,我现在正在集成 spring-batch-admin 进行基本管理。 问题是作业配置文件(与现有应用程序的配置共享)使用我应用程序类路径中文件的属性,但 spring-batch-admin 的上下文无法加载它们。 快速解决方案是覆盖 spring-batch-admin 中的placeholderProperties bean 以添加我的属性文件: <bean id="placeholderProperties" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="locations"> <list> <value>classpath:/org/springframework/batch/admin/bootstrap/batch.properties</value> <value>classpath:batch-default.properties</value> <value>classpath:batch-${ENVIRONMENT:hsql}.properties</value> <value>classpath:/path/to/jobs-config
  • com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'spring_batch_tutorial.batch_job_execution_params' doesn't exist - Spring Batch
    I am working on Spring MVC+ Spring Batch example, I'm developing an application from link: https://github.com/krams915/spring-batch-tutorial and I was able to successfully deploy the application, but when I click via application I see following error comes. ## Heading ##I've uploaded my code at: https://github.com/test512/spring-batch-krams-tutorial/tree/master/spring-batch-krams-tutorial com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'spring_batch_tutorial.batch_job_execution_params' doesn't exist at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at