我找不到为什么我得到这个异常。请帮我找一下。我使用的是IBM DB2/AS400 DB引擎。我用在java类中声明的名称检查了数据库中的列名。它们是一样的。在此异常之后,应用程序不会停止,而是继续进一步运行。在应用程序的某个地方,我试图保存使用存储库(repository.save(dailyErrorVO);),在那里它等待了很长时间,进入一些死锁。
public interface DailyErrorRepository
extends JpaRepository<DailyErrorVO, String>, CrudRepository<DailyErrorVO, String> {
}
@Entity
@Table(name = "T_DAILY_ERROR")
public class DailyErrorVO implements Comparable<DailyErrorVO>, Cloneable, Serializable{
private static final long serialVersionUID = 4917078316183458138L;
private Date EFF_DATE;
private String ERRCODE;
private String ERROR_MESSAGE;
private String EXCEPTION_MESSAGE;
private String EXTRNL_POI;
private String IMPACT_AREA;
@Column(name="LAST_MOD_TIME_DT", nullable = false)
private Timestamp LAST_MOD_TIME_DT;
@Id
@Column(nullable = true)
private String MEMBER_ID;
private String PAY_SEQ;
private String PROG_ID;
@Column(name="PROGRAM", nullable = false)
private String PROGRAM = CommonProperties.PROGRAM_NAME;
@Column(name="RUN_DATE", nullable = false)
private Date RUN_DATE;
private String SQLCODE;
private String SSN;
private String TABLE_NM;
public Date getEFF_DATE() {
return EFF_DATE;
}
public void setEFF_DATE(Date eFF_DATE) {
EFF_DATE = eFF_DATE;
}
public String getERRCODE() {
return ERRCODE;
}
public void setERRCODE(String eRRCODE) {
ERRCODE = eRRCODE;
}
public String getERROR_MESSAGE() {
return ERROR_MESSAGE;
}
public void setERROR_MESSAGE(String eRROR_MESSAGE) {
ERROR_MESSAGE = eRROR_MESSAGE;
}
public String getEXCEPTION_MESSAGE() {
return EXCEPTION_MESSAGE;
}
public void setEXCEPTION_MESSAGE(String eXCEPTION_MESSAGE) {
EXCEPTION_MESSAGE = eXCEPTION_MESSAGE;
}
public String getEXTRNL_POI() {
return EXTRNL_POI;
}
public void setEXTRNL_POI(String eXTRNL_POI) {
EXTRNL_POI = eXTRNL_POI;
}
public String getIMPACT_AREA() {
return IMPACT_AREA;
}
public void setIMPACT_AREA(String iMPACT_AREA) {
IMPACT_AREA = iMPACT_AREA;
}
public Timestamp getLAST_MOD_TIME_DT() {
return LAST_MOD_TIME_DT;
}
public void setLAST_MOD_TIME_DT(Timestamp lAST_MOD_TIME_DT) {
LAST_MOD_TIME_DT = lAST_MOD_TIME_DT;
}
public String getMEMBER_ID() {
return MEMBER_ID;
}
public void setMEMBER_ID(String mEMBER_ID) {
MEMBER_ID = mEMBER_ID;
}
public String getPAY_SEQ() {
return PAY_SEQ;
}
public void setPAY_SEQ(String pAY_SEQ) {
PAY_SEQ = pAY_SEQ;
}
public String getPROG_ID() {
return PROG_ID;
}
public void setPROG_ID(String pROG_ID) {
PROG_ID = pROG_ID;
}
public String getPROGRAM() {
return PROGRAM;
}
public void setPROGRAM(String pROGRAM) {
PROGRAM = pROGRAM;
}
public Date getRUN_DATE() {
return RUN_DATE;
}
public void setRUN_DATE(Date rUN_DATE) {
RUN_DATE = rUN_DATE;
}
public String getSQLCODE() {
return SQLCODE;
}
public void setSQLCODE(String sQLCODE) {
SQLCODE = sQLCODE;
}
public String getSSN() {
return SSN;
}
public void setSSN(String sSN) {
SSN = sSN;
}
public String getTABLE_NM() {
return TABLE_NM;
}
public void setTABLE_NM(String tABLE_NM) {
TABLE_NM = tABLE_NM;
}
@Override
public String toString() {
return "TDailyErrorVO [EFF_DATE=" + EFF_DATE + ", ERRCODE=" + ERRCODE + ", ERROR_MESSAGE=" + ERROR_MESSAGE
+ ", EXCEPTION_MESSAGE=" + EXCEPTION_MESSAGE + ", EXTRNL_POI=" + EXTRNL_POI + ", IMPACT_AREA="
+ IMPACT_AREA + ", LAST_MOD_TIME_DT=" + LAST_MOD_TIME_DT + ", MEMBER_ID=" + MEMBER_ID + ", PAY_SEQ="
+ PAY_SEQ + ", PROG_ID=" + PROG_ID + ", PROGRAM=" + PROGRAM + ", RUN_DATE=" + RUN_DATE + ", SQLCODE="
+ SQLCODE + ", SSN=" + SSN + ", TABLE_NM=" + TABLE_NM + "]";
}
@Override
public int compareTo(DailyErrorVO o) {
return 0;
}
}
com.ibm.as400.access.AS400JDBCSQLSyntaxErrorException: An undefined column name was detected.
at com.ibm.as400.access.JDError.createSQLExceptionSubClass(JDError.java:897) ~[jt400-jdk8-9.5.jar:JTOpen 9.5]
at com.ibm.as400.access.JDError.throwSQLException(JDError.java:421) ~[jt400-jdk8-9.5.jar:JTOpen 9.5]
at com.ibm.as400.access.JDError.throwSQLException(JDError.java:397) ~[jt400-jdk8-9.5.jar:JTOpen 9.5]
at com.ibm.as400.access.JDServerRow.findField(JDServerRow.java:519) ~[jt400-jdk8-9.5.jar:JTOpen 9.5]
at com.ibm.as400.access.AS400JDBCResultSet.findColumn(AS400JDBCResultSet.java:575) ~[jt400-jdk8-9.5.jar:JTOpen 9.5]
at com.ibm.as400.access.AS400JDBCResultSet.getString(AS400JDBCResultSet.java:3424) ~[jt400-jdk8-9.5.jar:JTOpen 9.5]
at com.zaxxer.hikari.pool.HikariProxyResultSet.getString(HikariProxyResultSet.java) ~[HikariCP-3.4.5.jar:?]
at org.hibernate.tool.schema.extract.internal.SequenceInformationExtractorLegacyImpl.resultSetSchemaName(SequenceInformationExtractorLegacyImpl.java:124) ~[hibernate-core-5.4.25.Final.jar:5.4.25.Final]
at org.hibernate.tool.schema.extract.internal.SequenceInformationExtractorLegacyImpl.extractMetadata(SequenceInformationExtractorLegacyImpl.java:53) ~[hibernate-core-5.4.25.Final.jar:5.4.25.Final]
at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentImpl.sequenceInformationList(JdbcEnvironmentImpl.java:403) [hibernate-core-5.4.25.Final.jar:5.4.25.Final]
at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentImpl.<init>(JdbcEnvironmentImpl.java:268) [hibernate-core-5.4.25.Final.jar:5.4.25.Final]
at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:114) [hibernate-core-5.4.25.Final.jar:5.4.25.Final]
at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:35) [hibernate-core-5.4.25.Final.jar:5.4.25.Final]
at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.initiateService(StandardServiceRegistryImpl.java:101) [hibernate-core-5.4.25.Final.jar:5.4.25.Final]
at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:263) [hibernate-core-5.4.25.Final.jar:5.4.25.Final]
at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:237) [hibernate-core-5.4.25.Final.jar:5.4.25.Final]
at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:214) [hibernate-core-5.4.25.Final.jar:5.4.25.Final]
at org.hibernate.id.factory.internal.DefaultIdentifierGeneratorFactory.injectServices(DefaultIdentifierGeneratorFactory.java:152) [hibernate-core-5.4.25.Final.jar:5.4.25.Final]
at org.hibernate.service.internal.AbstractServiceRegistryImpl.injectDependencies(AbstractServiceRegistryImpl.java:286) [hibernate-core-5.4.25.Final.jar:5.4.25.Final]
at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:243) [hibernate-core-5.4.25.Final.jar:5.4.25.Final]
at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:214) [hibernate-core-5.4.25.Final.jar:5.4.25.Final]
at org.hibernate.boot.internal.InFlightMetadataCollectorImpl.<init>(InFlightMetadataCollectorImpl.java:176) [hibernate-core-5.4.25.Final.jar:5.4.25.Final]
at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.complete(MetadataBuildingProcess.java:127) [hibernate-core-5.4.25.Final.jar:5.4.25.Final]
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.metadata(EntityManagerFactoryBuilderImpl.java:1224) [hibernate-core-5.4.25.Final.jar:5.4.25.Final]
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:1255) [hibernate-core-5.4.25.Final.jar:5.4.25.Final]
at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:58) [spring-orm-5.2.12.RELEASE.jar:5.2.12.RELEASE]
at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:365) [spring-orm-5.2.12.RELEASE.jar:5.2.12.RELEASE]
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:391) [spring-orm-5.2.12.RELEASE.jar:5.2.12.RELEASE]
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:378) [spring-orm-5.2.12.RELEASE.jar:5.2.12.RELEASE]
at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.afterPropertiesSet(LocalContainerEntityManagerFactoryBean.java:341) [spring-orm-5.2.12.RELEASE.jar:5.2.12.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1853) [spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1790) [spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:594) [spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516) [spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324) [spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory$$Lambda$148/0000000000000000.getObject(Unknown Source) [spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) [spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322) [spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) [spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1109) [spring-context-5.2.12.RELEASE.jar:5.2.12.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:869) [spring-context-5.2.12.RELEASE.jar:5.2.12.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:551) [spring-context-5.2.12.RELEASE.jar:5.2.12.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:758) [spring-boot-2.3.7.RELEASE.jar:2.3.7.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:750) [spring-boot-2.3.7.RELEASE.jar:2.3.7.RELEASE]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:405) [spring-boot-2.3.7.RELEASE.jar:2.3.7.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) [spring-boot-2.3.7.RELEASE.jar:2.3.7.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1237) [spring-boot-2.3.7.RELEASE.jar:2.3.7.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) [spring-boot-2.3.7.RELEASE.jar:2.3.7.RELEASE]
at com.benefeds.batch.ABWReversalFileValidationStarter.main(ABWReversalFileValidationStarter.java:9) [classes/:?]
根据您发布的堆栈跟踪,Hibernate无法确定在引导时发生的某些序列的当前值。也许你配置了错误的方言,或者方言有bug。请分享您使用的方言和Hibernate版本,以及确切的数据库名称和版本。很有可能,您可以简单地创建一个方言的子类并自己修复错误。