How to solve "com.thoughtworks.xstream.mapper.CannotResolveClassException" for rule executed through kie-server ?

Solution Verified - Updated -

Issue

  • When user tries to execute rules via kie-server or Intelligent Process Server it throws following exception after sending request. How to solve this kind of issue?
cause-exception     : com.thoughtworks.xstream.mapper.CannotResolveClassException
cause-message       : com.test.brms.simple.FactOneHandleMessage
class               : org.drools.core.command.runtime.rule.InsertObjectCommand
required-type       : org.drools.core.command.runtime.rule.InsertObjectCommand
converter-type      : org.drools.core.runtime.help.impl.XStreamXML$InsertConverter
path                : /batch-execution/insert/com/test/brms/simple/FactOneHandleMessage
line number         : 3
class[1]            : org.drools.core.command.runtime.BatchExecutionCommandImpl
converter-type[1]   : com.thoughtworks.xstream.converters.reflection.ReflectionConverter
  • Meanwhile the server.log at the BRMS 6 instance complains with following stack trace.
---- Debugging information ----
cause-exception     : com.thoughtworks.xstream.mapper.CannotResolveClassException
cause-message       : com.test.brms.simple.FactOneHandleMessage
class               : org.drools.core.command.runtime.rule.InsertObjectCommand
required-type       : org.drools.core.command.runtime.rule.InsertObjectCommand
converter-type      : org.drools.core.runtime.help.impl.XStreamXML$InsertConverter
path                : /batch-execution/insert/com/test/brms/simple/FactOneHandleMessage
line number         : 3
class[1]            : org.drools.core.command.runtime.BatchExecutionCommandImpl
converter-type[1]   : com.thoughtworks.xstream.converters.reflection.ReflectionConverter
version             : 6.5.0.Final-redhat-2
-------------------------------
    at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:79) [xstream-1.4.9.redhat-2.jar:1.4.9.redhat-2]
    at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:70) [xstream-1.4.9.redhat-2.jar:1.4.9.redhat-2]
    at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66) [xstream-1.4.9.redhat-2.jar:1.4.9.redhat-2]
    at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50) [xstream-1.4.9.redhat-2.jar:1.4.9.redhat-2]
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doUnmarshal(AbstractReflectionConverter.java:401) [xstream-1.4.9.redhat-2.jar:1.4.9.redhat-2]
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:281) [xstream-1.4.9.redhat-2.jar:1.4.9.redhat-2]
    at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72) [xstream-1.4.9.redhat-2.jar:1.4.9.redhat-2]
    at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:70) [xstream-1.4.9.redhat-2.jar:1.4.9.redhat-2]
    at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66) [xstream-1.4.9.redhat-2.jar:1.4.9.redhat-2]
    at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50) [xstream-1.4.9.redhat-2.jar:1.4.9.redhat-2]
    at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:134) [xstream-1.4.9.redhat-2.jar:1.4.9.redhat-2]
    at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarshal(AbstractTreeMarshallingStrategy.java:32) [xstream-1.4.9.redhat-2.jar:1.4.9.redhat-2]
    at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1230) [xstream-1.4.9.redhat-2.jar:1.4.9.redhat-2]
    at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1214) [xstream-1.4.9.redhat-2.jar:1.4.9.redhat-2]
    at com.thoughtworks.xstream.XStream.fromXML(XStream.java:1085) [xstream-1.4.9.redhat-2.jar:1.4.9.redhat-2]
    at com.thoughtworks.xstream.XStream.fromXML(XStream.java:1076) [xstream-1.4.9.redhat-2.jar:1.4.9.redhat-2]
    at org.kie.server.api.marshalling.xstream.XStreamMarshaller.unmarshall(XStreamMarshaller.java:136) [kie-server-api-6.5.0.Final-redhat-2.jar:6.5.0.Final-redhat-2]
    at org.kie.server.services.drools.DroolsKieContainerCommandServiceImpl.callContainer(DroolsKieContainerCommandServiceImpl.java:59) [kie-server-services-drools-6.5.0.Final-redhat-2.jar:6.5.0.Final-redhat-2]
    at org.kie.server.remote.rest.drools.CommandResource.manageContainer(CommandResource.java:72) [kie-server-rest-drools-6.5.0.Final-redhat-2.jar:6.5.0.Final-redhat-2]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.8.0_101]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [rt.jar:1.8.0_101]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.8.0_101]
    at java.lang.reflect.Method.invoke(Method.java:498) [rt.jar:1.8.0_101]
    at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:168) [resteasy-jaxrs-2.3.17.Final-redhat-1.jar:]
    at org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:269) [resteasy-jaxrs-2.3.17.Final-redhat-1.jar:]
    at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:227) [resteasy-jaxrs-2.3.17.Final-redhat-1.jar:]
    at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:216) [resteasy-jaxrs-2.3.17.Final-redhat-1.jar:]
    at org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:583) [resteasy-jaxrs-2.3.17.Final-redhat-1.jar:]
    at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:565) [resteasy-jaxrs-2.3.17.Final-redhat-1.jar:]
    at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:130) [resteasy-jaxrs-2.3.17.Final-redhat-1.jar:]
    at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208) [resteasy-jaxrs-2.3.17.Final-redhat-1.jar:]
    at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55) [resteasy-jaxrs-2.3.17.Final-redhat-1.jar:]
    at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50) [resteasy-jaxrs-2.3.17.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.21.Final-redhat-2.jar:7.5.21.Final-redhat-2]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) [jbossweb-7.5.21.Final-redhat-2.jar:7.5.21.Final-redhat-2]
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:231) [jbossweb-7.5.21.Final-redhat-2.jar:7.5.21.Final-redhat-2]
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:149) [jbossweb-7.5.21.Final-redhat-2.jar:7.5.21.Final-redhat-2]
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:512) [jbossweb-7.5.21.Final-redhat-2.jar:7.5.21.Final-redhat-2]
    at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:169) [jboss-as-web-7.5.14.Final-redhat-2.jar:7.5.14.Final-redhat-2]
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:151) [jbossweb-7.5.21.Final-redhat-2.jar:7.5.21.Final-redhat-2]
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:97) [jbossweb-7.5.21.Final-redhat-2.jar:7.5.21.Final-redhat-2]
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:102) [jbossweb-7.5.21.Final-redhat-2.jar:7.5.21.Final-redhat-2]
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) [jbossweb-7.5.21.Final-redhat-2.jar:7.5.21.Final-redhat-2]
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:854) [jbossweb-7.5.21.Final-redhat-2.jar:7.5.21.Final-redhat-2]
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:656) [jbossweb-7.5.21.Final-redhat-2.jar:7.5.21.Final-redhat-2]
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:926) [jbossweb-7.5.21.Final-redhat-2.jar:7.5.21.Final-redhat-2]
    at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_101]
