I'm starting to work with drools , I wanted to use it in spring-boot service, but even for a simple example I 've got a no such method error on Xstream. What did I miss?
Caused by: java.lang.NoSuchMethodError: com.thoughtworks.xstream.XStream.setupDefaultSecurity(Lcom/thoughtworks/xstream/XStream;)V
at org.kie.internal.xstream.XStreamUtils.internalCreateXStream(XStreamUtils.java:58)
at org.kie.internal.xstream.XStreamUtils.createXStream(XStreamUtils.java:38)
at org.drools.compiler.kproject.models.KieModuleModelImpl$kModuleMarshaller.<init>(KieModuleModelImpl.java:170)
at org.drools.compiler.kproject.models.KieModuleModelImpl$kModuleMarshaller.<init>(KieModuleModelImpl.java:169)
at org.drools.compiler.kproject.models.KieModuleModelImpl.<clinit>(KieModuleModelImpl.java:167)
at org.drools.compiler.kie.builder.impl.ClasspathKieProject.fetchKModule(ClasspathKieProject.java:179)
at org.drools.compiler.kie.builder.impl.ClasspathKieProject.fetchKModule(ClasspathKieProject.java:141)
at org.drools.compiler.kie.builder.impl.ClasspathKieProject.discoverKieModules(ClasspathKieProject.java:112)
at org.drools.compiler.kie.builder.impl.ClasspathKieProject.init(ClasspathKieProject.java:84)
at org.drools.compiler.kie.builder.impl.KieContainerImpl.<init>(KieContainerImpl.java:142)
at org.drools.compiler.kie.builder.impl.KieServicesImpl.newKieClasspathContainer(KieServicesImpl.java:135)
at org.drools.compiler.kie.builder.impl.KieServicesImpl.getKieClasspathContainer(KieServicesImpl.java:101)
at org.drools.compiler.kie.builder.impl.KieServicesImpl.getKieClasspathContainer(KieServicesImpl.java:79)
I was facing a similar issue. That method was introduced in xstream v1.4.10.
I was able to fix it by excluding xstream (v1.4.9)
dependency drools-compiler (v7.6.0.Final)
and adding a separate dependency for xstream (v1.4.10)
<dependency>
<groupId>org.drools</groupId>
<artifactId>drools-compiler</artifactId>
<version>7.6.0.Final</version>
<exclusions>
<exclusion>
<groupId>com.thoughtworks.xstream</groupId>
<artifactId>xstream</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.thoughtworks.xstream</groupId>
<artifactId>xstream</artifactId>
<version>1.4.10</version>
</dependency>
| \- org.drools:drools-decisiontables:jar:7.4.1.Final:compile
[INFO] | +- (org.drools:drools-core:jar:7.4.1.Final:compile - omitted for duplicate)
[INFO] | +- org.drools:drools-compiler:jar:7.4.1.Final:compile
[INFO] | | +- (org.drools:drools-core:jar:7.4.1.Final:compile - omitted for duplicate)
[INFO] | | +- (org.kie:kie-api:jar:7.4.1.Final:compile - omitted for duplicate)
[INFO] | | +- (org.kie:kie-internal:jar:7.4.1.Final:compile - omitted for duplicate)
[INFO] | | +- (org.uberfire:uberfire-maven-support:jar:1.4.0.Final:compile - omitted for duplicate)
[INFO] | | +- org.antlr:antlr-runtime:jar:3.5.2:compile
[INFO] | | +- org.eclipse.jdt.core.compiler:ecj:jar:4.4.2:compile
[INFO] | | +- (org.mvel:mvel2:jar:2.3.2.Final:compile - omitted for duplicate)
[INFO] | | +- (com.thoughtworks.xstream:xstream:jar:1.4.9:compile - version managed from 1.4.10; omitted for duplicate)
drools need the 1.4.10 version but my maven keep the 1.4.9 version using by eureka ( a netflix solution)
| +- (com.thoughtworks.xstream:xstream:jar:1.4.9:compile - version managed from 1.4.10; omitted for duplicate)
If I force the version 1.4.10, I've got this message
+- (com.thoughtworks.xstream:xstream:jar:1.4.9:compile - version managed from 1.4.10; omitted for conflict with 1.4.10)
but it's working....
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With