Jar包冲突及java.lang.NoSuchMethodError异常解决方案

问题:

java.lang.NoSuchMethodError: com.caxins.themis.drools.domain.HighRiskAreaRuleInfo.setWhetherBelongLCV(Ljava/lang/Boolean;)V
at com.caxins.themis.rules.Rule_highRule00514613225.defaultConsequence(Rule_highRule00514613225.java:9)
at com.caxins.themis.rules.Rule_highRule00514613225DefaultConsequenceInvokerGenerated.evaluate(Unknown Source)
at com.caxins.themis.rules.Rule_highRule00514613225DefaultConsequenceInvoker.evaluate(Unknown Source)
at org.drools.core.common.DefaultAgenda.fireActivation(DefaultAgenda.java:1114)
at org.drools.core.phreak.RuleExecutor.fire(RuleExecutor.java:160)
at org.drools.core.phreak.RuleExecutor.evaluateNetworkAndFire(RuleExecutor.java:108)
at org.drools.core.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:1016)
at org.drools.core.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1302)
at org.drools.core.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:1289)
at org.drools.core.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:1272)
at com.caxins.themis.drools.rule.HighRiskAreaRule.HighRiskAreaRule.queryDroolsResult(HighRiskAreaRule.java:150)
at com.caxins.themis.drools.rule.HighRiskAreaRule.HighRiskAreaRule.invokeHighRiskAreaRule(HighRiskAreaRule.java:116)
at com.caxins.themis.drools.rule.HighRiskAreaRule.HighRiskAreaRule$$FastClassBySpringCGLIB$$651f915a.invoke()
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:717)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281)

at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(Transa

分析:

网上参考drools达人“二师兄”的一篇博客,连接如下:http://blog.csdn.net/wo541075754/article/details/48243403

解决:

方案一:我的drools版本是drools6.0;然后参照上述连接发现是commons-lang 2.x 和 commons-lang 3.x发生冲突导致,然后在drools的应用路径下找到其所加载的包路径,进行删除2.x即可。相对路径如下:../webapps/kie-drools-wb/WEB-INF/lib;另外,除了在drools项目下的jar包冲突,你也应该注意自己本身的项目下是否有同样的jar使用。如有,请三思后进行修改。

方案二:有点取巧;因为我的实体属性是boolean值,我就尝试着假如用string类型去修饰,试着将结果“true”代替为“Y”,“false”代替为“N”,然后就解决了~

你可能感兴趣的:(Jar包冲突及java.lang.NoSuchMethodError异常解决方案)