drools执行服务器

时间:2015-10-30 08:07:56

标签: java jboss7.x drools xstream xerces

我正在尝试将请求发送到drools执行服务器。 这是请求

<batch-execution> <insert out-identifier="p" return-object="true" entry-point="DEFAULT"> <com.kewill.wcs.domains.jaxb.job.Person> <name>I don&apos;t know</name> <id>2464</id> <salary>12345</salary> <creditScore>200</creditScore> <loanAmount>400000</loanAmount> <DOB class="com.sun.org.apache.xerces.internal.jaxp.datatype.XMLGregorianCalendarImpl"> <year>1993</year> <month>7</month> <day>3</day> <timezone>-2147483648</timezone> <hour>-2147483648</hour> <minute>-2147483648</minute> <second>-2147483648</second> </DOB> </com.kewill.wcs.domains.jaxb.job.Person> </insert> <fire-all-rules/> </batch-execution>

我收到了以下错误。

com.thoughtworks.xstream.converters.ConversionException: com.sun.org.apache.xerces.internal.jaxp.datatype.XMLGregorianCalendarImpl : com.sun.org.apache.xerces.internal.jaxp.datatype.XMLGregorianCalendarImpl
    ---- Debugging information ----
    message             : com.sun.org.apache.xerces.internal.jaxp.datatype.XMLGregorianCalendarImpl
    cause-exception     : com.thoughtworks.xstream.mapper.CannotResolveClassException
    cause-message       : com.sun.org.apache.xerces.internal.jaxp.datatype.XMLGregorianCalendarImpl
    class               : com.kewill.wcs.domains.jaxb.job.Person
    required-type       : com.kewill.wcs.domains.jaxb.job.Person
    converter-type      : com.thoughtworks.xstream.converters.reflection.ReflectionConverter
    path                : /batch-execution/insert/com.kewill.wcs.domains.jaxb.job.Person/DOB
    line number         : 9
    class[1]            : org.drools.core.command.runtime.rule.InsertObjectCommand
    converter-type[1]   : org.drools.core.runtime.help.impl.XStreamXML$InsertConverter
    class[2]            : org.drools.core.command.runtime.BatchExecutionCommandImpl
    version             : 1.4.7
    -------------------------------
        at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:79) [xstream-1.4.7.jar:1.4.7]
        at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65) [xstream-1.4.7.jar:1.4.7]
        at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66) [xstream-1.4.7.jar:1.4.7]
        at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50) [xstream-1.4.7.jar:1.4.7]
        at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.readItem(AbstractCollectionConverter.java:71) [xstream-1.4.7.jar:1.4.7]
        at org.drools.core.runtime.help.impl.XStreamXML$InsertConverter.unmarshal(XStreamXML.java:133) [drools-core-6.2.0.Final.jar:6.2.0.Final]
        at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72) [xstream-1.4.7.jar:1.4.7]
        at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65) [xstream-1.4.7.jar:1.4.7]
        at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66) [xstream-1.4.7.jar:1.4.7]
        at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50) [xstream-1.4.7.jar:1.4.7]
        at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doUnmarshal(AbstractReflectionConverter.java:377) [xstream-1.4.7.jar:1.4.7]
        at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:257) [xstream-1.4.7.jar:1.4.7]
        at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72) [xstream-1.4.7.jar:1.4.7]
        at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65) [xstream-1.4.7.jar:1.4.7]
        at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66) [xstream-1.4.7.jar:1.4.7]
        at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50) [xstream-1.4.7.jar:1.4.7]
        at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:134) [xstream-1.4.7.jar:1.4.7]
        at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarshal(AbstractTreeMarshallingStrategy.java:32) [xstream-1.4.7.jar:1.4.7]
        at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1185) [xstream-1.4.7.jar:1.4.7]
        at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1169) [xstream-1.4.7.jar:1.4.7]
        at com.thoughtworks.xstream.XStream.fromXML(XStream.java:1040) [xstream-1.4.7.jar:1.4.7]
        at com.thoughtworks.xstream.XStream.fromXML(XStream.java:1031) [xstream-1.4.7.jar:1.4.7]
        at org.kie.server.api.marshalling.xstream.XStreamMarshaller.unmarshall(XStreamMarshaller.java:45) [kie-server-api-6.2.0.Final.jar:6.2.0.Final]
        at org.kie.server.services.impl.KieServerImpl.callContainer(KieServerImpl.java:201) [kie-server-services-6.2.0.Final.jar:6.2.0.Final]
        at org.kie.server.services.rest.KieServerRestImpl.execute(KieServerRestImpl.java:85) [kie-server-services-6.2.0.Final.jar:6.2.0.Final]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_07]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_07]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_07]
        at java.lang.reflect.Method.invoke(Method.java:601) [rt.jar:1.7.0_07]
        at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:155) [resteasy-jaxrs-2.3.2.Final.jar:]
        at org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:257) [resteasy-jaxrs-2.3.2.Final.jar:]
        at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:222) [resteasy-jaxrs-2.3.2.Final.jar:]
        at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:211) [resteasy-jaxrs-2.3.2.Final.jar:]
        at org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:525) [resteasy-jaxrs-2.3.2.Final.jar:]
        at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:502) [resteasy-jaxrs-2.3.2.Final.jar:]
        at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:119) [resteasy-jaxrs-2.3.2.Final.jar:]
        at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208) [resteasy-jaxrs-2.3.2.Final.jar:]
        at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55) [resteasy-jaxrs-2.3.2.Final.jar:]
        at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50) [resteasy-jaxrs-2.3.2.Final.jar:]
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.13.Final.jar:]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.13.Final.jar:]
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.13.Final.jar:]
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:489) [jbossweb-7.0.13.Final.jar:]
        at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) [jbossweb-7.0.13.Final.jar:]
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.13.Final.jar:]
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.13.Final.jar:]
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368) [jbossweb-7.0.13.Final.jar:]
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.13.Final.jar:]
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671) [jbossweb-7.0.13.Final.jar:]
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930) [jbossweb-7.0.13.Final.jar:]
        at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_07]
    Caused by: com.thoughtworks.xstream.mapper.CannotResolveClassException: com.sun.org.apache.xerces.internal.jaxp.datatype.XMLGregorianCalendarImpl
        at com.thoughtworks.xstream.mapper.DefaultMapper.realClass(DefaultMapper.java:79) [xstream-1.4.7.jar:1.4.7]
        at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30) [xstream-1.4.7.jar:1.4.7]
        at com.thoughtworks.xstream.mapper.DynamicProxyMapper.realClass(DynamicProxyMapper.java:55) [xstream-1.4.7.jar:1.4.7]
        at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30) [xstream-1.4.7.jar:1.4.7]
        at com.thoughtworks.xstream.mapper.PackageAliasingMapper.realClass(PackageAliasingMapper.java:88) [xstream-1.4.7.jar:1.4.7]
        at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30) [xstream-1.4.7.jar:1.4.7]
        at com.thoughtworks.xstream.mapper.ClassAliasingMapper.realClass(ClassAliasingMapper.java:79) [xstream-1.4.7.jar:1.4.7]
        at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30) [xstream-1.4.7.jar:1.4.7]
        at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30) [xstream-1.4.7.jar:1.4.7]
        at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30) [xstream-1.4.7.jar:1.4.7]
        at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30) [xstream-1.4.7.jar:1.4.7]
        at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30) [xstream-1.4.7.jar:1.4.7]
        at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30) [xstream-1.4.7.jar:1.4.7]
        at com.thoughtworks.xstream.mapper.ArrayMapper.realClass(ArrayMapper.java:74) [xstream-1.4.7.jar:1.4.7]
        at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30) [xstream-1.4.7.jar:1.4.7]
        at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30) [xstream-1.4.7.jar:1.4.7]
        at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30) [xstream-1.4.7.jar:1.4.7]
        at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30) [xstream-1.4.7.jar:1.4.7]
        at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30) [xstream-1.4.7.jar:1.4.7]
        at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30) [xstream-1.4.7.jar:1.4.7]
        at com.thoughtworks.xstream.mapper.SecurityMapper.realClass(SecurityMapper.java:71) [xstream-1.4.7.jar:1.4.7]
        at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30) [xstream-1.4.7.jar:1.4.7]
        at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30) [xstream-1.4.7.jar:1.4.7]
        at com.thoughtworks.xstream.mapper.CachingMapper.realClass(CachingMapper.java:47) [xstream-1.4.7.jar:1.4.7]
        at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doUnmarshal(AbstractReflectionConverter.java:401) [xstream-1.4.7.jar:1.4.7]
        at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:257) [xstream-1.4.7.jar:1.4.7]
        at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72) [xstream-1.4.7.jar:1.4.7]
        ... 53 more`

我预计这将是一个jar冲突问题。但我无法找到解决方案。我使用Jboss 7.1.1作为应用程序服务器。

请帮我解决这个问题。

1 个答案:

答案 0 :(得分:0)

我使用了xercesImpl-2.11.0.jar,它解决了我的问题。