在Drools Workbench 6.0.1中更改规则时,不会更新Drools kie存储库

时间:2014-08-02 08:32:06

标签: drools

在将drools工作台与应用程序集成时,在drools kie 6.0.1中出现问题。

String url = "http://localhost:4040/kie-drools-wb-distribution-wars-6.0.1.Final-tomcat7.0/maven2/com/dcproject1/dcproject1/1.0/dcproject1-1.0.jar";

    ReleaseIdImpl releaseId = new ReleaseIdImpl("com.dcproject1", "dcproject1","LATEST");

    KieServices ks = KieServices.Factory.get();

    ks.getResources().newUrlResource(url);

    KieContainer kieContainer = ks.newKieContainer(releaseId);

    // check every 5 seconds if there is a new version at the URL
    KieScanner kieScanner = ks.newKieScanner(kieContainer);
    kieScanner.start(5000L);

当我通过 Drools-6 Workbench UI 更新我的工作台规则时,它会抛出异常

13:43:16.853 [Timer-0] INFO odckbimpl.KieRepositoryImpl - 添加了KieModule:ZipKieModule [ReleaseId = com.dcproject1:dcproject1:1.0.1file = E:\ Users \ kjariwala1.m2 \ repository \ com \ dcproject1 \ dcproject1 \ 1.0.1 \ dcproject1-1.0.1.jar] 线程中的异常" Timer-0"显示java.lang.NullPointerException     在org.drools.compiler.kie.builder.impl.KieContainerImpl.updateToVersion(KieContainerImpl.java:161)     在org.kie.scanner.KieRepositoryScannerImpl.updateKieModule(KieRepositoryScannerImpl.java:214)     在org.kie.scanner.KieRepositoryScannerImpl.scanNow(KieRepositoryScannerImpl.java:204)     在org.kie.scanner.KieRepositoryScannerImpl $ ScanTask.run(KieRepositoryScannerImpl.java:193)     在java.util.TimerThread.mainLoop(Timer.java:555)     在java.util.TimerThread.run(Timer.java:505)

修改规则时,我应该在工作台中更改版本.......

但是,添加新规则或删除现有规则效果非常好.....

感谢adavance ....

1 个答案:

答案 0 :(得分:0)

最后,我找到了解决方案。 在drools 6.0.1中,当您在默认包中创建规则时,它会在从droools workbench修改该规则时创建NullPointerException。