- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有来自 2 个不同分支的服务器 #2 和服务器 #3 以及 Sprint Boot 应用程序 jar。
我通过 bitbucket 和所有配置类以及 pom.xml 手动比较了分支 - 代码是相同的(jackson-databind:jar:2.9.10.1 与 jackson-databind:jar:2.9.10.2 的版本除外,这不应该影响问题)。
我比较了两台服务器上的属性文件 - 它们是相同的。
依赖树:
[INFO] --- maven-dependency-plugin:3.0.2:tree (default-cli) @ ...batch ---
[INFO] ...batch:jar:1.00
[INFO] +- org.springframework.boot:spring-boot-starter:jar:2.0.6.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot:jar:2.0.6.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-autoconfigure:jar:2.0.6.RELEASE:compile
[INFO] | +- javax.annotation:javax.annotation-api:jar:1.3.2:compile
[INFO] | +- org.springframework:spring-core:jar:5.0.10.RELEASE:compile
[INFO] | | \- org.springframework:spring-jcl:jar:5.0.10.RELEASE:compile
[INFO] | \- org.yaml:snakeyaml:jar:1.19:runtime
[INFO] +- ...:Logging:jar:15.55:compile
[INFO] | +- log4j:log4j:jar:1.2.17:compile
[INFO] | \- org.slf4j:slf4j-log4j12:jar:1.7.25:compile
[INFO] | \- org.slf4j:slf4j-api:jar:1.7.25:compile
[INFO] +- org.springframework.batch:spring-batch-core:jar:4.0.2.RELEASE:compile
[INFO] | +- com.fasterxml.jackson.core:jackson-databind:jar:2.9.10.2:compile
[INFO] | | \- com.fasterxml.jackson.core:jackson-core:jar:2.9.7:compile
[INFO] | +- javax.batch:javax.batch-api:jar:1.0:compile
[INFO] | +- org.codehaus.jettison:jettison:jar:1.2:compile
[INFO] | +- org.springframework:spring-aop:jar:5.0.10.RELEASE:compile
[INFO] | +- org.springframework:spring-beans:jar:5.0.10.RELEASE:compile
[INFO] | +- org.springframework:spring-context:jar:5.0.10.RELEASE:compile
[INFO] | | \- org.springframework:spring-expression:jar:5.0.10.RELEASE:compile
[INFO] | \- org.springframework:spring-tx:jar:5.0.10.RELEASE:compile
[INFO] +- org.springframework.batch:spring-batch-infrastructure:jar:4.0.2.RELEASE:compile
[INFO] | \- org.springframework.retry:spring-retry:jar:1.2.2.RELEASE:compile
[INFO] +- org.jacoco:org.jacoco.agent:jar:runtime:0.8.3:test
[INFO] +- ....cib.envkit.pojo:pojo-tester:jar:0.0.12:compile
[INFO] | +- org.meanbean:meanbean:jar:2.0.3:compile
[INFO] | | \- commons-logging:commons-logging:jar:1.1.1:compile
[INFO] | +- com.google.guava:guava:jar:20.0:compile
[INFO] | +- org.javassist:javassist:jar:3.22.0-GA:compile
[INFO] | +- com.intellij:annotations:jar:12.0:compile
[INFO] | \- com.fasterxml.jackson.core:jackson-annotations:jar:2.9.0:compile
[INFO] +- org.glassfish.web:javax.el:jar:2.2.6:compile
[INFO] | \- javax.el:javax.el-api:jar:2.2.5:compile
[INFO] +- junit:junit:jar:4.12:test
[INFO] | \- org.hamcrest:hamcrest-core:jar:1.3:test
[INFO] +- ...:...-Common:jar:15.55:compile
[INFO] | +- ...:...-Common-API:jar:15.55:compile
[INFO] | | \- org.codehaus.jackson:jackson-jaxrs:jar:1.9.13:compile
[INFO] | | +- org.codehaus.jackson:jackson-core-asl:jar:1.9.13:compile
[INFO] | | \- org.codehaus.jackson:jackson-mapper-asl:jar:1.9.13:compile
[INFO] | +- org.apache.commons:commons-lang3:jar:3.7:compile
[INFO] | +- org.hibernate:hibernate-validator:jar:5.4.2.Final:compile
[INFO] | +- javax.validation:validation-api:jar:2.0.1.Final:compile
[INFO] | +- org.springframework:spring-context-support:jar:5.0.10.RELEASE:compile
[INFO] | +- org.springframework:spring-jdbc:jar:4.3.20.RELEASE:compile
[INFO] | +- org.springframework.data:spring-data-jpa:jar:2.0.11.RELEASE:compile
[INFO] | | +- org.springframework.data:spring-data-commons:jar:2.0.11.RELEASE:compile
[INFO] | | +- org.springframework:spring-orm:jar:5.0.10.RELEASE:compile
[INFO] | | \- org.aspectj:aspectjrt:jar:1.8.13:compile
[INFO] | +- commons-codec:commons-codec:jar:1.11:compile
[INFO] | +- org.apache.cxf:cxf-rt-frontend-jaxws:jar:3.0.0:compile
[INFO] | | +- xml-resolver:xml-resolver:jar:1.2:compile
[INFO] | | +- asm:asm:jar:3.3.1:compile
[INFO] | | +- org.apache.cxf:cxf-core:jar:3.0.0:compile
[INFO] | | | \- org.apache.ws.xmlschema:xmlschema-core:jar:2.1.0:compile
[INFO] | | +- org.apache.cxf:cxf-rt-bindings-soap:jar:3.0.0:compile
[INFO] | | | +- org.apache.cxf:cxf-rt-wsdl:jar:3.0.0:compile
[INFO] | | | | \- wsdl4j:wsdl4j:jar:1.6.3:compile
[INFO] | | | \- org.apache.cxf:cxf-rt-databinding-jaxb:jar:3.0.0:compile
[INFO] | | +- org.apache.cxf:cxf-rt-bindings-xml:jar:3.0.0:compile
[INFO] | | +- org.apache.cxf:cxf-rt-frontend-simple:jar:3.0.0:compile
[INFO] | | \- org.apache.cxf:cxf-rt-ws-addr:jar:3.0.0:compile
[INFO] | | \- org.apache.cxf:cxf-rt-ws-policy:jar:3.0.0:compile
[INFO] | +- javax.ws.rs:javax.ws.rs-api:jar:2.0.1:compile
[INFO] | +- com.cyberark.epv.sdk:javapasswordsdk:jar:7.20.110.9:compile
[INFO] | +- org.apache.cxf:cxf-rt-frontend-jaxrs:jar:3.0.0:compile
[INFO] | +- org.apache.cxf:cxf-rt-rs-client:jar:3.0.0:compile
[INFO] | +- org.apache.cxf:cxf-rt-ws-security:jar:3.0.2:compile
[INFO] | | +- org.apache.cxf:cxf-rt-security:jar:3.0.2:compile
[INFO] | | | \- org.apache.wss4j:wss4j-ws-security-common:jar:2.0.2:compile
[INFO] | | | +- org.opensaml:opensaml:jar:2.6.1:compile
[INFO] | | | | \- joda-time:joda-time:jar:2.9.9:compile
[INFO] | | | \- org.apache.geronimo.specs:geronimo-javamail_1.4_spec:jar:1.7.1:compile
[INFO] | | +- org.apache.wss4j:wss4j-ws-security-dom:jar:2.0.2:compile
[INFO] | | +- org.apache.wss4j:wss4j-policy:jar:2.0.2:compile
[INFO] | | | \- org.apache.neethi:neethi:jar:3.0.3:compile
[INFO] | | +- org.apache.wss4j:wss4j-ws-security-stax:jar:2.0.2:compile
[INFO] | | | \- org.apache.wss4j:wss4j-bindings:jar:2.0.2:compile
[INFO] | | \- org.apache.wss4j:wss4j-ws-security-policy-stax:jar:2.0.2:compile
[INFO] | +- org.apache.santuario:xmlsec:jar:2.0.5:compile
[INFO] | | \- org.codehaus.woodstox:woodstox-core-asl:jar:4.4.1:compile
[INFO] | | +- javax.xml.stream:stax-api:jar:1.0-2:compile
[INFO] | | \- org.codehaus.woodstox:stax2-api:jar:3.1.4:compile
[INFO] | +- com.atomikos:transactions-jta:jar:4.0.6:compile
[INFO] | | \- com.atomikos:transactions-api:jar:4.0.6:compile
[INFO] | +- com.atomikos:transactions:jar:3.8.0:compile
[INFO] | | \- org.mockito:mockito-all:jar:1.9.0:compile
[INFO] | +- com.atomikos:transactions-jdbc:jar:4.0.6:compile
[INFO] | +- com.atomikos:atomikos-util:jar:3.8.0:compile
[INFO] | +- com.atomikos:transactions-hibernate3:jar:3.8.0:compile
[INFO] | +- org.glassfish:javax.jms:jar:3.0.1:compile
[INFO] | +- org.springframework:spring-jms:jar:5.0.10.RELEASE:compile
[INFO] | | \- org.springframework:spring-messaging:jar:5.0.10.RELEASE:compile
[INFO] | \- com.ibm.mq:com.ibm.mqjms:jar:7.5.0.8:compile
[INFO] +- org.springframework:spring-web:jar:5.0.10.RELEASE:compile
[INFO] +- org.springframework.boot:spring-boot-devtools:jar:2.0.6.RELEASE:compile (optional)
[INFO] +- org.projectlombok:lombok:jar:1.18.8:compile
[INFO] +- org.hibernate:hibernate-ehcache:jar:5.2.11.Final:compile
[INFO] | +- org.jboss.logging:jboss-logging:jar:3.3.2.Final:compile
[INFO] | \- net.sf.ehcache:ehcache:jar:2.10.5:compile
[INFO] +- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:jar:1.0.0.Final:compile
[INFO] +- org.hibernate:hibernate-entitymanager:jar:5.2.11.Final:compile
[INFO] | +- org.hibernate.common:hibernate-commons-annotations:jar:5.0.1.Final:compile
[INFO] | +- net.bytebuddy:byte-buddy:jar:1.7.11:compile
[INFO] | \- org.jboss.spec.javax.transaction:jboss-transaction-api_1.2_spec:jar:1.0.1.Final:compile
[INFO] +- org.hibernate:hibernate-core:jar:5.2.11.Final:compile
[INFO] | +- antlr:antlr:jar:2.7.7:compile
[INFO] | +- org.jboss:jandex:jar:2.0.3.Final:compile
[INFO] | \- com.fasterxml:classmate:jar:1.3.4:compile
[INFO] +- org.dom4j:dom4j:jar:2.1.1:compile
[INFO] \- com.oracle:ojdbc6:jar:11.2.0.4:compile
该问题仅发生在服务器 #2 上。
org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [SELECT JOB_INSTANCE_ID, JOB_NAME from BATCH_JOB_INSTANCE where JOB_NAME = ? and JOB_KEY = ?]; nested exception is java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist
有jobRepository配置:
@Bean
public JobRepository jobRepository() throws Exception {
MapJobRepositoryFactoryBean mapJobRepositoryFactoryBean = new MapJobRepositoryFactoryBean(transactionManager());
return mapJobRepositoryFactoryBean.getObject();
}
所以SpringBoot应该使用内存方式。
除了以下内容之外,两个应用程序的输出相同
服务器#2
2020-03-03 16:01:21 INFO DefaultListableBeanFactory:821 - Overriding bean definition for bean 'transactionManager' with a different definition: replacing [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=databaseConfig; factoryMethodName=transactionManager; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [com/jpmorgan/ccit/config/DatabaseConfig.class]]
with [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.batch.core.configuration.annotation.SimpleBatchConfiguration; factoryMethodName=transactionManager; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/batch/core/configuration/annotation/SimpleBatchConfiguration.class]]||
factoryBeanName=databaseConfig
服务器#3
2020-03-02 17:26:09 INFO DefaultListableBeanFactory:821 - Overriding bean definition for bean 'transactionManager' with a different definition: replacing [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.batch.core.configuration.annotation.SimpleBatchConfiguration; factoryMethodName=transactionManager; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/batch/core/configuration/annotation/SimpleBatchConfiguration.class]]
with [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=databaseConfig; factoryMethodName=transactionManager; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [com/jpmorgan/ccit/config/DatabaseConfig.class]]||
factoryBeanName=org.springframework.batch.core.configuration.annotation.SimpleBatchConfiguration;
所以我认为问题可能出在 bean 重写上。
我无法在服务器 #3 或本地环境上重现此问题。
当我将 jar 从服务器 #3 复制到服务器 #2 时 – 它工作正常。
当我将 jar 从服务器 #2 复制到服务器 #3 时 – 遇到了同样的问题。
Spring 2.1 的 spring.main.allow-bean-definition-overriding 属性?据我所知,2.0 中默认应该覆盖它。还有其他建议吗?
<小时/>一些细节:
我们使用的是自定义属性文件,而不是 application.properties。运行者看起来像:
@SpringBootApplication
public class BatchApplication {
public static void main(String[] args) {
String rootPath = System.getProperty("config.root");
PropertyConfigurator.configure(rootPath + "/batch-log4j.properties");
SpringApplication.run(BatchApplication.class, args);
}
}
@Configuration
@EnableBatchProcessing
@PropertySource(value = {"file:${config.root}/…-batch.properties"}, ignoreResourceNotFound = true)
public class BatchConfig {
不,我无法将 jar 从本地复制到服务器。
不,我无法将 jar 从服务器复制到本地。
<小时/>更新#1
org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [SELECT JOB_INSTANCE_ID, JOB_NAME from BATCH_JOB_INSTANCE where JOB_NAME = ? and JOB_KEY = ?]; nested exception is java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist
at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:230)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:73)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:655)
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:690)
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:722)
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:732)
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:787)
at org.springframework.batch.core.repository.dao.JdbcJobInstanceDao.getJobInstance(JdbcJobInstanceDao.java:145)
at org.springframework.batch.core.repository.support.SimpleJobRepository.getLastJobExecution(SimpleJobRepository.java:293)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:343)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:197)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:294)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:98)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)
at com.sun.proxy.$Proxy87.getLastJobExecution(Unknown Source)
at org.springframework.batch.core.launch.support.SimpleJobLauncher.run(SimpleJobLauncher.java:101)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:343)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:197)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at org.springframework.batch.core.configuration.annotation.SimpleBatchConfiguration$PassthruAdvice.invoke(SimpleBatchConfiguration.java:127)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)
at com.sun.proxy.$Proxy114.run(Unknown Source)
at ....service...BatchService.launchJob(...BatchService.java:68)
at ....service...BatchService.executeJob(...BatchService.java:101)
at ....service....BatchService.run(...BatchService.java:51)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:84)
at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)
at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:93)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:447)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:396)
at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:951)
at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:513)
at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:227)
at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:531)
at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:208)
at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:886)
at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1175)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1296)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3613)
at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3657)
at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(OraclePreparedStatementWrapper.java:1495)
at org.springframework.jdbc.core.JdbcTemplate$1.doInPreparedStatement(JdbcTemplate.java:698)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:639)
... 47 more
<小时/>
更新#2
有使用 SimpleJobRepository:293 在本地环境上成功运行的屏幕截图。此行来自上面的堆栈跟踪。
如您所见,jobInstanceDao 是 MapJobInstanceDao。
MapJobInstanceDao is in-memory implementation of JobInstanceDao
<小时/>更新#3
更新#4
服务器#3(成功):
[org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader] - <Registering bean definition for @Bean method org.springframework.batch.core.configuration.annotation.SimpleBatchConfiguration.jobRepository()>
[org.springframework.beans.factory.support.DefaultListableBeanFactory] - <Overriding bean definition for bean 'transactionManager' with a different definition: replacing [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.batch.core.configuration.annotation.SimpleBatchConfiguration; factoryMethodName=transactionManager; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/batch/core/configuration/annotation/SimpleBatchConfiguration.class]] with [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=databaseConfig; factoryMethodName=transactionManager; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [com/.../.../config/DatabaseConfig.class]]>
[org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader] - <Registering bean definition for @Bean method com.........config.DatabaseConfig.jobRepository()>
[org.springframework.beans.factory.support.DefaultListableBeanFactory] - <Overriding bean definition for bean 'jobRepository' with a different definition: replacing [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.batch.core.configuration.annotation.SimpleBatchConfiguration; factoryMethodName=jobRepository; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/batch/core/configuration/annotation/SimpleBatchConfiguration.class]] with [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=databaseConfig; factoryMethodName=jobRepository; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [com/.../.../config/DatabaseConfig.class]]>
服务器#2(失败):
[org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader] - <Registering bean definition for @Bean method com.........config.DatabaseConfig.jobRepository()> [org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader] - <Registered bean definition for imported class 'org.springframework.batch.core.configuration.annotation.SimpleBatchConfiguration'>
[org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader] - [org.springframework.beans.factory.support.DefaultListableBeanFactory] -
所以看起来bean初始化的顺序不同...
最佳答案
该异常看起来像您正在使用的表与使用 JPA/Hibernate 定义的 Java 模型不对应。我看到您使用 Oracle JDBC,所以您使用的是 Oracle 数据库。我非常确定您需要更新数据库架构。您可能知道,使用 Spring boot 和 JPA,您可以使用 spring.jpa.hibernate.ddl-auto 属性在数据库架构上配置 JPA 行为,以验证或创建数据库架构。通常,它可以在application.properties
上设置。在您的情况下,将此属性放入您的自定义属性文件中。
spring.jpa.database=mysql
#spring.jpa.hibernate.ddl-auto=create
spring.jpa.hibernate.ddl-auto=validate
spring.jpa.properties.hibernate.format_sql=true
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect
spring.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect
现在您可以:
spring.jpa.hibernate.ddl-auto=create
。这样,每次应用程序启动时都会重新创建您的数据库。 希望对您有所帮助。
关于java - BadSqlGrammarException : bad SQL grammar [SELECT JOB_INSTANCE_ID, BATCH_JOB_INSTANCE 中的 JOB_NAME...] - 不同环境下的不同行为,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60530972/
SQL、PL-SQL 和 T-SQL 之间有什么区别? 谁能解释一下这三者之间的区别,并提供每一个的相关使用场景? 最佳答案 SQL 是一种对集合进行操作的查询语言。 它或多或少是标准化的,几乎所有关
这个问题已经有答案了: What is the difference between SQL, PL-SQL and T-SQL? (6 个回答) 已关闭 9 年前。 我对 SQL 的了解足以完成我的
我在数据库中有一个 USER 表。该表有一个 RegistrationDate 列,该列有一个默认约束为 GETDATE()。 使用 LINQ 时,我没有为 RegistrationDate 列提供任
我有一个可能属于以下类型的字符串 string expected result 15-th-rp 15 15/12-rp 12 15-12-th
很难说出这里问的是什么。这个问题模棱两可、含糊不清、不完整、过于宽泛或言辞激烈,无法以目前的形式合理回答。如需帮助澄清此问题以便可以重新打开,visit the help center . 9年前关闭
我有一个存储过程(称为 sprocGetArticles),它从文章表中返回文章列表。这个存储过程没有任何参数。 用户可以对每篇文章发表评论,我将这些评论存储在由文章 ID 链接的评论表中。 有什么方
我目前正在做一个 *cough*Oracle*cough* 数据库主题。讲师介绍embedded SQL作为让其他语言(例如 C、C++)与(Oracle)数据库交互的方式。 我自己做了一些数据库工作
SQL Server 中 SQL 语句的最大长度是多少?这个长度是否取决于 SQL Server 的版本? 例如,在 DECLARE @SQLStatement NVARCHAR(MAX) = N'S
这个问题已经有答案了: Simple way to transpose columns and rows in SQL? (9 个回答) 已关闭 8 年前。 CallType
预先感谢您对此提供的任何帮助。 假设我有一个查询,可以比较跨年的数据,从某个任意年份开始,永无止境(进入 future ),每年同一时期直到最后一个完整的月份(其特点是一月数据永远不会显示至 2 月
我在数据库中有一个 USER 表。该表有一个 RegistrationDate 列,该列的默认约束为 GETDATE()。 使用 LINQ 时,我没有为 RegistrationDate 列提供任何数
下面是我试图用来检查存储过程是否不存在然后创建过程的 sql。它会抛出一个错误:Incorrect syntax near the keyword 'PROCEDURE' IF NOT EXISTS
我有一个同事声称动态 SQL 在许多情况下比静态 SQL 执行得更快,所以我经常看到 DSQL 到处都是。除了明显的缺点,比如在运行之前无法检测到错误并且更难阅读,这是否准确?当我问他为什么一直使用
来自 lobodava 的动态 SQL 查询是: declare @sql nvarchar(4000) = N';with cteColumnts (ORDINAL_POSITION, CO
使用 SQL Server 中的存储过程执行动态 SQL 命令的现实优点和缺点是什么 EXEC (@SQL) 对比 EXEC SP_EXECUTESQL @SQL ? 最佳答案 sp_executes
我有这个有效的 SQL 查询: select sum(dbos.Points) as Points, dboseasons.Year from dbo.StatLines dbos i
我正在调试一些构建成功运行的 SQL 命令的代码。 然而,在查询结束时,查询结果似乎被写入了一个文本文件。 完整的查询如下 echo SELECT DATE,DATETABLE,DATE,APPDAT
我有一些创建表的 .sql 文件(MS SQL 数据库): 表_1.sql: IF OBJECT_ID (N'my_schema.table1', N'U') IS NOT NULL DROP TAB
我写了下面的 SQL 存储过程,它一直给我错误@pid = SELECT MAX(... 整个过程是: Alter PROCEDURE insert_partyco @pname varchar(20
我在 SQL Server 2005 中有包含两列 Fruit 和 Color 的表,如下所示 Fruit Colour Apple Red Orange
我是一名优秀的程序员,十分优秀!