我正在使用Kie-CI api扫描本地maven存储库中的最新规则集。升级到7.5.0版后,Kie-CI无法运行。以下是我正在使用的代码。异常说工件不存在但实际上工件存在于存储库中。使用Kie-CI api创建KJAR工件。任何有关这方面的见解都会有所帮助。
代码:
@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)
答案 0 :(得分:0)
有完全相同的问题。
这似乎是因为jar xerces:xercesImpl:2.11.0.SP5
不在标准存储库中。
作为MvnRepository states here,需要从JBoss 3rd Party repository或其他一些存储库中获取此工件。