Hi,

I am having problems while using the CURDATE() function with MySQL and Database plugins. I am trying to update a database with values one of which is the current date & year. If I add the value as absolute values, it works. If I try to use the CURDATE() function in the INSERT statement I get errors. Surprisingly the SQL statement works if I run it on the server directly. Pls advise what I need to do.

Here's the dump -

Apr 23, 2011 6:21:25 PM org.joget.plugin.etl.MySqlPlugin execute
WARNING: Error executing plugin
java.sql.SQLException: Data truncated for column 'Year1' at row 1
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2975)
        at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1600)
        at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1695)
        at com.mysql.jdbc.Connection.execSQL(Connection.java:3020)
        at com.mysql.jdbc.Connection.execSQL(Connection.java:2949)
        at com.mysql.jdbc.Statement.execute(Statement.java:538)
        at org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStateme
nt.java:264)
        at org.joget.plugin.etl.MySqlPlugin.executeQuery(MySqlPlugin.java:106)
        at org.joget.plugin.etl.MySqlPlugin.execute(MySqlPlugin.java:86)
        at org.joget.workflow.shark.WorkflowToolActivityHandler.executeActivity(
WorkflowToolActivityHandler.java:88)
        at org.enhydra.shark.WfActivityImpl.runTool(WfActivityImpl.java:1487)
        at org.enhydra.shark.WfActivityImpl.startActivity(WfActivityImpl.java:14
19)
        at org.enhydra.shark.WfActivityImpl.activate(WfActivityImpl.java:261)
        at org.enhydra.shark.WfProcessImpl.startActivity(WfProcessImpl.java:918)

        at org.enhydra.shark.WfProcessImpl.queueNext(WfProcessImpl.java:1134)
        at org.enhydra.shark.WfProcessImpl.run(WfProcessImpl.java:750)
        at org.enhydra.shark.WfProcessImpl.activity_complete(WfProcessImpl.java:
969)
        at org.enhydra.shark.WfActivityImpl.finish(WfActivityImpl.java:441)
        at org.enhydra.shark.WfActivityImpl.complete(WfActivityImpl.java:366)
        at org.enhydra.shark.WfActivityWrapper.complete(WfActivityWrapper.java:2
30)
        at org.joget.workflow.model.service.WorkflowManagerImpl.assignmentComple
te(WorkflowManagerImpl.java:4560)
        at sun.reflect.GeneratedMethodAccessor349.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflecti
on(AopUtils.java:310)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJo
inpoint(ReflectiveMethodInvocation.java:182)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(
ReflectiveMethodInvocation.java:149)
        at org.springframework.transaction.interceptor.TransactionInterceptor.in
voke(TransactionInterceptor.java:106)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(
ReflectiveMethodInvocation.java:171)
        at org.springframework.transaction.interceptor.TransactionInterceptor.in
voke(TransactionInterceptor.java:106)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(
ReflectiveMethodInvocation.java:171)
        at org.joget.workflow.util.AuditTrailInterceptor.invoke(AuditTrailInterc
eptor.java:21)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(
ReflectiveMethodInvocation.java:171)
        at org.joget.workflow.util.AuditTrailInterceptor.invoke(AuditTrailInterc
eptor.java:21)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(
ReflectiveMethodInvocation.java:171)
        at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invok
e(ExposeInvocationInterceptor.java:89)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(
ReflectiveMethodInvocation.java:171)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynami
cAopProxy.java:204)
        at $Proxy9.assignmentComplete(Unknown Source)
        at org.joget.workflow.model.WorkflowFacade.assignmentComplete(WorkflowFa
cade.java:465)
        at org.joget.workflow.controller.WorkflowJsonController.assignmentComple
te(WorkflowJsonController.java:1224)
        at sun.reflect.GeneratedMethodAccessor339.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.
doInvokeMethod(HandlerMethodInvoker.java:413)
        at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.
invokeHandlerMethod(HandlerMethodInvoker.java:134)
        at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandle
rAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:310)
        at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandle
rAdapter.handle(AnnotationMethodHandlerAdapter.java:297)
        at org.joget.commons.spring.web.ParameterizedAnnotationMethodHandlerAdap
ter.handle(ParameterizedAnnotationMethodHandlerAdapter.java:28)
        at org.springframework.web.servlet.DispatcherServlet.doDispatch(Dispatch
erServlet.java:875)
        at org.springframework.web.servlet.DispatcherServlet.doService(Dispatche
rServlet.java:809)
        at org.springframework.web.servlet.FrameworkServlet.processRequest(Frame
workServlet.java:571)
        at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServ
