Full error log:
2019-09-20 08:35:37.860 INFO 1 --- [nio-8081-exec-1] o.a.c.c.C.[Tomcat-1].[localhost].[/] : Initializing Spring DispatcherServlet 'dispatcherServlet'
2019-09-20 08:47:29.726 ERROR 1 --- [nio-8081-exec-5] o.h.engine.jdbc.spi.SqlExceptionHelper : HOUR_OF_DAY: 2 -> 3
2019-09-20 08:47:29.769 ERROR 1 --- [nio-8081-exec-5] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.orm.jpa.JpaSystemException: could not execute query; nested exception is org.hibernate.exception.GenericJDBCException: could not execute query] with root cause
java.lang.IllegalArgumentException: HOUR_OF_DAY: 2 -> 3
at java.base/java.util.GregorianCalendar.computeTime(Unknown Source) ~[na:na]
at java.base/java.util.Calendar.updateTime(Unknown Source) ~[na:na]
at java.base/java.util.Calendar.getTimeInMillis(Unknown Source) ~[na:na]
This problem has been solved at Java level, but how do I avoid it at mysql level.
In fact the query does not even have date or time.
@Query("select o from Order o where o.tickets is not null")
List<Order> ordersWithExistingTickets();
EDIT 1:
Order.java
@Entity
@Data
@Table(name="orders")
public class Order {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "PK")
private Long pk;
@Column(name = "createdTS")
private ZonedDateTime creationTime;
@Column(name = "tickets")
private String tickets;
public String getTickets() {
return tickets;
}
public void setTickets(String tickets) {
this.tickets = tickets;
}}
EDIT 2:
OrderRepository.java
@Repository
public interface OrderRepository extends JpaRepository<Order, Long> {
@Query("select o from Order o where o.tickets is not null")
List<Order> ordersWithExistingTickets();
}
Order
have a date/time field? Maybe a computated column? What is the query that is actually executed? – IndemnityOrder
has many date/time fields – Filibegjava.lang.IllegalArgumentException
- this is not even an sql exception,HOUR_OF_DAY
- this only exists in your java code, not in mysql. Again, not sure what you want to do about this in mysql. – Cargocal.setLenient(true)
– Filibegthrow new IllegalArgumentException(getFieldName(field) + ": " + s);
near the end ofGregorianCalendar.computeTime()
. It’s aome validation message, but I don’t understand what exactly it means nor why it happens. – BerrieInstant
generally, or as aOffsetDateTime
when retrieved via JDBC 4.2+, not aZonedDateTime
. – Meaghan