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)
4

1 回答 1

0

有完全相同的问题。

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

正如 MvnRepository在这里所说,这个工件需要从JBoss 3rd Party 存储库或其他一些存储库中获取。

于 2018-05-04T08:28:47.937 回答