Uploaded image for project: 'Drools'
  1. Drools
  2. DROOLS-6614

Kie Server (client?) marshalling Variable.v supported only XSTREAM

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • None
    • kie server
    • None
    • NEW
    • NEW

    Description

      https://github.com/tarilabs/demo20210928-model
      https://github.com/tarilabs/demo20210928-rules
      https://github.com/tarilabs/demo20210928-client

      Please refer to THIS SPECIFIC commit: https://github.com/tarilabs/demo20210928-client/blob/235167df4a6f85265484d4bc52d4deb13c25d1ea/src/main/java/org/drools/demo20210928/client/App.java#L76

      Using anything beyond XSTREAM here: https://github.com/tarilabs/demo20210928-client/blob/235167df4a6f85265484d4bc52d4deb13c25d1ea/src/main/java/org/drools/demo20210928/client/App.java#L32

      Leads to failures in marshalling the Request TO the server.

      For JSON

      Exception in thread "main" org.kie.server.api.exception.KieServicesException: Error while serializing request data!
              at org.kie.server.client.impl.AbstractKieServicesClientImpl.serialize(AbstractKieServicesClientImpl.java:626)
              at org.kie.server.client.impl.AbstractKieServicesClientImpl.makeHttpPostRequestAndCreateServiceResponse(AbstractKieServicesClientImpl.java:295)
              at org.kie.server.client.impl.RuleServicesClientImpl.executeCommandsWithResults(RuleServicesClientImpl.java:68)
              at org.kie.server.client.RuleServicesClient.executeCommandsWithResults(RuleServicesClient.java:42)
              at org.drools.demo20210928.client.App.demo(App.java:48)
              at org.drools.demo20210928.client.App.main(App.java:86)
      Caused by: org.kie.server.api.marshalling.MarshallingException: Error marshalling input
              at org.kie.server.api.marshalling.json.JSONMarshaller.marshall(JSONMarshaller.java:365)
              at org.kie.server.client.impl.AbstractKieServicesClientImpl.serialize(AbstractKieServicesClientImpl.java:624)
              ... 5 more
      Caused by: com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class org.kie.api.runtime.rule.Variable and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) (through reference chain: org.drools.core.command.runtime.BatchExecutionCommandImpl["commands"]->java.util.ArrayList[7]->org.drools.core.command.runtime.rule.QueryCommand["arguments"]->java.util.Arrays$ArrayList[0])
              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.DatabindContext.reportBadDefinition(DatabindContext.java:400)
              at com.fasterxml.jackson.databind.ser.impl.UnknownSerializer.failForEmpty(UnknownSerializer.java:71)
              at com.fasterxml.jackson.databind.ser.impl.UnknownSerializer.serialize(UnknownSerializer.java:33)
              at com.fasterxml.jackson.databind.ser.impl.IndexedListSerializer.serializeContents(IndexedListSerializer.java:119)
              at com.fasterxml.jackson.databind.ser.impl.IndexedListSerializer.serialize(IndexedListSerializer.java:79)
              at com.fasterxml.jackson.databind.ser.impl.IndexedListSerializer.serialize(IndexedListSerializer.java:18)
              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.std.BeanSerializerBase.serializeWithType(BeanSerializerBase.java:655)
              at com.fasterxml.jackson.databind.ser.std.CollectionSerializer.serializeContents(CollectionSerializer.java:147)
              at com.fasterxml.jackson.databind.ser.std.CollectionSerializer.serialize(CollectionSerializer.java:107)
              at com.fasterxml.jackson.databind.ser.std.CollectionSerializer.serialize(CollectionSerializer.java:25)
              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.DefaultSerializerProvider._serialize(DefaultSerializerProvider.java:480)
              at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:319)
              at com.fasterxml.jackson.databind.ObjectMapper._writeValueAndClose(ObjectMapper.java:4487)
              at com.fasterxml.jackson.databind.ObjectMapper.writeValueAsString(ObjectMapper.java:3742)
              at org.kie.server.api.marshalling.json.JSONMarshaller.marshall(JSONMarshaller.java:363)
              ... 6 more
      

      for JAXB

      Exception in thread "main" org.kie.server.api.exception.KieServicesException: Error while serializing request data!
              at org.kie.server.client.impl.AbstractKieServicesClientImpl.serialize(AbstractKieServicesClientImpl.java:626)
              at org.kie.server.client.impl.AbstractKieServicesClientImpl.makeHttpPostRequestAndCreateServiceResponse(AbstractKieServicesClientImpl.java:295)
              at org.kie.server.client.impl.RuleServicesClientImpl.executeCommandsWithResults(RuleServicesClientImpl.java:68)
              at org.kie.server.client.RuleServicesClient.executeCommandsWithResults(RuleServicesClient.java:42)
              at org.drools.demo20210928.client.App.demo(App.java:48)
              at org.drools.demo20210928.client.App.main(App.java:86)
      Caused by: org.kie.server.api.marshalling.MarshallingException: Can't marshall input object: BatchExecutionCommandImpl{lookup='null', commands=[session.entryPoints(DEFAULT).insert(Thing{name='house', volume=1000});, session.entryPoints(DEFAULT).insert(Thing{name='office', volume=200});, session.entryPoints(DEFAULT).insert(Thing{name='desk', volume=100});, session.entryPoints(DEFAULT).insert(Thing{name='library', volume=100});, session.entryPoints(DEFAULT).insert(Thing{name='box', volume=10});, session.entryPoints(DEFAULT).insert(Thing{name='key', volume=1});, session.fireAllRules();, QueryCommand{outIdentifier='qid', name='findContainment', arguments=[org.kie.api.runtime.rule.Variable@2e179f3e, Thing{name='key', volume=1}]}]}
              at org.kie.server.api.marshalling.jaxb.JaxbMarshaller.marshall(JaxbMarshaller.java:472)
              at org.kie.server.client.impl.AbstractKieServicesClientImpl.serialize(AbstractKieServicesClientImpl.java:624)
              ... 5 more
      Caused by: javax.xml.bind.MarshalException
       - with linked exception:
      [com.sun.istack.SAXException2: class org.kie.api.runtime.rule.Variable nor any of its super class is known to this context.
      javax.xml.bind.JAXBException: class org.kie.api.runtime.rule.Variable nor any of its super class is known to this context.]
              at com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:331)
              at com.sun.xml.bind.v2.runtime.MarshallerImpl.marshal(MarshallerImpl.java:256)
              at javax.xml.bind.helpers.AbstractMarshallerImpl.marshal(AbstractMarshallerImpl.java:116)
              at org.kie.server.api.marshalling.jaxb.JaxbMarshaller.marshall(JaxbMarshaller.java:470)
              ... 6 more
      Caused by: com.sun.istack.SAXException2: class org.kie.api.runtime.rule.Variable nor any of its super class is known to this context.
      javax.xml.bind.JAXBException: class org.kie.api.runtime.rule.Variable nor any of its super class is known to this context.
              at com.sun.xml.bind.v2.runtime.XMLSerializer.reportError(XMLSerializer.java:247)
              at com.sun.xml.bind.v2.runtime.XMLSerializer.reportError(XMLSerializer.java:262)
              at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsXsiType(XMLSerializer.java:653)
              at com.sun.xml.bind.v2.runtime.property.ArrayElementNodeProperty.serializeItem(ArrayElementNodeProperty.java:69)
              at com.sun.xml.bind.v2.runtime.property.ArrayElementProperty.serializeListBody(ArrayElementProperty.java:172)
              at com.sun.xml.bind.v2.runtime.property.ArrayERProperty.serializeBody(ArrayERProperty.java:159)
              at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.serializeBody(ClassBeanInfoImpl.java:360)
              at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsXsiType(XMLSerializer.java:696)
              at com.sun.xml.bind.v2.runtime.property.ArrayElementNodeProperty.serializeItem(ArrayElementNodeProperty.java:69)
              at com.sun.xml.bind.v2.runtime.property.ArrayElementProperty.serializeListBody(ArrayElementProperty.java:172)
              at com.sun.xml.bind.v2.runtime.property.ArrayERProperty.serializeBody(ArrayERProperty.java:159)
              at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.serializeBody(ClassBeanInfoImpl.java:360)
              at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsSoleContent(XMLSerializer.java:593)
              at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.serializeRoot(ClassBeanInfoImpl.java:341)
              at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsRoot(XMLSerializer.java:494)
              at com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:328)
              ... 9 more
      Caused by: javax.xml.bind.JAXBException: class org.kie.api.runtime.rule.Variable nor any of its super class is known to this context.
              at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getBeanInfo(JAXBContextImpl.java:593)
              at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsXsiType(XMLSerializer.java:648)
              ... 22 more
      

      Attachments

        Activity

          People

            mfusco@redhat.com Mario Fusco
            mmortari@redhat.com Matteo Mortari
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: