Hi,

If it is not the case already, could you try adding the "drools-ide-common" jar (along with its dependencies) to the classpath of your project?
Best regards,

Bruno.

John Peterson a écrit :
Unable to find implementation for BusinessRuleProvider

Hi,

Ive been experimenting with the Guided Rule Editor plug-in in Eclipse.  Ive built a Drools Project using the default Hello World sample application.  Ive created a new Guided Rule in my project called GuidedRule.brl and get the associated drools.package with it.  The rule is simple:

WHEN

THEN

  System.out.println(Rule has fired);

I build the knowledge base as follows:

        private static KnowledgeBase readKnowledgeBase() throws Exception {

                KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();

                kbuilder.add(ResourceFactory.newClassPathResource("SampleGuided.drl"), ResourceType.BRL);

                KnowledgeBuilderErrors errors = kbuilder.getErrors();

                if (errors.size() > 0) {

                        for (KnowledgeBuilderError error: errors) {

                                System.err.println(error);

                        }

                        throw new IllegalArgumentException("Could not parse knowledge.");

                }

                KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();

                kbase.addKnowledgePackages(kbuilder.getKnowledgePackages());

                return kbase;

        }

The only line changed is adding the resource of type BRL.

When I try to run, I get the following error:

java.lang.RuntimeException: org.drools.compiler.DroolsParserException: org.drools.CheckedDroolsException: Unable to find implementation for BusinessRuleProvider

        at org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:544)

        at org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:28)

        at com.sample.DroolsTest.readKnowledgeBase(DroolsTest.java:41)

        at com.sample.DroolsTest.main(DroolsTest.java:23)

Caused by: org.drools.compiler.DroolsParserException: org.drools.CheckedDroolsException: Unable to find implementation for BusinessRuleProvider

        at org.drools.compiler.PackageBuilder.addPackageFromBrl(PackageBuilder.java:386)

        at org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:470)

        ... 3 more

Caused by: org.drools.CheckedDroolsException: Unable to find implementation for BusinessRuleProvider

        at org.drools.compiler.BusinessRuleProviderFactory.throwNoImplementationFound(BusinessRuleProviderFactory.java:66)

        at org.drools.compiler.BusinessRuleProviderFactory.loadProvider(BusinessRuleProviderFactory.java:42)

        at org.drools.compiler.BusinessRuleProviderFactory.getProvider(BusinessRuleProviderFactory.java:25)

        at org.drools.compiler.PackageBuilder.addPackageFromBrl(PackageBuilder.java:366)

        ... 4 more

Ive tried variations to add the drools.package as a PKG type, Ive had the rules (and package) in both com.sample and /src/main/rules, but I cant seem to resolve the problem.  drools.package has been updated to include the package name (package com.sample;) and I import the message class as well (even though it isnt being used currently).

I suspect the issue is simple, but I havent been able to figure it out.  Any help would be appreciated.


_______________________________________________ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users