Receiving drools dialect Error message whenever a new set of rules are being compiled in the service

425 views
Skip to first unread message

Vineeth Dasaraju

unread,
Oct 19, 2017, 3:39:29 PM10/19/17
to drools...@googlegroups.com
Hi,

We’ve encountered this failure in the drools rule compilation whenever a new set of rules are added. The weird thing here is if we restart the service, then we don't see this issue.

Unable to build KieBaseModel:kBase
[DialectError message='Unable to wire compiled classes, probably related to compilation failures:Unable to wire up JavaDialect']

We are using Drools 6.3.0.FINAL with Java jre1.8.0_144. The code being used to compile the rules is as follows:

            int kieJarReleaseId = 0;
    ReleaseId releaseId;
            KieServices ks = KieServices.Factory.get();
            KieModuleModel kieModuleModel;
            releaseId = ks.newReleaseId("org.kie", "test-upgrade", "1." + kieJarReleaseId++ + ".0");
            // Create the in-memory File System and add the resources files to it
            String kBaseName = "kBase";
            kieModuleModel = ks.newKieModuleModel();
            KieBaseModel kieBaseModel = kieModuleModel.newKieBaseModel(kBaseName);
            kieBaseModel.setDefault(true).setEqualsBehavior(EqualityBehaviorOption.EQUALITY).setEventProcessingMode(
                EventProcessingOption.STREAM);
            kieBaseModel.newKieSessionModel("defaultKSession").setType(KieSessionType.STATEFUL).setDefault(true);
            // Kie Base Configuration
            KieBaseConfiguration kbConfig = ks.newKieBaseConfiguration();
            kbConfig.setOption(ConstraintJittingThresholdOption.get(-1));
            if (!drlFileContent.isEmpty()) {
                KieFileSystem kfs = ks.newKieFileSystem();
                kfs.generateAndWritePomXML(releaseId);
                kfs.writeKModuleXML(kieModuleModel.toXML());
                kfs.write("src/main/resources/rules.drl", drlFileContent);
                KieBuilder kbuilder = ks.newKieBuilder(kfs);
                kbuilder.buildAll();
                if (kbuilder.getResults().hasMessages(Level.ERROR)) {
                    return false;
                }
                KieModule kModule = kbuilder.getKieModule();
                if(kieJarReleaseId > 1){
                    KieRepository kRepo = ks.getRepository();
                    kRepo.removeKieModule(ks.newReleaseId("org.kie", "test-upgrade", "1." + (kieJarReleaseId-2)+".0"));
                }
                kContainer = ks.newKieContainer(kModule.getReleaseId());
            }

Could any of the experts let me know what we are missing /  why we are encountering this error?

Regards,
Vineeth

Mario Fusco

unread,
Oct 20, 2017, 2:59:44 AM10/20/17
to Drools Usage
Hi,

is there any reason why you're doing this?

kbConfig.setOption(ConstraintJittingThresholdOption.get(-1));

Also please send a complete reproducer otherwise it will be impossible for us to understand what's going wrong there.

Thanks,
Mario

--
You received this message because you are subscribed to the Google Groups "Drools Usage" group.
To unsubscribe from this group and stop receiving emails from it, send an email to drools-usage+unsubscribe@googlegroups.com.
To post to this group, send email to drools...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/drools-usage/CAOd6XDOGerf1rBUskvowve1-uNJFtFj9sCsui1QWirw1Xbhpkw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Vineeth Dasaraju

unread,
Oct 23, 2017, 1:17:14 PM10/23/17
to mario...@gmail.com, drools...@googlegroups.com
Hi Mario,

No specific reason for setting that. 

We are observing this behavior in only one use case where drools has been deployed into a docker container. I believe that the issue is specific to that environment. How do you suggest that we reproduce this situation?

Regards,
Vineeth

Reply all
Reply to author
Forward
0 new messages