spring batch org.postgresql.util.psqlexception:错误:关系“batch\u job\u instance”的“version”列不存在

5q4ezhmt  于 2021-07-24  发布在  Java
关注(0)|答案(0)|浏览(289)

我在连接批处理应用程序和postgres数据库时遇到以下pcf错误。我用脚本创建表-https://github.com/spring-projects/spring-batch/blob/master/spring-batch-core/src/main/resources/org/springframework/batch/core/schema-postgresql.sql,但当我在dbeaver客户机中打开表时,它会显示双引号(“)。version是postgres中的保留关键字,我无法更改spring批处理用于查询数据库的内部代码。
在这两方面我都是块,有没有快速的指针?
错误:

021-01-25T18:58:07.060+05:30 [APP/PROC/WEB/0] [OUT] Position: 68] with root cause
2021-01-25T18:58:07.060+05:30 [APP/PROC/WEB/0] [OUT] org.postgresql.util.PSQLException: ERROR: column "version" of relation "batch_job_instance" does not exist
2021-01-25T18:58:07.060+05:30 [APP/PROC/WEB/0] [OUT] Position: 68
2021-01-25T18:58:07.060+05:30 [APP/PROC/WEB/0] [OUT] at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2533) ~[postgresql-42.2.12.jar:42.2.12]
2021-01-25T18:58:07.060+05:30 [APP/PROC/WEB/0] [OUT] at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2268) ~[postgresql-42.2.12.jar:42.2.12]
2021-01-25T18:58:07.060+05:30 [APP/PROC/WEB/0] [OUT] at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:313) ~[postgresql-42.2.12.jar:42.2.12]
2021-01-25T18:58:07.060+05:30 [APP/PROC/WEB/0] [OUT] at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:448) ~[postgresql-42.2.12.jar:42.2.12]
2021-01-25T18:58:07.060+05:30 [APP/PROC/WEB/0] [OUT] at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:159) ~[postgresql-42.2.12.jar:42.2.12]
2021-01-25T18:58:07.060+05:30 [APP/PROC/WEB/0] [OUT] at org.postgresql.jdbc.PgPreparedStatement.executeUpdate(PgPreparedStatement.java:125) ~[postgresql-42.2.12.jar:42.2.12]
2021-01-25T18:58:07.060+05:30 [APP/PROC/WEB/0] [OUT] at org.springframework.jdbc.core.JdbcTemplate.lambda$update$0(JdbcTemplate.java:867) ~[spring-jdbc-5.2.6.RELEASE.jar:5.2.6.RELEASE]
2021-01-25T18:58:07.060+05:30 [APP/PROC/WEB/0] [OUT] at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:922) ~[spring-jdbc-5.2.6.RELEASE.jar:5.2.6.RELEASE]
2021-01-25T18:58:07.060+05:30 [APP/PROC/WEB/0] [OUT] at org.springframework.batch.core.repository.dao.JdbcJobInstanceDao.createJobInstance(JdbcJobInstanceDao.java:120) ~[spring-batch-core-4.2.2.RELEASE.jar:4.2.2.RELEASE]
2021-01-25T18:58:07.060+05:30 [APP/PROC/WEB/0] [OUT] at org.springframework.batch.core.repository.support.SimpleJobRepository.createJobExecution(SimpleJobRepository.java:140) ~[spring-batch-core-4.2.2.RELEASE.jar:4.2.2.RELEASE]
2021-01-25T18:58:07.060+05:30 [APP/PROC/WEB/0] [OUT] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_265]
2021-01-25T18:58:07.060+05:30 [APP/PROC/WEB/0] [OUT] at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344) ~[spring-aop-5.2.6.RELEASE.jar:5.2.6.RELEASE]
2021-01-25T18:58:07.060+05:30 [APP/PROC/WEB/0] [OUT] at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198) ~[spring-aop-5.2.6.RELEASE.jar:5.2.6.RELEASE]
2021-01-25T18:58:07.060+05:30 [APP/PROC/WEB/0] [OUT] at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:118) ~[spring-tx-5.2.6.RELEASE.jar:5.2.6.RELEASE]
2021-01-25T18:58:07.060+05:30 [APP/PROC/WEB/0] [OUT] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.2.6.RELEASE.jar:5.2.6.RELEASE]
2021-01-25T18:58:07.060+05:30 [APP/PROC/WEB/0] [OUT] at org.springframework.batch.core.repository.support.AbstractJobRepositoryFactoryBean$1.invoke(AbstractJobRepositoryFactoryBean.java:181) ~[spring-batch-core-4.2.2.RELEASE.jar:4.2.2.RELEASE]
2021-01-25T18:58:07.060+05:30 [APP/PROC/WEB/0] [OUT] at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212) ~[spring-aop-5.2.6.RELEASE.jar:5.2.6.RELEASE]
2021-01-25T18:58:07.060+05:30 [APP/PROC/WEB/0] [OUT] at org.springframework.batch.core.launch.support.SimpleJobLauncher.run(SimpleJobLauncher.java:137) ~[spring-batch-core-4.2.2.RELEASE.jar:4.2.2.RELEASE]
2021-01-25T18:58:07.060+05:30 [APP/PROC/WEB/0] [OUT] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_265]
2021-01-25T18:58:07.060+05:30 [APP/PROC/WEB/0] [OUT] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_265]
2021-01-25T18:58:07.060+05:30 [APP/PROC/WEB/0] [OUT] at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198) ~[spring-aop-5.2.6.RELEASE.jar:5.2.6.RELEASE]
2021-01-25T18:58:07.060+05:30 [APP/PROC/WEB/0] [OUT] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-5.2.6.RELEASE.jar:5.2.6.RELEASE]
2021-01-25T18:58:07.060+05:30 [APP/PROC/WEB/0] [OUT] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.2.6.RELEASE.jar:5.2.6.RELEASE]
2021-01-25T18:58:07.060+05:30 [APP/PROC/WEB/0] [OUT] at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212) ~[spring-aop-5.2.6.RELEASE.jar:5.2.6.RELEASE]
2021-01-25T18:58:07.060+05:30 [APP/PROC/WEB/0] [OUT] at com.mastercard.customer.data.management.batch.controller.MdsBatchJobController.handle(MdsBatchJobController.java:99) ~[classes/:na]
2021-01-25T18:58:07.060+05:30 [APP/PROC/WEB/0] [OUT] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_265]
2021-01-25T18:58:07.060+05:30 [APP/PROC/WEB/0] [OUT] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_265]
2021-01-25T18:58:07.060+05:30 [APP/PROC/WEB/0] [OUT] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_265]
2021-01-25T18:58:07.060+05:30 [APP/PROC/WEB/0] [OUT] at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_265]
2021-01-25T18:58:07.060+05:30 [APP/PROC/WEB/0] [OUT] at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:105) ~[spring-webmvc-5.2.6.RELEASE.jar:5.2.6.RELEASE]
2021-01-25T18:58:07.060+05:30 [APP/PROC/WEB/0] [OUT] at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:879) ~[spring-webmvc-5.2.6.RELEASE.jar:5.2.6.RELEASE]
2021-01-25T18:58:07.060+05:30 [APP/PROC/WEB/0] [OUT] at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:793) ~[spring-webmvc-5.2.6.RELEASE.jar:5.2.6.RELEASE]

在我的postgres客户端脚本中显示-

CREATE TABLE scv_stg.batch_job_instance (
 job_instance_id int8 NOT NULL,
    "version" int8 NULL,
    job_name varchar(100) NOT NULL,
    job_key varchar(32) NOT NULL,
    CONSTRAINT batch_job_instance_pkey PRIMARY KEY (job_instance_id),
    CONSTRAINT job_inst_un UNIQUE (job_name, job_key)
)

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题