Drools Kie Scanner 7.5.0不起作用



我正在使用Kie-Ci API在本地Maven存储库中扫描最新规则集。Kie-CI升级到版本7.5.0后没有工作。以下是我正在使用的代码。异常说,伪像不存在,但实际上存在于存储库中。使用Kie-CI API创建Kjar Artifact。对此的任何见解都会有所帮助。

代码:

@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第三方存储库或其他一些存储库中获取此工件。

最新更新