[OpenVPMS Developers] [JIRA] Created: (OVPMS-1006) Data truncation: Incorrect datetime value: '20100-12-01 00:00:00' for column 'activity_start_time'
Data truncation: Incorrect datetime value: '20100-12-01 00:00:00' for column 'activity_start_time' ---------------------------------------------------------------------------------------------------
Key: OVPMS-1006 URL: https://openvpms.atlassian.net/browse/OVPMS-1006 Project: VPMS Web Application Issue Type: Bug Components: General Affects Versions: 1.4 Reporter: Tim Anderson Assignee: Tony De Keizer
From a 1.4 error report: {noformat} Caused by: org.springframework.dao.DataIntegrityViolationException: Hibernate operation: could not insert: [org.openvpms.component.business.dao.hibernate.im.act.ParticipationDOImpl]; SQL [insert into participations (version, linkId, arch_short_name, arch_version, name, description, active, act_arch_short_name, entity_id, act_id, activity_start_time, activity_end_time) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)]; Data truncation: Incorrect datetime value: '20100-12-01 00:00:00' for column 'activity_start_time' at row 1; nested exception is com.mysql.jdbc.MysqlDataTruncation: Data truncation: Incorrect datetime value: '20100-12-01 00:00:00' for column 'activity_start_time' at row 1 {noformat}
This is caused by a user entering an invalid date '20100-12-01' and trying to save it. Easiest way to avoid it would be to reject all dates that don't fit within a time period, eg. 1970 -> now + 100
The complete stack trace: {noformat} org.openvpms.component.business.service.archetype.ArchetypeServiceException: Failed to save object Act[id=-1,archetypeId=act.patientClinicalEvent.1.0,linkId=16e32079-fd32-11df-814c-27b2f67653ab,version=0,name=Visit,title=,activityStartTime=Wed Dec 01 00:00:00 EST 20100,activityEndTime=,reason=,status=COMPLETED,participations=[Participation[id=-1,archetypeId=participation.patient.1.0,linkId=16e3207a-fd32-11df-814c-27b2f67653ab,version=0,name=], Participation[id=-1,archetypeId=participation.clinician.1.0,linkId=16e3207b-fd32-11df-814c-27b2f67653ab,version=0,name=]],sourceActRelationships=[],targetActRelationships=[]] at org.openvpms.component.business.service.archetype.ArchetypeService.save(ArchetypeService.java:499) at sun.reflect.GeneratedMethodAccessor408.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:292) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:163) at $Proxy1.save(Unknown Source) at sun.reflect.GeneratedMethodAccessor408.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:292) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:155) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:122) at org.acegisecurity.intercept.method.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:80) at org.openvpms.component.business.service.security.OpenVPMSMethodSecurityInterceptor.invoke(OpenVPMSMethodSecurityInterceptor.java:50) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:174) at $Proxy2.save(Unknown Source) at org.openvpms.component.business.service.archetype.rule.ArchetypeRuleService$1.run(ArchetypeRuleService.java:308) at org.openvpms.component.business.service.archetype.rule.ArchetypeRuleService$4.doInTransaction(ArchetypeRuleService.java:507) at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:114) at org.openvpms.component.business.service.archetype.rule.ArchetypeRuleService.execute(ArchetypeRuleService.java:504) at org.openvpms.component.business.service.archetype.rule.ArchetypeRuleService.save(ArchetypeRuleService.java:306) at org.openvpms.component.business.service.archetype.rule.ArchetypeRuleService.save(ArchetypeRuleService.java:276) at org.openvpms.web.app.customer.charge.CustomerChargeActEditor.createClinicalEvents(CustomerChargeActEditor.java:92) at org.openvpms.web.app.customer.charge.CustomerInvoiceEditDialog.doSave(CustomerInvoiceEditDialog.java:54) at org.openvpms.web.component.im.edit.EditDialog.save(EditDialog.java:202) at org.openvpms.web.component.im.edit.EditDialog.onOK(EditDialog.java:173) at org.openvpms.web.component.dialog.PopupDialog.onButton(PopupDialog.java:201) at org.openvpms.web.component.dialog.PopupDialog$2.onAction(PopupDialog.java:310) at org.openvpms.web.component.event.ActionListener.actionPerformed(ActionListener.java:41) at nextapp.echo2.app.button.AbstractButton.fireActionPerformed(AbstractButton.java:135) at echopointng.ButtonEx$1.actionPerformed(ButtonEx.java:120) at nextapp.echo2.app.button.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:70) at echopointng.model.DefaultButtonModelEx.doAction(DefaultButtonModelEx.java:51) at echopointng.ButtonEx.processInput(ButtonEx.java:202) at nextapp.echo2.app.update.ClientUpdateManager.process(ClientUpdateManager.java:116) at nextapp.echo2.app.update.UpdateManager.processClientUpdates(UpdateManager.java:89) at nextapp.echo2.webcontainer.ContainerSynchronizeService.renderUpdate(ContainerSynchronizeService.java:472) at nextapp.echo2.webrender.service.SynchronizeService.service(SynchronizeService.java:279) at nextapp.echo2.webrender.WebRenderServlet.process(WebRenderServlet.java:273) at org.openvpms.web.servlet.SpringWebContainerServlet.process(SpringWebContainerServlet.java:148) at nextapp.echo2.webrender.WebRenderServlet.doPost(WebRenderServlet.java:189) at javax.servlet.http.HttpServlet.service(HttpServlet.java:709) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:292) at org.openvpms.web.servlet.SkipLoginFilter.doFilter(SkipLoginFilter.java:111) at org.openvpms.web.servlet.SkipLoginFilter.doFilter(SkipLoginFilter.java:71) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303) at org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:108) at org.acegisecurity.intercept.web.SecurityEnforcementFilter.doFilter(SecurityEnforcementFilter.java:197) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303) at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:143) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303) at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:246) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303) at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:220) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303) at org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:173) at org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:120) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) at java.lang.Thread.run(Unknown Source) Caused by: org.openvpms.component.business.dao.im.common.IMObjectDAOException: Failed to save IMObject -1 at org.openvpms.component.business.dao.hibernate.im.IMObjectDAOHibernate.save(IMObjectDAOHibernate.java:164) at org.openvpms.component.business.service.archetype.ArchetypeService.save(ArchetypeService.java:492) ... 75 more Caused by: org.springframework.dao.DataIntegrityViolationException: Hibernate operation: could not insert: [org.openvpms.component.business.dao.hibernate.im.act.ParticipationDOImpl]; SQL [insert into participations (version, linkId, arch_short_name, arch_version, name, description, active, act_arch_short_name, entity_id, act_id, activity_start_time, activity_end_time) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)]; Data truncation: Incorrect datetime value: '20100-12-01 00:00:00' for column 'activity_start_time' at row 1; nested exception is com.mysql.jdbc.MysqlDataTruncation: Data truncation: Incorrect datetime value: '20100-12-01 00:00:00' for column 'activity_start_time' at row 1 at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.translate(SQLStateSQLExceptionTranslator.java:91) at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.translate(SQLErrorCodeSQLExceptionTranslator.java:257) at org.springframework.orm.hibernate3.HibernateAccessor.convertJdbcAccessException(HibernateAccessor.java:424) at org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:411) at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:363) at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:331) at org.openvpms.component.business.dao.hibernate.im.IMObjectDAOHibernate$9$1.doInHibernate(IMObjectDAOHibernate.java:1094) at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:358) at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:331) at org.openvpms.component.business.dao.hibernate.im.IMObjectDAOHibernate$9.doInTransaction(IMObjectDAOHibernate.java:1090) at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:114) at org.openvpms.component.business.dao.hibernate.im.IMObjectDAOHibernate.update(IMObjectDAOHibernate.java:1088) at org.openvpms.component.business.dao.hibernate.im.IMObjectDAOHibernate.save(IMObjectDAOHibernate.java:156) ... 76 more Caused by: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Incorrect datetime value: '20100-12-01 00:00:00' for column 'activity_start_time' at row 1 at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3374) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3308) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1837) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1961) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2543) at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1737) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2022) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1940) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1925) at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:101) at org.hibernate.id.IdentityGenerator$GetGeneratedKeysDelegate.executeAndExtract(IdentityGenerator.java:73) at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:33) at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2163) at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2643) at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:51) at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279) at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:298) at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:181) at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:107) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:187) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:172) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:94) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70) at org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl.java:507) at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:499) at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:495) at org.openvpms.component.business.dao.hibernate.im.IMObjectDAOHibernate.save(IMObjectDAOHibernate.java:999) at org.openvpms.component.business.dao.hibernate.im.IMObjectDAOHibernate.save(IMObjectDAOHibernate.java:889) at org.openvpms.component.business.dao.hibernate.im.IMObjectDAOHibernate.save(IMObjectDAOHibernate.java:871) at org.openvpms.component.business.dao.hibernate.im.IMObjectDAOHibernate.access$000(IMObjectDAOHibernate.java:91) at org.openvpms.component.business.dao.hibernate.im.IMObjectDAOHibernate$1.doInHibernate(IMObjectDAOHibernate.java:159) at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:358) ... 84 more {noformat}
-- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: https://openvpms.atlassian.net/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
_______________________________________________ OpenVPMS Developers Mailing List developers@lists.openvpms.org To unsubscribe or change your subscription visit: http://lists.openvpms.org/listinfo/developers Posts from this mailing list can be viewed online and replied to in the OpenVPMS Developer's forum- http://tinyurl.com/openvdf