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 :
Hi,
I've been experimenting with the Guided Rule Editor plug-in in
Eclipse. I've built a Drools Project using the default Hello World
sample application. I've 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
I've tried variations to add the drools.package as a PKG type, I've
had the rules (and package) in both "com.sample" and /src/main/rules,
but I can't 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 isn't being used currently).
I suspect the issue is simple, but I haven't been able to figure it
out. Any help would be appreciated.
------------------------------------------------------------------------
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users