Java 弹簧批+;HSQL DB错误-用户没有预编译

Java 弹簧批+;HSQL DB错误-用户没有预编译,java,spring,java-8,spring-batch,hsqldb,Java,Spring,Java 8,Spring Batch,Hsqldb,我正在使用Spring Batch 3.0.5和Spring Boot以及job launcher,但每当我运行我的作业时,我都会遇到以下错误: org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [SELECT VERSION FROM BATCH_JOB_EXECUTION WHERE JOB_EXECUTION_ID=?]; nested ex

我正在使用Spring Batch 3.0.5和Spring Boot以及job launcher,但每当我运行我的作业时,我都会遇到以下错误:

org.springframework.jdbc.BadSqlGrammarException:
    PreparedStatementCallback; bad SQL grammar [SELECT VERSION FROM BATCH_JOB_EXECUTION WHERE JOB_EXECUTION_ID=?];
    nested exception is java.sql.SQLSyntaxErrorException: user lacks privilege or object not found: BATCH_JOB_EXECUTION

Caused by: java.sql.SQLSyntaxErrorException: user lacks privilege or object not found: BATCH_JOB_EXECUTION
at org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source)
at org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source)
at org.hsqldb.jdbc.JDBCPreparedStatement.<init>(Unknown Source)
at org.hsqldb.jdbc.JDBCConnection.prepareStatement(Unknown Source)
at org.springframework.jdbc.core.JdbcTemplate$SimplePreparedStatementCreator.createPreparedStatement(JdbcTemplate.java:1557)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:638)

Caused by: org.springframework.dao.ConcurrencyFailureException:
    PreparedStatementCallback; SQL [INSERT into BATCH_JOB_INSTANCE(JOB_INSTANCE_ID, JOB_NAME, JOB_KEY, VERSION) values (?, ?, ?, ?)];
    transaction rollback: serialization failure; nested exception is java.sql.SQLTransactionRollbackException: transaction rollback: serialization failure
ERROR 8442 --- o.s.s.s.TaskUtils$LoggingErrorHandler    : Unexpected error occurred in scheduled task.
org.springframework.dao.ConcurrencyFailureException: PreparedStatementCallback; SQL [INSERT into BATCH_JOB_INSTANCE(JOB_INSTANCE_ID, JOB_NAME, JOB_KEY, VERSION) values (?, ?, ?, ?)]; transaction rollback: serialization failure; nested exception is java.sql.SQLTransactionRollbackException: transaction rollback: serialization failure
在批处理的每次运行之后,我将在命令行中获得以下输出

INFO 8442 --- com.capitalone.schduler.BatchScheduler   : sendMailToCustomers Job ran at 11/10/2016 10:37:06
INFO 8442 --- com.capitalone.schduler.BatchScheduler   : triggering BatchConfiguration at time {}11/10/2016 10:37:06
INFO 8442 --- o.s.b.c.l.support.SimpleJobLauncher      : Job: [FlowJob: [name=queueInfoStep]] launched with the following parameters: [{JOB_START_DATE=Thu Nov 10 10:37:06 EST 2016}]
INFO 8442 --- o.s.batch.core.job.SimpleStepHandler     : Executing step: [queueInfoStep]
INFO 8442 --- o.s.b.c.l.support.SimpleJobLauncher      : Job: [FlowJob: [name=queueInfoStep]] completed with the following parameters: [{JOB_START_DATE=Thu Nov 10 10:37:06 EST 2016}] and the following status: [COMPLETED]

您似乎还没有创建表/视图
批处理作业执行
,或者可能没有授予自己对它的权限,因为您的错误是:

user lacks privilege or object not found: BATCH_JOB_EXECUTION

请确保您也输入了正确的凭据集-如果您使用一个用户名创建表,您可以尝试使用其他用户名和密码访问它。

请确保指定初始化脚本以创建Spring Batch framework表。各种数据库的DDL捆绑在spring批处理核心中

这将放在测试上下文文件中:

<jdbc:embedded-database id="dataSource" type="HSQL">
    <jdbc:script location="classpath:/org/springframework/batch/core/schema-hsqldb.sql" />
</jdbc:embedded-database>


都是因为jar版本不匹配。弹簧靴、弹簧批和弹簧芯的特定组合仅起作用。任何未匹配的版本都会像我遇到的版本一样以错误告终

你好,Dean,我使用的是java配置而不是xml版本,有没有办法在java配置中实现同样的功能。我正在寻找一种方法,告诉spring不要将数据存储在超过一定限制的HSQLDB中,因为随着时间的推移,它会增长并产生麻烦。