Caused by: com.thoughtworks.xstream.mapper.CannotResolveClassException: com.test.brms.simple.FactOneHandleMessage
    at com.thoughtworks.xstream.mapper.DefaultMapper.realClass(DefaultMapper.java:81) [xstream-1.4.9.redhat-2.jar:1.4.9.redhat-2]
    at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30) [xstream-1.4.9.redhat-2.jar:1.4.9.redhat-2]
    at com.thoughtworks.xstream.mapper.DynamicProxyMapper.realClass(DynamicProxyMapper.java:55) [xstream-1.4.9.redhat-2.jar:1.4.9.redhat-2]
    at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30) [xstream-1.4.9.redhat-2.jar:1.4.9.redhat-2]
    at com.thoughtworks.xstream.mapper.PackageAliasingMapper.realClass(PackageAliasingMapper.java:88) [xstream-1.4.9.redhat-2.jar:1.4.9.redhat-2]
    at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30) [xstream-1.4.9.redhat-2.jar:1.4.9.redhat-2]
    at com.thoughtworks.xstream.mapper.ClassAliasingMapper.realClass(ClassAliasingMapper.java:79) [xstream-1.4.9.redhat-2.jar:1.4.9.redhat-2]
    at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30) [xstream-1.4.9.redhat-2.jar:1.4.9.redhat-2]
    at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30) [xstream-1.4.9.redhat-2.jar:1.4.9.redhat-2]
    at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30) [xstream-1.4.9.redhat-2.jar:1.4.9.redhat-2]
    at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30) [xstream-1.4.9.redhat-2.jar:1.4.9.redhat-2]
    at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30) [xstream-1.4.9.redhat-2.jar:1.4.9.redhat-2]
    at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30) [xstream-1.4.9.redhat-2.jar:1.4.9.redhat-2]
    at com.thoughtworks.xstream.mapper.ArrayMapper.realClass(ArrayMapper.java:74) [xstream-1.4.9.redhat-2.jar:1.4.9.redhat-2]
    at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30) [xstream-1.4.9.redhat-2.jar:1.4.9.redhat-2]
    at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30) [xstream-1.4.9.redhat-2.jar:1.4.9.redhat-2]
    at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30) [xstream-1.4.9.redhat-2.jar:1.4.9.redhat-2]
    at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30) [xstream-1.4.9.redhat-2.jar:1.4.9.redhat-2]
    at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30) [xstream-1.4.9.redhat-2.jar:1.4.9.redhat-2]
    at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30) [xstream-1.4.9.redhat-2.jar:1.4.9.redhat-2]
    at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30) [xstream-1.4.9.redhat-2.jar:1.4.9.redhat-2]
    at com.thoughtworks.xstream.mapper.SecurityMapper.realClass(SecurityMapper.java:71) [xstream-1.4.9.redhat-2.jar:1.4.9.redhat-2]
    at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30) [xstream-1.4.9.redhat-2.jar:1.4.9.redhat-2]
    at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30) [xstream-1.4.9.redhat-2.jar:1.4.9.redhat-2]
    at org.kie.server.api.marshalling.xstream.XStreamMarshaller$1$1.realClass(XStreamMarshaller.java:78) [kie-server-api-6.5.0.Final-redhat-2.jar:6.5.0.Final-redhat-2]
    at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30) [xstream-1.4.9.redhat-2.jar:1.4.9.redhat-2]
    at com.thoughtworks.xstream.mapper.CachingMapper.realClass(CachingMapper.java:47) [xstream-1.4.9.redhat-2.jar:1.4.9.redhat-2]
    at com.thoughtworks.xstream.core.util.HierarchicalStreams.readClassType(HierarchicalStreams.java:29) [xstream-1.4.9.redhat-2.jar:1.4.9.redhat-2]
    at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.readItem(AbstractCollectionConverter.java:72) [xstream-1.4.9.redhat-2.jar:1.4.9.redhat-2]
    at org.drools.core.runtime.help.impl.XStreamXML$InsertConverter.unmarshal(XStreamXML.java:147) [drools-core-6.5.0.Final-redhat-2.jar:6.5.0.Final-redhat-2]
    at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72) [xstream-1.4.9.redhat-2.jar:1.4.9.redhat-2]
    ... 47 more
...

Environment

  • Red Hat JBoss BRMS (BRMS)
    • 6.4.0

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content