-
Bug
-
Resolution: Done
-
Major
-
7.40.0.Final
-
None
-
2020 Week 31-33 (from Jul 27)
-
5
-
-
NEW
-
NEW
A user's decision service deployed on KIE server receives REST commands from client, MarshallingException due to class loading failure occurs during JSON unmarshalling before the commands are processed. I attached a simplified reproducer reproducer_02699633_1.zip expressing the issue, and the error message is like below:
Caused by: com.fasterxml.jackson.databind.exc.InvalidTypeIdException: Could not resolve type id 'com.example.reproducer.common.params.ContactParam' as a subtype of [simple type, class com.example.reproducer.common.base.IRuleParam]: no such class found at [Source: (String)"{ "lookup" : "ksession-rules", "commands" : [ { "insert" : { "object" : { "com.example.reproducer.common.base.Fact1": { "parameter" : { "@class" : "com.example.reproducer.common.params.ContactParam", "contactInfo" : 123456789 } } } } }, { "fire-all-rules" : "" } ]}"; line: 1, column: 185] (through reference chain: org.drools.core.command.runtime.BatchExecutionCommandImpl["commands"]->java.util.ArrayList[0]->org.drools.core.command.runtime.rule.InsertObjectCommand["object"]->com.example.reproducer.common.base.Fact1["parameter"])
For full error messages, see full_error_messages.txt in Attachment.
The user's decision service (kjar) uses classes in another module jar as a library. ContactParam class which is a sub type of IRuleParam interface is in the kjar and IRuleParam interface is in the module jar.
Also, @JsonTypeInfo(use = Id.CLASS) annotation is given to IRuleParam like below in order for JSON implementation to recognize a given class to Fact1.parameter as a sub type of IRuleParam.
@JsonTypeInfo(use = Id.CLASS) public interface IRuleParam { }
Both classes contained in the module jar and classes in the kjar should be loaded.
- is incorporated by
-
RHDM-1417 MarshallingException occurs during REST request (JSON) unmarshalling in KIE server.
- Closed