[rules-users] Rule Validation/Package Build Error in Guvnor: Class Not Found

Ike Okafo iokafo at gmail.com
Mon Jun 28 16:32:05 EDT 2010


Hello,
I am new to Drools and have written a rule .DRL file which contains some
helper function imports from other packages, fact objects imports from
other packages and the rules that act on these facts. The file works well
when I call it from my javacode using the rulebase or knowledgebase
approach.
The drl file itself is in its own package.

I now have a requirement to call the same rules from within Guvnor.
The goal is to enable business users modify these rules through the
Guvnor UI and also take advantage of the disable individual rules
feature within guvnor.
My current difficulty is importing and validating the rules in guvnor,
along with the associated fact jar files and finally interfacing
with guvnor from my code. Any help would be appreciated .
The main error happens when I try to build a binary package and create
a snapshot of the working rule file I imported for deployment.
When I hit the save and validate configuration button, I get
*"class not found"* validation errors for all the classes imported at
the top of the rule file - includingng the helper import functions
and facts used in the rules. Same thing happens when I try to
build the package I get the following errors
"Error importing: <list of all classes in import statement in rule file>"

Here are the steps I followed in importing the rule file and Jar file
containing the classes
into Guvnor
(1) First within Guvnor I created a package corresponding to the package
path
for for each of the jar files whose classes are referenced/imported in the
rule .DRL file

(2) I created the jar files for each of these packages in eclipse

(3) Imported those jars individually into each of the packages created in
guvnor
    using upload model jar function and selecting the appropriate path as
    created in step 1 2 above

(4) Imported the rule file which is in its own package - using the create
package (upload method)

(5) I then try to save and validate the imported rule file in step 5 (this
is where the error occurs)


I have already setup my code to call guvnor as follows

RuleAgent agent = RuleAgent.newRuleAgent("guvnor.properties");
RuleBase masterRuleBase = agent.getRuleBase();

guvnor.properties contains only one entry
url =
http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/SomePackage.drools/LATEST

It is my understanding that after I import the rule file
I need to save and validate and build the package
in order to  point the url to the path above. If I point the url to just
the drl file itself will it work?
i.e url=
http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/SomePackage.drools/LATEST.drl


Any help to resolve the class not found error will
be much appreciated

Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20100628/81993af1/attachment.html 


More information about the rules-users mailing list