let.java:511)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:206)
        at org.springframework.security.util.FilterChainProxy$VirtualFilterChain
.doFilter(FilterChainProxy.java:359)
        at org.springframework.security.intercept.web.FilterSecurityInterceptor.
invoke(FilterSecurityInterceptor.java:109)
        at org.springframework.security.intercept.web.FilterSecurityInterceptor.
doFilter(FilterSecurityInterceptor.java:83)
        at org.springframework.security.util.FilterChainProxy$VirtualFilterChain
.doFilter(FilterChainProxy.java:371)
        at org.springframework.security.ui.SessionFixationProtectionFilter.doFil
terHttp(SessionFixationProtectionFilter.java:67)
        at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringS
ecurityFilter.java:53)
        at org.springframework.security.util.FilterChainProxy$VirtualFilterChain
.doFilter(FilterChainProxy.java:371)
        at org.joget.workflow.security.WorkflowNtlmProcessingFilter.doFilterHttp
(WorkflowNtlmProcessingFilter.java:52)
        at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringS
ecurityFilter.java:53)
        at org.springframework.security.util.FilterChainProxy$VirtualFilterChain
.doFilter(FilterChainProxy.java:371)
        at org.springframework.security.ui.ExceptionTranslationFilter.doFilterHt
tp(ExceptionTranslationFilter.java:101)
        at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringS
ecurityFilter.java:53)
        at org.springframework.security.util.FilterChainProxy$VirtualFilterChain
.doFilter(FilterChainProxy.java:371)
        at org.springframework.security.providers.anonymous.AnonymousProcessingF
ilter.doFilterHttp(AnonymousProcessingFilter.java:105)
        at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringS
ecurityFilter.java:53)
        at org.springframework.security.util.FilterChainProxy$VirtualFilterChain
.doFilter(FilterChainProxy.java:371)
        at org.springframework.security.ui.AbstractProcessingFilter.doFilterHttp
(AbstractProcessingFilter.java:271)
        at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringS
ecurityFilter.java:53)
        at org.springframework.security.util.FilterChainProxy$VirtualFilterChain
.doFilter(FilterChainProxy.java:371)
        at org.springframework.security.ui.AbstractProcessingFilter.doFilterHttp
(AbstractProcessingFilter.java:271)
        at org.joget.workflow.security.WorkflowHttpAuthProcessingFilter.doFilter
Http(WorkflowHttpAuthProcessingFilter.java:39)
        at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringS
ecurityFilter.java:53)
        at org.springframework.security.util.FilterChainProxy$VirtualFilterChain
.doFilter(FilterChainProxy.java:371)
        at org.springframework.security.ui.logout.LogoutFilter.doFilterHttp(Logo
utFilter.java:89)
        at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringS
ecurityFilter.java:53)
        at org.springframework.security.util.FilterChainProxy$VirtualFilterChain
.doFilter(FilterChainProxy.java:371)
        at org.springframework.security.context.HttpSessionContextIntegrationFil
ter.doFilterHttp(HttpSessionContextIntegrationFilter.java:235)
        at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringS
ecurityFilter.java:53)
        at org.springframework.security.util.FilterChainProxy$VirtualFilterChain
.doFilter(FilterChainProxy.java:371)
        at org.springframework.security.util.FilterChainProxy.doFilter(FilterCha
inProxy.java:174)
        at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(D
elegatingFilterProxy.java:236)
        at org.springframework.web.filter.DelegatingFilterProxy.doFilter(Delegat
ingFilterProxy.java:167)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:206)
        at org.springframework.web.filter.CharacterEncodingFilter.doFilterIntern
al(CharacterEncodingFilter.java:96)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerR
equestFilter.java:76)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:233)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:191)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:128)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
ava:102)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
ve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
a:286)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
:845)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
ss(Http11Protocol.java:583)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:44
7)
        at java.lang.Thread.run(Thread.java:619)
WARN  23 Apr 2011 18:21:25 org.joget.workflow.shark.WorkflowToolActivityHandler
 - Plugin not mapped for [processId=SBAS_Article_Published_Upload#2#Article_Publ
ished_Upload, version= 2, activityId=Article_Published_Upload_act4]
INFO  23 Apr 2011 18:21:25 org.joget.workflow.controller.WorkflowJsonController
 - Assignment 1210_1028_SBAS_Article_Published_Upload_Article_Published_Upload_A
rticle_Published_Upload_act2 completed

1 Comment

  1. Hi,

    java.sql.SQLException: Data truncated for column 'Year1' at row 1

    Is there any chance that your column type is not of the appropriate type since data get trimmed off?

    Hope it helps.