Drools 7.4.1 kieservices.factory.get()返回null [英] Drools 7.4.1 kieservices.factory.get() returns null
问题描述
我尝试将Drools 7.4.1集成到tomcat中的Webapp中。
I try to integrate Drools 7.4.1 into a webapp in tomcat.
当我在代码中调用以下语句以获取KieService时,我将得到 null
。
When I call in the code the following statement to get a KieService I get null
.
KieServices ks = KieServices.Factory.get();
从测试方法中调用同一方法是可以的。
When the same method is being called from a test method it is ok.
有人可以提供帮助吗?
推荐答案
感谢小费nicole.torres。
Thanks for the tip nicole.torres.
对于这个问题,我们可以在maven-shade-plugin资源转换器中使用appendingtransformer:
For this problem we can use the appendingtransformer avalaible in the maven-shade-plugin resource transformers:
使用此方法,我们可以附加所有META-INF / kie。 conf文件。在ubber jar中创建KieBase或KieContainer时面对空指针的任何人,请访问此线程。我花了三天的时间找到解决方案,并尝试为网上几乎所有可恶的流口水示例创建一个ubber jar :(
Using this we can append all META-INF/kie.conf files. Anyone facing a null pointer when creating a KieBase or KieContainer in an ubber jar, visit this thread. I spent three days to find the solution and tried to create an ubber jar for almost every damn drools example available online :(
这篇关于Drools 7.4.1 kieservices.factory.get()返回null的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!