[
https://issues.jboss.org/browse/DROOLS-932?page=com.atlassian.jira.plugin...
]
Maciej Swiderski commented on DROOLS-932:
-----------------------------------------
Thanks [~stefanopicozzi] for the test case. The issue is due to JAXB marshaling is getting
in the way as that is default for application/xml content type. And the data are actually
in Xstream format. So to be able to use that you need to instruct KIE Server to use
Xstream marshaller for the request. To do so add following header into your request:
{noformat}
X-KIE-ContentType
{noformat}
with value:
{noformat}
XSTREAM
{noformat}
you can add following to the curl command and you should have a successful response:
{code}
-H "X-KIE-ContentType: XSTREAM"
{code}
kie-server POST fails with
org.kie.server.api.marshalling.MarshallingException: Can't marshall input object:
-------------------------------------------------------------------------------------------------------------
Key: DROOLS-932
URL:
https://issues.jboss.org/browse/DROOLS-932
Project: Drools
Issue Type: Bug
Components: kie server
Affects Versions: 6.3.0.Final
Environment: kie-server 6.3.0.FINAL with JBoss EAP 6.4.0 or Widfly 8.1.0.FINAL
Reporter: Stefano Picozzi
Assignee: Maciej Swiderski
Priority: Blocker
Attachments: Drools-932-TestCase.zip
The GET and PUT APIs work OK, e.g. to GET KIE-SERVER details or to PUT a new container.
However a POST to e.g. send some facts to test actual rule reasoning fails as per this
log snippet:
07:24:27,998 INFO [org.kie.server.services.impl.KieServerImpl] (http-/0.0.0.0:8080-1)
Container watch (for release id com.redhat.demos:weightwatchers:1.0) successfully started
07:24:45,028 ERROR [org.kie.server.services.impl.KieContainerCommandServiceImpl]
(http-/0.0.0.0:8080-1) Error calling container 'watch':
org.kie.server.api.marshalling.MarshallingException: Can't marshall input object:
org.drools.core.runtime.impl.ExecutionResultImpl@3c402d4b
at org.kie.server.api.marshalling.jaxb.JaxbMarshaller.marshall(JaxbMarshaller.java:187)
[kie-server-api-6.3.0.Final.jar:6.3.0.Final]
at
org.kie.server.services.impl.KieContainerCommandServiceImpl.callContainer(KieContainerCommandServiceImpl.java:114)
[kie-server-services-common-6.3.0.Final.jar:6.3.0.Final]
at
org.kie.server.remote.rest.drools.CommandResource.manageContainer(CommandResource.java:73)
[kie-server-rest-drools-6.3.0.Final.jar:6.3.0.Final]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_65]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
[rt.jar:1.7.0_65]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[rt.jar:1.7.0_65]
at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_65]
at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:168)
[resteasy-jaxrs-2.3.10.Final-redhat-1.jar:]
at org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:269)
[resteasy-jaxrs-2.3.10.Final-redhat-1.jar:]
at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:227)
[resteasy-jaxrs-2.3.10.Final-redhat-1.jar:]
at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:216)
[resteasy-jaxrs-2.3.10.Final-redhat-1.jar:]
at
org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:541)
[resteasy-jaxrs-2.3.10.Final-redhat-1.jar:]
at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:523)
[resteasy-jaxrs-2.3.10.Final-redhat-1.jar:]
at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:125)
[resteasy-jaxrs-2.3.10.Final-redhat-1.jar:]
at
org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208)
[resteasy-jaxrs-2.3.10.Final-redhat-1.jar:]
at
org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55)
[resteasy-jaxrs-2.3.10.Final-redhat-1.jar:]
at
org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50)
[resteasy-jaxrs-2.3.10.Final-redhat-1.jar:]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
[jboss-servlet-api_3.0_spec-1.0.2.Final-redhat-2.jar:1.0.2.Final-redhat-2]
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:295)
[jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
[jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:231)
[jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:149)
[jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:512)
[jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
at
org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:169)
[jboss-as-web-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:150)
[jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:97)
[jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
at org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java:400)
[jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:102)
[jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:344)
[jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:854)
[jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:653)
[jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:926)
[jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_65]
Caused by: javax.xml.bind.MarshalException
- with linked exception:
[com.sun.istack.SAXException2: class org.drools.core.runtime.rule.impl.FlatQueryResults
nor any of its super class is known to this context.
javax.xml.bind.JAXBException: class org.drools.core.runtime.rule.impl.FlatQueryResults
nor any of its super class is known to this context.]
at com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:326)
[jaxb-impl-2.2.11.jar:2.2.11]
at com.sun.xml.bind.v2.runtime.MarshallerImpl.marshal(MarshallerImpl.java:251)
[jaxb-impl-2.2.11.jar:2.2.11]
at javax.xml.bind.helpers.AbstractMarshallerImpl.marshal(AbstractMarshallerImpl.java:95)
[jboss-jaxb-api_2.2_spec-1.0.4.Final-redhat-3.jar:1.0.4.Final-redhat-3]
at org.kie.server.api.marshalling.jaxb.JaxbMarshaller.marshall(JaxbMarshaller.java:185)
[kie-server-api-6.3.0.Final.jar:6.3.0.Final]
... 32 more
Caused by: com.sun.istack.SAXException2: class
org.drools.core.runtime.rule.impl.FlatQueryResults nor any of its super class is known to
this context.
javax.xml.bind.JAXBException: class org.drools.core.runtime.rule.impl.FlatQueryResults
nor any of its super class is known to this context.
at com.sun.xml.bind.v2.runtime.XMLSerializer.reportError(XMLSerializer.java:247)
[jaxb-impl-2.2.11.jar:2.2.11]
at com.sun.xml.bind.v2.runtime.XMLSerializer.reportError(XMLSerializer.java:262)
[jaxb-impl-2.2.11.jar:2.2.11]
at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsXsiType(XMLSerializer.java:653)
[jaxb-impl-2.2.11.jar:2.2.11]
at
com.sun.xml.bind.v2.runtime.property.SingleElementNodeProperty.serializeBody(SingleElementNodeProperty.java:158)
[jaxb-impl-2.2.11.jar:2.2.11]
at
com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.serializeBody(ClassBeanInfoImpl.java:360)
[jaxb-impl-2.2.11.jar:2.2.11]
at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsXsiType(XMLSerializer.java:696)
[jaxb-impl-2.2.11.jar:2.2.11]
at
com.sun.xml.bind.v2.runtime.ArrayBeanInfoImpl.serializeBody(ArrayBeanInfoImpl.java:142)
[jaxb-impl-2.2.11.jar:2.2.11]
at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsXsiType(XMLSerializer.java:696)
[jaxb-impl-2.2.11.jar:2.2.11]
at
com.sun.xml.bind.v2.runtime.property.SingleElementNodeProperty.serializeBody(SingleElementNodeProperty.java:158)
[jaxb-impl-2.2.11.jar:2.2.11]
at
com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.serializeBody(ClassBeanInfoImpl.java:360)
[jaxb-impl-2.2.11.jar:2.2.11]
at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsSoleContent(XMLSerializer.java:593)
[jaxb-impl-2.2.11.jar:2.2.11]
at
com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.serializeRoot(ClassBeanInfoImpl.java:341)
[jaxb-impl-2.2.11.jar:2.2.11]
at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsRoot(XMLSerializer.java:494)
[jaxb-impl-2.2.11.jar:2.2.11]
at com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:323)
[jaxb-impl-2.2.11.jar:2.2.11]
... 35 more
Caused by: javax.xml.bind.JAXBException: class
org.drools.core.runtime.rule.impl.FlatQueryResults nor any of its super class is known to
this context.
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getBeanInfo(JAXBContextImpl.java:582)
[jaxb-impl-2.2.11.jar:2.2.11]
at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsXsiType(XMLSerializer.java:648)
[jaxb-impl-2.2.11.jar:2.2.11]
... 46 more
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)