Uploaded image for project: 'Kogito'
  1. Kogito
  2. KOGITO-6463

kogito process can't handle Java 8 date/time types with Jackson

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major
    • None
    • 1.14.0.Final
    • Core Engine
    • None
    • False
    • False

      If you define a Pojo attribute of type java.time.LocalDate and use it in your Process definition you get the followinf error trying to start a new process instance on Kogito:

      2021-12-21 15:51:51,507 ERROR [org.jbp.wor.ins.imp.WorkflowProcessInstanceImpl] (executor-thread-0) Unexpected error (id 25975478-0035-4751-a6cd-f463c9c64f5c) while executing node Determine Next Question in process instance 0558ff88-ff43-421e-a324-4cdb60949a1a: org.jbpm.workflow.instance.WorkflowRuntimeException: [DynamicQA_decision_workflow:0558ff88-ff43-421e-a324-4cdb60949a1a - Determine Next Question:5] -- Java 8 date/time type `java.time.LocalDate` not supported by default: add Module "com.fasterxml.jackson.datatype:jackson-datatype-jsr310" to enable handling (through reference chain: java.util.HashMap["Person"]->com.redhat.demos.dynamicqa.model.Person["dob"])
              at org.jbpm.workflow.instance.node.RuleSetNodeInstance.handleException(RuleSetNodeInstance.java:224)
              at org.jbpm.workflow.instance.node.RuleSetNodeInstance.internalTrigger(RuleSetNodeInstance.java:206)
              at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:209)
              at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerNodeInstance(NodeInstanceImpl.java:406)
              at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerNodeInstance(NodeInstanceImpl.java:391)
              at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerCompleted(NodeInstanceImpl.java:361)
              at org.jbpm.workflow.instance.node.ActionNodeInstance.triggerCompleted(ActionNodeInstance.java:86)
              at org.jbpm.workflow.instance.node.ActionNodeInstance.internalTrigger(ActionNodeInstance.java:64)
              at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:209)
              at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerNodeInstance(NodeInstanceImpl.java:406)
              at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerNodeInstance(NodeInstanceImpl.java:391)
              at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerCompleted(NodeInstanceImpl.java:361)
              at org.jbpm.workflow.instance.node.StartNodeInstance.triggerCompleted(StartNodeInstance.java:74)
              at org.jbpm.workflow.instance.node.StartNodeInstance.internalTrigger(StartNodeInstance.java:46)
              at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:209)
              at org.jbpm.ruleflow.instance.RuleFlowProcessInstance.internalStart(RuleFlowProcessInstance.java:36)
              at org.jbpm.process.instance.impl.ProcessInstanceImpl.start(ProcessInstanceImpl.java:240)
              at org.jbpm.workflow.instance.impl.WorkflowProcessInstanceImpl.start(WorkflowProcessInstanceImpl.java:496)
              at org.jbpm.process.instance.KogitoProcessRuntimeImpl.startProcessInstance(KogitoProcessRuntimeImpl.java:167)
              at org.jbpm.process.instance.KogitoProcessRuntimeImpl.startProcessInstance(KogitoProcessRuntimeImpl.java:73)
              at org.kie.kogito.process.impl.AbstractProcessInstance.start(AbstractProcessInstance.java:232)
              at org.kie.kogito.process.impl.AbstractProcessInstance.start(AbstractProcessInstance.java:213)
              at org.jbpm.workflow.instance.node.LambdaSubProcessNodeInstance.internalTrigger(LambdaSubProcessNodeInstance.java:96)
              at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:209)
              at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerNodeInstance(NodeInstanceImpl.java:406)
              at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerNodeInstance(NodeInstanceImpl.java:391)
              at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerCompleted(NodeInstanceImpl.java:361)
              at org.jbpm.workflow.instance.node.JoinInstance.triggerCompleted(JoinInstance.java:269)
              at org.jbpm.workflow.instance.node.JoinInstance.internalTrigger(JoinInstance.java:133)
              at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:209)
              at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerNodeInstance(NodeInstanceImpl.java:406)
              at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerNodeInstance(NodeInstanceImpl.java:391)
              at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerCompleted(NodeInstanceImpl.java:361)
              at org.jbpm.workflow.instance.node.ActionNodeInstance.triggerCompleted(ActionNodeInstance.java:86)
              at org.jbpm.workflow.instance.node.ActionNodeInstance.internalTrigger(ActionNodeInstance.java:64)
              at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:209)
              at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerNodeInstance(NodeInstanceImpl.java:406)
              at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerNodeInstance(NodeInstanceImpl.java:391)
              at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerCompleted(NodeInstanceImpl.java:361)
              at org.jbpm.workflow.instance.node.StartNodeInstance.triggerCompleted(StartNodeInstance.java:74)
              at org.jbpm.workflow.instance.node.StartNodeInstance.internalTrigger(StartNodeInstance.java:46)
              at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:209)
              at org.jbpm.ruleflow.instance.RuleFlowProcessInstance.internalStart(RuleFlowProcessInstance.java:36)
              at org.jbpm.process.instance.impl.ProcessInstanceImpl.start(ProcessInstanceImpl.java:240)
              at org.jbpm.workflow.instance.impl.WorkflowProcessInstanceImpl.start(WorkflowProcessInstanceImpl.java:496)
              at org.jbpm.process.instance.KogitoProcessRuntimeImpl.startProcessInstance(KogitoProcessRuntimeImpl.java:167)
              at org.jbpm.process.instance.KogitoProcessRuntimeImpl.startProcessInstance(KogitoProcessRuntimeImpl.java:73)
              at org.kie.kogito.process.impl.AbstractProcessInstance.start(AbstractProcessInstance.java:232)
              at org.kie.kogito.process.impl.AbstractProcessInstance.start(AbstractProcessInstance.java:213)
              at org.kie.kogito.process.impl.ProcessServiceImpl.lambda$createProcessInstance$0(ProcessServiceImpl.java:64)
              at org.kie.kogito.services.uow.UnitOfWorkExecutor.executeInUnitOfWork(UnitOfWorkExecutor.java:33)
              at org.kie.kogito.process.impl.ProcessServiceImpl.createProcessInstance(ProcessServiceImpl.java:59)
              at com.redhat.demos.process.DynamicQA_workflowResource.createResource_DynamicQA_workflow(DynamicQA_workflowResource.java:71)
              at com.redhat.demos.process.DynamicQA_workflowResource_Subclass.createResource_DynamicQA_workflow$$superforward1(DynamicQA_workflowResource_Subclass.zig:2300)
              at com.redhat.demos.process.DynamicQA_workflowResource_Subclass$$function$$68.apply(DynamicQA_workflowResource_Subclass$$function$$68.zig:53)
              at io.quarkus.arc.impl.AroundInvokeInvocationContext.proceed(AroundInvokeInvocationContext.java:54)
              at io.quarkus.arc.runtime.devconsole.InvocationInterceptor.proceed(InvocationInterceptor.java:62)
              at io.quarkus.arc.runtime.devconsole.InvocationInterceptor.monitor(InvocationInterceptor.java:49)
              at io.quarkus.arc.runtime.devconsole.InvocationInterceptor_Bean.intercept(InvocationInterceptor_Bean.zig:516)
              at io.quarkus.arc.impl.InterceptorInvocation.invoke(InterceptorInvocation.java:41)
              at io.quarkus.arc.impl.AroundInvokeInvocationContext.perform(AroundInvokeInvocationContext.java:41)
              at io.quarkus.arc.impl.InvocationContexts.performAroundInvoke(InvocationContexts.java:32)
              at com.redhat.demos.process.DynamicQA_workflowResource_Subclass.createResource_DynamicQA_workflow(DynamicQA_workflowResource_Subclass.zig:5624)
              at com.redhat.demos.process.DynamicQA_workflowResource_ClientProxy.createResource_DynamicQA_workflow(DynamicQA_workflowResource_ClientProxy.zig:1011)
              at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
              at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.base/java.lang.reflect.Method.invoke(Method.java:566)
              at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:170)
              at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:130)
              at org.jboss.resteasy.core.ResourceMethodInvoker.internalInvokeOnTarget(ResourceMethodInvoker.java:660)
              at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTargetAfterFilter(ResourceMethodInvoker.java:524)
              at org.jboeasy.core.ResourceMethodInvoker.lambda$invokeOnTarget$2(ResourceMethodInvoker.java:474)
              at org.jboss.resteasy.core.interception.jaxrs.PreMatchContainerRequestContext.filter(PreMatchContainerRequestContext.java:364)
              at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTarget(ResourceMethodInvoker.java:476)
              at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:434)
              at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:408)
              at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:69)
              at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:492)
              at org.jboss.resteasy.core.SynchronousDispatcher.lambda$invoke$4(SynchronousDispatcher.java:261)
              at org.jboss.resteasy.core.SynchronousDispatcher.lambda$preprocess$0(SynchronousDispatcher.java:161)
              at org.jboss.resteasy.core.interception.jaxrs.PreMatchContainerRequestContext.filter(PreMatchContainerRequestContext.java:364)
              at org.jboss.resteasy.core.SynchronousDispatcher.preprocess(SynchronousDispatcher.java:164)
              at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:247)
              at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:249)
              at io.quarkus.resteasy.runtime.ResteasyFilter.doFilter(ResteasyFilter.java:35)
              at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
              at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
              at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84)
              at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:63)
              at io.undertow.servlet.handlers.ServletChain$1.handleRequest(ServletChain.java:68)
              at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
              at io.undertow.servlet.handlers.RedirectDirHandler.handleRequest(RedirectDirHandler.java:67)
              at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:133)
              at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)
              at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
              at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)
              at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:65)
              at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)
              at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)
              at io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)
              at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)
              at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
              at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
              at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:247)
              at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:56)
              at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:111)
              at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:108)
              at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48)
              at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
              at io.quarkus.undertow.runtime.UndertowDeploymentRecorder$9$1.call(UndertowDeploymentRecorder.java:590)
              at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:227)
              at io.undertow.servlet.handlers.ServletInitialHandler.handleRequest(ServletInitialHandler.java:152)
              at io.quarkus.undertow.runtime.UndertowDeploymentRecorder$1.handleRequest(UndertowDeploymentRecorder.java:119)
              at io.undertow.server.Connectors.executeRootHandler(Connectors.java:290)
              at io.undertow.server.DefaultExchangeHandler.handle(DefaultExchangeHandler.java:18)
              at io.quarkus.undertow.runtime.UndertowDeploymentRecorder$5$1.run(UndertowDeploymentRecorder.java:412)
              at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
              at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
              at io.quarkus.vertx.core.runtime.VertxCoreRecorder$13.runWith(VertxCoreRecorder.java:543)
              at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2449)
              at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1478)
              at org.jboss.threads.DelegatingRunnable.run(DelegatingRunnable.java:29)
              at org.jboss.threads.ThreadLocalResettingRunnable.run(ThreadLocalResettingRunnable.java:29)
              at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
              at java.base/java.lang.Thread.run(Thread.java:834)
      Caused by: java.lang.IllegalArgumentException: Java 8 date/time type `java.time.LocalDate` not supported by default: add Module "com.fasterxml.jackson.datatype:jackson-datatype-jsr310" to enable handling (through reference chain: java.util.HashMap["Person"]->com.redhat.demos.dynamicqa.model.Person["dob"])
              at com.fasterxml.jackson.databind.ObjectMapper._convert(ObjectMapper.java:4314)
              at com.fasterxml.jackson.databind.ObjectMapper.convertValue(ObjectMapper.java:4245)
              at org.jbpm.process.core.transformation.JsonResolver.lambda$resolveAll$3(JsonResolver.java:77)
              at java.base/java.util.Optional.map(Optional.java:265)
              at org.jbpm.process.core.transformation.JsonResolver.resolveAll(JsonResolver.java:77)
              at org.jbpm.workflow.instance.node.RuleSetNodeInstance.internalTrigger(RuleSetNodeInstance.java:141)
              ... 124 more
      Caused by: com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Java 8 date/time type `java.time.LocalDate` not supported by default: add Module "com.fasterxml.jackson.datatype:jackson-datatype-jsr310" to enable handling (through reference chain: java.util.HashMap["Person"]->com.redhat.demos.dynamicqa.model.Person["dob"])
              at com.fasterxml.jackson.databind.exc.InvalidDefinitionException.from(InvalidDefinitionException.java:77)
              at com.fasterxml.jackson.databind.SerializerProvider.reportBadDefinition(SerializerProvider.java:1276)
              at com.fasterxml.jackson.databind.ser.impl.UnsupportedTypeSerializer.serialize(UnsupportedTypeSerializer.java:35)
              at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:728)
              at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:770)
              at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:178)
              at com.fasterxml.jackson.databind.ser.std.MapSerializer.serializeOptionalFields(MapSerializer.java:869)
              at com.fasterxml.jackson.databind.ser.std.MapSerializer.serializeWithoutTypeInfo(MapSerializer.java:760)
              at com.fasterxml.jackson.databind.ser.std.MapSerializer.serialize(MapSerializer.java:720)
              at com.fasterxml.jackson.databind.ser.std.MapSerializer.serialize(MapSerializer.java:35)
              at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider._serialize(DefaultSerializerProvider.java:480)
              at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:319)
              at com.fasterxml.jackson.databind.ObjectMapper._convert(ObjectMapper.java:4292)
              ... 129 more 

              cnicolai@redhat.com Cristiano Nicolai (Inactive)
              rafael.soares Rafael Soares
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: