SQL Error: 1054, SQLState: 42S22 this is the Error caused by the missing field, first attach the Error log:
2020-03-04 10:30:00. 221 WARN [pool – 8 – thread – 1] [org. Hibernate. Engine. JDBC. Spi. SqlExceptionHelper. Java: 127] – SQL Error: 1054, SQLState: 42 s22
the 2020-03-04 10:30:00. 221 ERROR span> [pool – 8 – thread – 1] [org. Hibernate. Engine. JDBC. Spi. SqlExceptionHelper. Java: 129] – Unknown column ‘markcardex0_. Art_service_time’ in ‘field List ‘ span>
the 2020-03-04 10:30:00. 225 ERROR [pool – 8 – thread – 1] [org. Springframework. Scheduling. Support. TaskUtils $LoggingErrorHandler. Java: 95] – Unexpected ERROR occurred in scheduled task.
org.springframework.dao.InvalidDataAccessResourceUsageException: could not extract ResultSet; SQL [n/a]; Nested exception is org. Hibernate. Exception….
…
under Caused by: org. Hibernate. Exception. SQLGrammarException: could not extract the ResultSet
… 24 common frames omitted
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column ‘markcardex0_. Art_service_time’ in ‘the field list’ span>
the at sun, reflect the NativeConstructorAccessorImpl. NewInstance0 (Native Method)
the at Sun. Reflect. NativeConstructorAccessorImpl. NewInstance (NativeConstructorAccessorImpl. Java: 62)
the at Sun. Reflect. DelegatingConstructorAccessorImpl. NewInstance (DelegatingConstructorAccessorImpl. Java: 45)
the at Java lang. Reflect. Constructor. NewInstance (423) Constructor. Java:
the at Com. Mysql. JDBC. Util. HandleNewInstance Util. Java: (411)
at the mysql. JDBC. Util. GetInstance (Util. Java: 386)
at the mysql. JDBC. SQLError. CreateSQLException (SQLError. Java: 1053)
the at Com. Mysql. JDBC. MysqlIO. CheckErrorPacket MysqlIO. Java: (4074)
at the mysql. JDBC. MysqlIO. CheckErrorPacket (MysqlIO. Java: 4006)
at the mysql. JDBC. MysqlIO. SendCommand (MysqlIO. Java: 2468)
At com. Mysql. JDBC. MysqlIO. SqlQueryDirect (MysqlIO. Java: 2629)
at the mysql. JDBC. ConnectionImpl. ExecSQL (ConnectionImpl. Java: 2719)
the at . Com. Mysql. JDBC PreparedStatement. ExecuteInternal (PreparedStatement. Java: 2155)
at the mysql.. JDBC PreparedStatement. ExecuteQuery (2318) a PreparedStatement. Java:
the at Com. Alibaba. Druid. Filter. FilterChainImpl. PreparedStatement_executeQuery (FilterChainImpl. Java: 2714)
the at Com. Alibaba. Druid. Filter. FilterEventAdapter. PreparedStatement_executeQuery (FilterEventAdapter. Java: 465)
the at Com. Alibaba. Druid. Filter. FilterChainImpl. PreparedStatement_executeQuery (FilterChainImpl. Java: 2711)
the at Com. Alibaba. Druid. Proxy. JDBC. PreparedStatementProxyImpl. ExecuteQuery (PreparedStatementProxyImpl. Java: 145)
the at Com. Alibaba. Druid. Pool. DruidPooledPreparedStatement. ExecuteQuery (DruidPooledPreparedStatement. Java: 227)
the at Org. Hibernate. Engine. JDBC. Internal. ResultSetReturnImpl. Extract (ResultSetReturnImpl. Java: 70)
… 60 common frames omitted
p>
error occurs mainly because the variables in the entity class do not match the classes in the database table, which is a headache, especially when the data is complex. I used to be stupid, one by one, but now I can sum up a simple method:
1. Look at the reason for this error: Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column ‘markcardex0_. Art_service_time ‘in ‘field List’ is Unknown column ‘markcardex0_. Art_service_time ‘in ‘field list’ is Unknown column’ mark_service_time ‘in ‘field list’ Find –> Find In Path) quickly search artServiceTime, Find the entity class that defines the variable artServiceTime, click In, as follows:
2. After entering the entity class corresponding to this variable, you can see the database Table corresponding to this entity through the annotation @table (name = “uk_markcard_xxxx”) :
opens the database and verifies the existence of this attribute in the table through the query, as follows:
as shown in the figure above, we found the same error as the console, at this time we add the corresponding entity variable property on the table, note:
(1) attribute type must be the same as the entity variable type
(2) MySQL makes no case difference, but if the variable in the entity class is named aaaBcc, the attribute name in the database should be aaa_bcc, not
Read More:
- Cause: java.sql.BatchUpdateException: Unknown column ‘xxx‘ in ‘field list‘
- MySQL error 1054 (42s22) unknown column ‘password’ in ‘field list’
- MySQL ERROR 1054 (42S22): Unknown column’password’ in’field list’ error
- MySQL password setting error message: error 1054 (42s22): unknown column ‘password’ in ‘field list’
- MySQL unknown column ‘in’ field list ‘solution
- Unknown column ‘Password‘ in ‘field list‘
- MySQL error: column ‘ID’ in field list is ambiguous
- SQL error: 17006, sqlstate: 99999 invalid column name
- SQL Error: 0, SQLState: 08S01 & Communications link failure
- SQL error: 156, sqlstate: S1000 error encountered in Hibernate
- How to Fix Failed to start service jboss.deployment.unit.”jboss-as-bmt.war”.INSTALL: org.jboss.msc.service.S
- Error attempting to get column time from result set. Cause: java.sql.SQLFe
- In the SQL query statement, add the column that does not exist in the table and set the fixed value of the column
- Word column after the text evenly distributed in the left and right two columns, rather than fill in the left column and then fill in the right column, how to do?
- How to Fix mat form field must contain a matformfieldcontrol error
- How to Fix error performing isolated work; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarE
- Error attempting to get column ‘xxxxx’ from result set — after Lombok is annotated with builder, mybatis cannot recognize the correct type of field
- When calling time module – time / datetime in wxPython, an error is reported. Valueerror: unknown locale: zh cn
- Cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure (How to Fix)
- SQL Error: 1452, SQLState: 23000