classLoader issue...
by Julien Nicoulaud
Hi, I'm migrating my system from Drools 4.0.7 to Drools 5.1.0.
Now when I try to compile rules that check fact fields, I get the
following exception:
ERROR: EventDispatcher: Error during dispatch.
(java.lang.NoClassDefFoundError:
org/drools/base/extractors/BaseObjectClassFieldReader)
java.lang.NoClassDefFoundError:
org/drools/base/extractors/BaseObjectClassFieldReader
( http://paste2.org/p/296380 )
It seems the classloaders I pass to the configurations are not taken in
account... I get exactly the same error if I do not specify the
classloaders. Here is the code:
KnowledgeBuilderConfiguration kBuilderCfg =
KnowledgeBuilderFactory.newKnowledgeBuilderConfiguration(null,classLoader);
KnowledgeBuilder knowledgeBuilder =
KnowledgeBuilderFactory.newKnowledgeBuilder(kBuilderCfg);
KnowledgeBaseConfiguration kbaseConfig =
KnowledgeBaseFactory.newKnowledgeBaseConfiguration(null,multiBundleClassLoader);
kbaseConfig.setOption(EventProcessingOption.STREAM);
knowledgeBase =
KnowledgeBaseFactory.newKnowledgeBase(kbaseConfig);
On Drools 4, we did exactly the same with PackageBuilder instead of
KnowledgeBuilder and RuleBase for KnowledgeBase. So the classloaders I
pass are the good ones... Is there some trick ?
Thanks for any help !
16 years, 8 months
[drools-solver] help for defining my drools model / moves
by Laurent Michenaud
Hi,
Here is my test :
I have an appointment to schedule on a customer availability.
I have a list of customer availabilities.
A customer availability is a period.
An appointment needs an exact number of persons.
A resource is composed of persons ( between 1 and n ) and has availabilities too.
The problem is to schedule the appointment : it has to choose the
right resource availabilities that matches one of the customer availabilities and
the total number of persons inside chosen resources must match exactly the
needed number of persons of the appointment.
My moves are for the moment :
- Change the customer availability.
- Add a resource to the list of chosen resources.
My init is :
- One of the customer availability is taken
- 0 resource taken.
First, i don't know if my model and my init are ok.
Secondly, the solver does the following :
- At the beginning, the score is bad because there is no resource.
So, it begins adding resource and the score is getting better
but when it changes the availability, the score gets very bad either because
the chosen resources don't match the new availability or it has no resource
inside. The solver doesnot seem to interest in the new chosen availibity with no
resource, but i wish it does.
Thanks for your remarks/help
Best regards
16 years, 8 months