Jackson, Rest-Easy problem with passing in external objects

225 views
Skip to first unread message

David Goldstein

unread,
Feb 10, 2021, 10:53:54 AM2/10/21
to jBPM Usage
I have been encountering an issue for about a week where I cannot pass in external objects to PAM 7.9/JBPM 7.44 on JBoss EAP 7.3.   I am using REST with RestEasy to to connect to the KieClient.    This produces a warning about disabling JsonB so I have set

<property name="resteasy.preferJacksonOverJsonB" value="false"/>

Regardless of whether I define my external object (AmsUser) in a JAR that I import or as a data object in Business Central I get:

10:33:57,841 WARN  [org.drools.persistence.PersistableRunner] (default task-28) Could not commit session: org.jbpm.workflow.instance.WorkflowRuntimeException: [DocumentSigner:20,665 - Setp Up:3] -- java.base/java.util.LinkedHashMap cannot be cast to <<mycompany>>.AmsUser

which seems to be a Jackson error where it does not know how to parse the JSON map of parameters that contains an AmsUser POJO that is to be assigned to a global variable.  Because this is on the start of the process either I have a configuration issue or this is a bug:

is the work around passing the JSON string in and using a Java Service Task to parse the String and assign to the process variable?  Or what is the configuration issue?  

I do see two xstream JARs in my Business Central war:

xstream-1.4.11.1-redhat-00001.jar
xstream-1.4.14.redhat-00001.jar

and 2 common collections in kie-server.war:

commons-collections-3.2.2.redhat-2.jar
commons-collections4-4.4.jar

I have also revised some of the code in the jbpm-human-task jar's .... but this is occuring on process startup - and only with my external classes as parameters that are passed to the process.

I also have the following Jackson and marshalling related issues in the log:

/C:/DGGInstalls/RHPAM/jboss-eap-7.3/standalone/deployments/kie-server.war/WEB-INF/lib/c3p0-0.9.5.4.jar  does not point to a valid jar for a Class-Path reference.
2021-02-10 08:37:10,836 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-1) WFLYSRV0059: Class Path entry jaxb-api.jar in /C:/DGGInstalls/RHPAM/jboss-eap-7.3/standalone/deployments/kie-server.war/WEB-INF/lib/jaxb-core-2.3.0.redhat-1.jar  does not point to a valid jar for a Class-Path reference.
2021-02-10 08:37:10,843 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-1) WFLYSRV0059: Class Path entry jaxb-core.jar in /C:/DGGInstalls/RHPAM/jboss-eap-7.3/standalone/deployments/kie-server.war/WEB-INF/lib/jaxb-impl-2.3.0.redhat-1.jar  does not point to a valid jar for a Class-Path reference.
2021-02-10 08:37:10,858 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-1) WFLYSRV0059: Class Path entry jaxb-core.jar in /C:/DGGInstalls/RHPAM/jboss-eap-7.3/standalone/deployments/kie-server.war/WEB-INF/lib/jaxb-xjc-2.3.0.redhat-1.jar  does not point to a valid jar for a Class-Path reference.
2021-02-10 08:37:10,858 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-1) WFLYSRV0059: Class Path entry jaxb-impl.jar in /C:/DGGInstalls/RHPAM/jboss-eap-7.3/standalone/deployments/kie-server.war/WEB-INF/lib/jaxb-xjc-2.3.0.redhat-1.jar  does not point to a valid jar for a Class-Path reference.
2021-02-10 08:37:12,783 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-6) WFLYSRV0059: Class Path entry jaxb-api.jar in /C:/DGGInstalls/RHPAM/jboss-eap-7.3/bin/content/RestJbpm.war/WEB-INF/lib/jaxb-core-2.3.0.redhat-1.jar  does not point to a valid jar for a Class-Path reference.
2021-02-10 08:37:12,783 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-6) WFLYSRV0059: Class Path entry jaxb-api.jar in /C:/DGGInstalls/RHPAM/jboss-eap-7.3/bin/content/RestJbpm.war/WEB-INF/lib/jaxb-impl-2.2.4.jar  does not point to a valid jar for a Class-Path reference.
2021-02-10 08:37:12,783 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-6) WFLYSRV0059: Class Path entry activation.jar in /C:/DGGInstalls/RHPAM/jboss-eap-7.3/bin/content/RestJbpm.war/WEB-INF/lib/jaxb-impl-2.2.4.jar  does not point to a valid jar for a Class-Path reference.
2021-02-10 08:37:12,783 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-6) WFLYSRV0059: Class Path entry jsr173_1.0_api.jar in /C:/DGGInstalls/RHPAM/jboss-eap-7.3/bin/content/RestJbpm.war/WEB-INF/lib/jaxb-impl-2.2.4.jar  does not point to a valid jar for a Class-Path reference.
2021-02-10 08:37:12,783 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-6) WFLYSRV0059: Class Path entry jaxb1-impl.jar in /C:/DGGInstalls/RHPAM/jboss-eap-7.3/bin/content/RestJbpm.war/WEB-INF/lib/jaxb-impl-2.2.4.jar  does not point to a valid jar for a Class-Path reference.
2021-02-10 08:37:32,297 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-7) WFLYSRV0059: Class Path entry jaxb-api.jar in /C:/DGGInstalls/RHPAM/jboss-eap-7.3/standalone/deployments/business-central.war/WEB-INF/lib/jaxb-core-2.3.0.redhat-1.jar  does not point to a valid jar for a Class-Path reference.
2021-02-10 08:37:32,297 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-7) WFLYSRV0059: Class Path entry jaxb-core.jar in /C:/DGGInstalls/RHPAM/jboss-eap-7.3/standalone/deployments/business-central.war/WEB-INF/lib/jaxb-impl-2.3.0.redhat-1.jar  does not point to a valid jar for a Class-Path reference.
2021-02-10 08:37:56,441 WARN  [ErraiMarshalling] (MSC service thread 1-1) static marshallers were not found.
2021-02-10 08:37:56,441 WARN  [ErraiMarshalling] (MSC service thread 1-1) using dynamic marshallers. dynamic marshallers are designed for development mode testing, and ideally should not be used in production. *

