Drools Kie Scanner 7.5.0无法正常工作 [英] Drools Kie Scanner 7.5.0 not working

查看:306
本文介绍了Drools Kie Scanner 7.5.0无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Kie-CI api扫描本地Maven存储库中的最新规则集.升级到7.5.0版后,Kie-CI无法正常工作.下面是我正在使用的代码.异常表示工件不存在,但实际上工件存在于存储库中. KJAR工件是使用Kie-CI api创建的.任何对此的见解都会有所帮助.

代码:

@Async
    @Transactional
    public void scanLatestRuleset(String version){

            log.info("Request received to activate new ruleset version: [ " + version + " ]");
            KieServices kieServices = KieServices.Factory.get();
            ReleaseId releaseId = kieServices.newReleaseId( "com.example", "sample-rules", version );

             //Using Kie Scanner to activate
             this.kieContainer = kieServices.newKieContainer( releaseId );
             KieScanner kScanner = kieServices.newKieScanner( kieContainer );
             kScanner.scanNow();
}

日志:

2018-02-22 11:21:46.190 AM [ruleserviceTaskExecutor-2] INFO  com.example.service.RuleService - Request received to activate new ruleset version: [ 0.0.3-SNAPSHOT ]
2018-02-22 11:21:49.607 AM [ruleserviceTaskExecutor-2] WARN  o.a.m.integration.MavenRepository - Unable to resolve artifact: xerces:xercesImpl:2.11.0.SP5
2018-02-22 11:21:49.610 AM [ruleserviceTaskExecutor-2] ERROR o.s.a.i.SimpleAsyncUncaughtExceptionHandler - Unexpected error occurred invoking async method 'public void com.example.service.RuleService.scanLatestRuleset(java.lang.String)'.
java.lang.NullPointerException: null
    at org.kie.scanner.KieRepositoryScannerImpl.indexArtifacts(KieRepositoryScannerImpl.java:409)
    at org.kie.scanner.KieRepositoryScannerImpl.setKieContainer(KieRepositoryScannerImpl.java:117)
    at org.drools.compiler.kie.builder.impl.KieServicesImpl.newKieScanner(KieServicesImpl.java:227)
    at com.example.service.RuleService.scanLatestRuleset(RuleService.java:814)
    at com.example.service.RuleService$$FastClassBySpringCGLIB$$5b9ebbea.invoke(<generated>)
    at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
    at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:738)
    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:282)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
    at org.springframework.aop.interceptor.AsyncExecutionInterceptor$1.call(AsyncExecutionInterceptor.java:115)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)

解决方案

存在完全相同的问题.

这似乎是由于jar xerces:xercesImpl:2.11.0.SP5不在标准存储库中.

由于MvnRepository 在此处声明,因此需要选择此工件从 JBoss 3rd Party存储库或其他存储库中./p>

I am using Kie-CI api to scan the latest ruleset in local maven repository. Kie-CI is not working after upgrading to version 7.5.0. Below is the code I am using. Exception says artifact does not exists but actually artifact exists in repository. KJAR artifact is created using Kie-CI api. Any insights on this would be helpful.

Code:

@Async
    @Transactional
    public void scanLatestRuleset(String version){

            log.info("Request received to activate new ruleset version: [ " + version + " ]");
            KieServices kieServices = KieServices.Factory.get();
            ReleaseId releaseId = kieServices.newReleaseId( "com.example", "sample-rules", version );

             //Using Kie Scanner to activate
             this.kieContainer = kieServices.newKieContainer( releaseId );
             KieScanner kScanner = kieServices.newKieScanner( kieContainer );
             kScanner.scanNow();
}

Logs:

2018-02-22 11:21:46.190 AM [ruleserviceTaskExecutor-2] INFO  com.example.service.RuleService - Request received to activate new ruleset version: [ 0.0.3-SNAPSHOT ]
2018-02-22 11:21:49.607 AM [ruleserviceTaskExecutor-2] WARN  o.a.m.integration.MavenRepository - Unable to resolve artifact: xerces:xercesImpl:2.11.0.SP5
2018-02-22 11:21:49.610 AM [ruleserviceTaskExecutor-2] ERROR o.s.a.i.SimpleAsyncUncaughtExceptionHandler - Unexpected error occurred invoking async method 'public void com.example.service.RuleService.scanLatestRuleset(java.lang.String)'.
java.lang.NullPointerException: null
    at org.kie.scanner.KieRepositoryScannerImpl.indexArtifacts(KieRepositoryScannerImpl.java:409)
    at org.kie.scanner.KieRepositoryScannerImpl.setKieContainer(KieRepositoryScannerImpl.java:117)
    at org.drools.compiler.kie.builder.impl.KieServicesImpl.newKieScanner(KieServicesImpl.java:227)
    at com.example.service.RuleService.scanLatestRuleset(RuleService.java:814)
    at com.example.service.RuleService$$FastClassBySpringCGLIB$$5b9ebbea.invoke(<generated>)
    at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
    at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:738)
    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:282)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
    at org.springframework.aop.interceptor.AsyncExecutionInterceptor$1.call(AsyncExecutionInterceptor.java:115)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)

解决方案

Had the exact same problem.

This seems to be due the jar xerces:xercesImpl:2.11.0.SP5 not being in standard repositories.

As MvnRepository states here, this artifact needs to be picked up from the JBoss 3rd Party repository or some other repository.

这篇关于Drools Kie Scanner 7.5.0无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