本文介绍了Drools不适用于spring-boot-devtools的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我们在pom.xml上具有spring-boot-devtools时,drools规则不起作用。没有错误,但是流口水的规则根本没有被解雇。在排除了spring-boot-devtools之后,流口水的规则开始起作用。

When we have spring-boot-devtools on pom.xml the drools rules dont work. There are no error but the drools rules dont get fired at all. After excluding the spring-boot-devtools the drools rule start working.

推荐答案

在使用spring时有一个关于类加载问题的记录问题-boot devtools和流口水:

There's a documented issue about a classloading problem while using spring-boot devtools together with drools: DROOLS-1540

在,您可以将jar添加到devtools重新加载类加载器中,作为一种解决方法。

As specified in spring-boot reference documentation you can add jars to the devtools "reloading" classloader as a workaround.

META-INF / spring-devtools.properties

restart.include.drools-core=/drools-core-7.0.0.Final.jar
restart.include.drools-compiler=/drools-compiler-7.0.0.Final.jar
restart.include.kie-api=/kie-api-7.0.0.Final.jar
restart.include.kie-ci=/kie-ci-7.0.0.Final.jar
restart.include.kie-internal=/kie-internal-7.0.0.Final.jar

请小心使用您的精确罐子并最终添加直接在规则文件中引用的其他库。

Be careful to use YOUR exacts jar and eventually add other libraries directly referenced in your rules files.

(对于主持人)显示为,重复该问题并删除了该帖子的答案

(for moderator) flgged Drools rule does't working in Spring Boot Controller but working in Junit Test as duplicated of this question and removed the answer on that post

这篇关于Drools不适用于spring-boot-devtools的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-27 03:33
查看更多