I appreciate any advice!




David Goldstein

unread,
Feb 10, 2021, 1:32:39 PM2/10/21
to jBPM Usage
The tool's REST API is having the same issue, so it seems like a configuration issue (or else a bug a LOT of people would be experiencing):

curl -X POST "http://localhost:8080/kie-server/services/rest/server/containers/HumanTaskTest_1.0.11-SNAPSHOT/processes/DocumentSigner/instances" -H "accept: application/json" -H "content-type: application/json" -d "{\"signInParalllel\":\"TRUE\",\"person1\":{\"lastName\":\"Gold\",\"firstName\":\"D\",\"displayName\":\"Gold,D\",\"id\":\"AA8E0125-EED9-4682-0000-5BAA665FC2F7\",\"email\":\"dgold...@dummy.com\"},\"documentUrl\":\"htttp://dummy\",\"emailSchedule\":\"R1/PT2M\",\"documentName\":\"Joes RFP\",\"emailText\":\"Sign this document - it should be done ASAP.\",\"emailSubject\":\"Electronic Signature Needed\",\"people\":{\"peoplePayload\":[{\"lastName\":\"Gold\",\"firstName\":\"D\",\"displayName\":\"Gold,D\",\"id\":\"AA8E0125-EED9-4682-0000-5BAA665FC2F7\",\"email\":\"dgoldstein@ dummy  .com\"}]}}"

Produces


500 Error: Internal Server Error
"Unable to create response: [DocumentSigner:20,668 - Setp Up:3] -- java.base/java.util.LinkedHashMap cannot be cast to AmsUser"

balakri...@gmail.com

unread,
Feb 15, 2021, 11:51:52 PM2/15/21
to jBPM Usage
kie-server does not know what's the object that it has to de-serialize. By default it will try to de-serialize the incoming object into a LinkedHashMap. So, in order to inform kie-server to de-serialize to the correct type/class, explicit class name has to be specified in the request JSON using FQCN. For example, a sample modified payload for your example should be something like this:

{
  "amsUser": {
    "com.abc.AmsUser": {
      "signInParalllel": "TRUE",
      "person1": {
        "com.abc.Person": {
Reply all
Reply to author
Forward
0 new messages