Data truncation: Incorrect datetime value: ” for column 2

While using Acitiviti API you might encounter this error which says something like this

### Error updating database. Cause: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Incorrect datetime value: ” for column ‘DEPLOY_TIME_’ at row 1
### The error may involve org.activiti.engine.impl.persistence.entity.DeploymentEntity.insertDeployment-Inline
### The error occurred while setting parameters
### Cause: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Incorrect datetime value: ” for column ‘DEPLOY_TIME_’ at row 1
at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:8)
at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:124)
at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:111)
at org.activiti.engine.impl.db.DbSqlSession.flushInserts(DbSqlSession.java:632)
at org.activiti.engine.impl.db.DbSqlSession.flush(DbSqlSession.java:459)
at org.activiti.engine.impl.interceptor.CommandContext.flushSessions(CommandContext.java:167)
at org.activiti.engine.impl.interceptor.CommandContext.close(CommandContext.java:114)
at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:69)
at org.activiti.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:42)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:131)
at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:40)
at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:32)
at org.activiti.engine.impl.RepositoryServiceImpl.deploy(RepositoryServiceImpl.java:68)
at org.activiti.engine.impl.repository.DeploymentBuilderImpl.deploy(DeploymentBuilderImpl.java:119)
at net.pe.spring.controller.ClientController.adminWorkflowPost(ClientController.java:603)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

…..

Fix : upgrade MySQL connector JAR, and copy the same mysql.jar to the Tomcat lib directory.

5/5 - (1 vote)

2 thoughts on “Data truncation: Incorrect datetime value: ” for column

  1. Reply Emerson Langie Apr 4,2016 11:13 pm

    You saved my day!
    Thanks a bunch!
    Cheers

Leave a Reply