[rules-users] [Drools 4.0.7]RuleAgent not working correctly inside service

Jones, Alan R alan.r.jones at boeing.com
Fri Jul 25 16:17:22 EDT 2008


Hi,

1) I use a package created/deployed in BRMS on a remote machine. The drl
source file has certain dependencies in it (the data model). These
dependencies are inside a jar file, used by BRMS to create/compile the
package.

 2) Inside my web service class I have drools-core.jar, in a lib. I have
a method that uses URLClassloader to load the jar with the data model
from an external directory at each service invocation (data models may
get switched out every now and then).  

3) I create a Properties object containing URL to the BRMS package, etc.
I use this to create a new RuleAgent:

RuleAgent agent = RuleAgent.newRuleAgent(MyProps);

But, I get NoClassDefError or Class loading errors when the rule agent
tries to load the package, it cannot see the classes I loaded from the
data model jar. In fact, it does not recognize the drools core jars
inside the /lib directory of my service either. However, if I put all
those jars into the WEB-INF/lib directory of the webapp that constitues
my web service implementation (axis2 in this case) and reboot tomcat,
everything works fine. But of course this is very hokey -- is not
acceptable.

How do I get my RuleAgent to see the data model classes I loaded? Why
does it not like the drools-core.jar inside my service? Is this going to
be a class loader nightmare?


Thanks,

Alan J






More information about the rules-users mailing list