- 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/
我在文档中找不到答案,所以我在这里问。 在 Grails 中,当您创建应用程序时,您会默认获得生产、开发等环境。 如果您想为生产构建 WAR,您可以运行以下任一命令: grails war 或者 gr
我们组织的网站正在迁移到 Sitecore CMS,但我们正在努力以某种方式为开发人员 (4)、设计师 (4)、QA 人员 (3)、作者 (10-15) 和批准者 (4-10) 设置环境在他们可以独立
如何在WinCVS中设置CVSROOT环境变量? 最佳答案 简单的回答是:您不需要。 CVSROOT 环境变量被高估了。 CVS(NT) 只会在确定存储库连接字符串的所有其他方法都已用尽时才使用它。人
我最近完成了“learnyouahaskell”一书,现在我想通过构建 yesod 应用程序来应用我所学到的知识。 但是我不确定如何开始。 关于如何设置 yesod 项目似乎有两个选项。一是Stack
在这一章中,我们将讨论创建 C# 编程所需的工具。我们已经提到 C# 是 .Net 框架的一部分,且用于编写 .Net 应用程序。因此,在讨论运行 C# 程序的可用工具之前,让我们先了解一下 C#
运行Ruby 代码需要配置 Ruby 编程语言的环境。本章我们会学习到如何在各个平台上配置安装 Ruby 环境。 各个平台上安装 Ruby 环境 Linux/Unix 上的 Ruby 安装
就目前而言,这个问题不适合我们的问答形式。我们希望答案得到事实、引用或专业知识的支持,但这个问题可能会引起辩论、争论、投票或扩展讨论。如果您觉得这个问题可以改进并可能重新打开,visit the he
我有一个这样的计算(请注意,这只是非常简化的、缩减版的、最小的可重现示例!): computation <- function() # simplified version! { # a lo
我使用环境作为哈希表。键是来自常规文本文档的单词,值是单个整数(某个其他结构的索引)。 当我加载数百万个元素时,更新和查找都变慢了。下面是一些代码来显示行为。 看起来从一开始的行为在 O(n) 中比在
我正在构建一个 R 包并使用 data-raw和 data存储预定义的库 RxODE楷模。这非常有效。 然而,由此产生的.rda文件每代都在变化。某些模型包含 R 环境,并且序列化似乎包含“创建时间”
(不确定问题是否属于这里,所以道歉是为了) 我很喜欢 Sublime Text ,我经常发现 Xcode 缺少一些文本/数据处理的东西。我可能有不止一个问题—— 'Command +/' 注释代码但没
我正在使用 SF2,并且创建了一些有助于项目调试的路由: widget_debug_page: path: /debug/widget/{widgetName} defau
我创建了一个名为 MyDjangoEnv 的 conda 环境。当我尝试使用 source activate MyDjangoEnv 激活它时,出现错误: No such file or direct
有没有办法区分从本地机器运行的包和从 Cordova 应用商店安装的包? 例如,我想像这样设置一个名为“evn”的 JavaScript 变量: if(cordovaLocal){ env = 'de
很难说出这里要问什么。这个问题模棱两可、含糊不清、不完整、过于宽泛或夸夸其谈,无法以目前的形式得到合理的回答。如需帮助澄清此问题以便重新打开,visit the help center . 关闭 1
我的任务是使用 java 和 mysql 开发一个交互式网站:使用 servlet 检索和处理数据,applet 对数据客户端进行特殊处理,并处理客户端对不同数据 View 的请求。 对于使用 jav
这按预期工作: [dgorur@ted ~]$ env -i env [dgorur@ted ~]$ 这样做: [dgorur@ted ~]$ env -i which date which: no
我想进行非常快速的搜索,看来使用哈希(通过环境)是最好的方法。现在,我得到了一个在环境中运行的示例,但它没有返回我需要的内容。 这是一个例子: a system.time(benchEnv(), g
我想开始开发 OpenACC 程序,我有几个问题要问:是否可以在 AMD gpu 上执行 OpenACC 代码? 如果是这样,我正在寻找适用于 Windows 环境的编译器。我花了将近一个小时什么也没
这可能看起来很奇怪,但是有没有办法制作机器(linux/unix 风格 - 最好是 RHEL)。我需要控制机器的速度以确保代码在非常慢的系统上工作并确定正确的断点(在时间方面)。 我能做到的一种方法是
我是一名优秀的程序员,十分优秀!