gpt4 book ai didi

java - Spring Batch + HSQLDB 错误-用户没有权限

转载 作者:行者123 更新时间:2023-11-30 08:31:42 25 4
gpt4 key购买 nike

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

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

编辑:当我将 Spring 从 4.0.0 版本更新到 4.2.3 版本时,错误自行解决。

现在批处理正在运行,但未执行首次运行后的步骤。

在第一次运行期间,我收到以下错误:

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]

最佳答案

看来您还没有创建表/ View BATCH_JOB_EXECUTION,或者可能还没有授予自己对它的权限,因为您的错误是:

user lacks privilege or object not found: BATCH_JOB_EXECUTION

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

关于java - Spring Batch + HSQLDB 错误-用户没有权限,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40519730/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com