Announcement Announcement Module
Collapse
No announcement yet.
Spring Batch Admin 1.2.1 : Data truncation: Incorrect datetime value Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring Batch Admin 1.2.1 : Data truncation: Incorrect datetime value

    I have a Spring batch job using Spring Batch 2.1.7 and I'm running the sample app from Spring Batch Admin 1.2.1 on Weblogic 10.3.2. Database is MySQL 5.5.11

    Straight out of the box, the Spring Batch Admin app is giving this error when I click the 'Stop' button to stop my running job:

    Code:
    org.springframework.dao.DataIntegrityViolationException: PreparedStatementCallback; SQL [UPDATE BATCH_JOB_EXECUTION set START_TIME = ?, END_TIME = ?,  STATUS = ?, EXIT_CODE = ?, EXIT_MESSAGE = ?, VERSION = ?, CREATE_TIME = ?, LAST_UPDATED = ? where JOB_EXECUTION_ID = ? and VERSION = ?]; Data truncation: Incorrect datetime value: '' for column 'LAST_UPDATED' at row 1; nested exception is com.mysql.jdbc.MysqlDataTruncation: Data truncation: Incorrect datetime value: '' for column 'LAST_UPDATED' at row 1
    	at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:101)
    	at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72)
    	at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)
    	at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)
    	at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:602)
    	at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:811)
    	at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:867)
    	at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:871)
    	at org.springframework.batch.core.repository.dao.JdbcJobExecutionDao.updateJobExecution(JdbcJobExecutionDao.java:200)
    	at org.springframework.batch.core.repository.support.SimpleJobRepository.update(SimpleJobRepository.java:155)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    	at java.lang.reflect.Method.invoke(Method.java:597)
    	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
    	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
    	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
    	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
    	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
    	at $Proxy434.update(Unknown Source)
    	at org.springframework.batch.admin.service.SimpleJobService.stopAll(SimpleJobService.java:262)
    	at org.springframework.batch.admin.web.JobExecutionController.stopAll(JobExecutionController.java:266)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    	at java.lang.reflect.Method.invoke(Method.java:597)
    	at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:176)
    	at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:426)
    	at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:414)
    	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:790)
    	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)
    	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
    	at org.springframework.web.servlet.FrameworkServlet.doDelete(FrameworkServlet.java:582)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:733)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
    	at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
    	at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
    	at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
    	at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
    	at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    	at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:74)
    	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
    	at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    	at org.springframework.web.filter.ShallowEtagHeaderFilter.doFilterInternal(ShallowEtagHeaderFilter.java:58)
    	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
    	at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    	at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3592)
    	at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    	at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
    	at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2202)
    	at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2108)
    	at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1432)
    	at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
    	at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    Caused by: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Incorrect datetime value: '' for column 'LAST_UPDATED' at row 1
    	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2862)
    	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1567)
    	at com.mysql.jdbc.ServerPreparedStatement.serverExecute(ServerPreparedStatement.java:1154)
    	at com.mysql.jdbc.ServerPreparedStatement.executeInternal(ServerPreparedStatement.java:679)
    	at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1394)
    	at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1308)
    	at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1293)
    	at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:102)
    	at org.springframework.jdbc.core.JdbcTemplate$2.doInPreparedStatement(JdbcTemplate.java:817)
    	at org.springframework.jdbc.core.JdbcTemplate$2.doInPreparedStatement(JdbcTemplate.java:1)
    	at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:586)
    	... 50 more
    I'm about to step through the Spring Batch Admin code to see where it's missing the date value. I this a known issue? I searched the forum and didn't find any similar posts, so I'm assuming there's either an issue with the MySQL creation scripts or the SQL to update the tables?

    Thanks, Kevin

  • #2
    Originally posted by khooke View Post
    I have a Spring batch job using Spring Batch 2.1.7 and I'm running the sample app from Spring Batch Admin 1.2.1 on Weblogic 10.3.2. Database is MySQL 5.5.11

    Straight out of the box, the Spring Batch Admin app is giving this error when I click the 'Stop' button to stop my running job:

    Code:
    Caused by: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Incorrect datetime value: '' for column 'LAST_UPDATED' at row 1
    	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2862)
    	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1567)
    	at com.mysql.jdbc.ServerPreparedStatement.serverExecute(ServerPreparedStatement.java:1154)
    	at com.mysql.jdbc.ServerPreparedStatement.executeInternal(ServerPreparedStatement.java:679)
    	at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1394)
    	at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1308)
    	at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1293)
    	at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:102)
    	at org.springframework.jdbc.core.JdbcTemplate$2.doInPreparedStatement(JdbcTemplate.java:817)
    	at org.springframework.jdbc.core.JdbcTemplate$2.doInPreparedStatement(JdbcTemplate.java:1)
    	at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:586)
    	... 50 more
    Stepping through the code I can see that JobExecution does have a value for lastUpdated property, but somewhere after that point it disappears (according to the error above, I couldn't find exactly where, but it's not in Spring Batch or the Admin app code). I suspect this is an issue with either this version of MySQL or the MySQL Connector driver (5.1.24) and nothing to do with Spring Batch Admin.

    I ran my job and Spring Batch Admin against Oracle 11g Express locally and it works fine.

    Comment

    Working...
    X