Unable to find implementation for BusinessRuleProvider
by John Peterson
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.j
ava:544)
at
org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.ja
va: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.j
ava:470)
... 3 more
Caused by: org.drools.CheckedDroolsException: Unable to find
implementation for BusinessRuleProvider
at
org.drools.compiler.BusinessRuleProviderFactory.throwNoImplementationFou
nd(BusinessRuleProviderFactory.java:66)
at
org.drools.compiler.BusinessRuleProviderFactory.loadProvider(BusinessRul
eProviderFactory.java:42)
at
org.drools.compiler.BusinessRuleProviderFactory.getProvider(BusinessRule
ProviderFactory.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.
13 years, 5 months
Protobuf Marshaller Question (ScheduledActivation Persistence)
by Philipp Herzig
Dear developers,
I believe this is a question for Edson.
I wonder if ScheduledActivations are added to the Agenda when
unmarshalling an existing session and fired as well, e.g., non-expired
timers.
I guess that this worked with the DefaultMarshaller implementation (at
least I can see LOCs in the InputMarshaller where normal or scheduled
activations are added to the newly created agenda). I cannot find
similar code in the ProtobufMarshaller or, more precisely, the
ProtobufInputMarshaller.
I also tried to override MarshallerProvider in order to use the
DefaultMarshaller but that is obviously not-consistent
(ClassCastException) with the current codebase anymore.
Hopefully, I am doing/understanding sth. completely wrong here.
Thanks for any help regarding this issue,
Philipp
13 years, 5 months
Query regarding guvnor and drools remote execution using categories of guvnor
by Krishnendra Nandi
Hi All
I am a newbie
I have a question
In guvnor we have categories
Using REST API we can access assets through categories like
/rest/categories/{}/assets ...something like this
I have a JSON object which gets populated which has references to binary
for all the assets
1) How do we construct the KnowledgeBase out of it and execute rules based
on those subset of rules ? is it advisable to do that ?
2) How do we get all the declarative facts residing inside guvnor remotely
from a Java client ?
--
Thanks and Regards
Krishnendra Nandi
Phone :+91-93727-08782
Skype :krish_nandi_78
Gtalk :krishnendra@gmail.com
13 years, 5 months
Finding the definition of a rule
by LStampf
Hi,
I am currently using a KnowledgeAgent to implement hot deployment in our
applications. So far this is working, but now the requirement arose to
remove specific rules via program call. I thought the easiest way would be
to remove the rule from the resources and let the KnowledgeAgent handle the
rest. But as far as I see, there is no way to get the source resource of a
rule from the KnowledgeBase/RuleBase. I guess I wont have another choice
than to parse the initial changeset, gather all resources, and go through
them to find and remove the rule.
But this seems like overkill to achieve something that simple. Does anybody
know a better way to remove specific rules while using a KnowledgeAgent.
kind regards
Lukas
--
View this message in context: http://drools.46999.n3.nabble.com/Finding-the-definition-of-a-rule-tp4020...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 5 months
com.google.protobuf.MessageOrBuilder
by gboro54
I am trying to deploy an application onto JBoss 7.1 running drools 5.4 and I
am getting the following error. Any thoughts?
java.lang.ClassNotFoundException: com.google.protobuf.MessageOrBuilder from
[Module "deployment.fbms.ear.fbms-service.jar:main" from Service Module
Loader]
at
org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)
at
org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)
at
org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)
at
org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:423)
at
org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:423)
at
org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
at
org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)
... 26 more
--
View this message in context: http://drools.46999.n3.nabble.com/com-google-protobuf-MessageOrBuilder-tp...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 5 months
Local Variable
by joy
Hi
i need local variables in drl file.
it should hold integer/double value.
Setting an integer value to a local variable in some rule and getting that
integer value in some other rule
when
#some condition01
then
local variable=200
end
when
#some condition02
then
local variable =300
end
when
#some condition03
then
emp.salary=localvariable+2000
end
Anyone plz help me to resolve this.
Thank you
Joy
--
View this message in context: http://drools.46999.n3.nabble.com/Local-Variable-tp4020144.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 5 months