reloadKnowledgeBase java.lang.NullPointerException
by ayonchak
Hi All,
I am getting Nullpointer exception the application is trying to
reloadKnwledgeBase. I have the following code in application.
public void init() {
logger.info("Group Rule Engine Initiated..!!");
/**
* Polling interval needs to be externalized
*/
knowledgeAgent = KnowledgeAgentFactory.newKnowledgeAgent("FiveSeries");
knowledgeAgent.applyChangeSet(ResourceFactory
.newFileResource(propertyReader
.getProperty("DROOLS_GUVNOR_CHAGNE_SET_XML_PATH")));
ResourceFactory.getResourceChangeScannerService().start();
ResourceFactory.getResourceChangeNotifierService().start();
if (knowledgeAgent != null && knowledgeAgent.getKnowledgeBase()!=null &&
!knowledgeAgent.getKnowledgeBase().getKnowledgePackages().isEmpty()) {
knowledgeBase = knowledgeAgent.getKnowledgeBase();
}
logger.info("Group Rule Engine is ready to use..!!");
}
public void reloadKnowledgeBase() {
if (knowledgeAgent != null && knowledgeAgent.getKnowledgeBase()!=null &&
!knowledgeAgent.getKnowledgeBase().getKnowledgePackages().isEmpty()) {
knowledgeBase = knowledgeAgent.getKnowledgeBase();
logger.debug("KnowledgeBase reloaded..!!");
} else {
logger.info("KnowledgeBase not reloaded..!!");
ResourceFactory.getResourceChangeScannerService().stop();
ResourceFactory.getResourceChangeNotifierService().stop();
init();
}
}
reloadKnowledgeBase() is called once in application during Login. The
problem is occurring in Development application. When I am using that
Change-Set.xml in my local application, it is working perfectly fine. I m
not getting the problem. I bounced both Jboss and application servers but
still no luck!
--
View this message in context: http://drools.46999.n3.nabble.com/reloadKnowledgeBase-java-lang-NullPoint...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 6 months
resource Allocation in Drools planner
by tzimis
Hi I’m newbie so be generous. I’m dealing with a project for a cloud system
and I have a cp problem so any advice how to deal with it will be helpful.
Suppose that we have 5 machines each machine has the properties below:
• Sec_level: level of security that offers.
• Max_CPU: Max cpu resources that offers
• Max_Ram: Max ram resources that offers
• Max_HD: Max Storage resources that offers •
Max_Net: Max Bandwidth resources that offers
Then suppose that we have 20 VMs that must allocated to these machines Every
VM has these demands:
• Priority: The priority that this machine has.
• Min_sec_level: The minimum sec level of the machine that can service this
vm
• CPU: the cpu resources that demands
• Ram: ram resources that demands
• HD: storage resources that demands
• Net: resources that demands. We can have a solution where few Vms aren’t
allocated but the allocated Vms must have bigger priority than the
unallocated. Can anybody help me by giving me few advices hot to cope with
this problem???
--
View this message in context: http://drools.46999.n3.nabble.com/resource-Allocation-in-Drools-planner-t...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 6 months
Rules stop firing when white-space is changed
by dcrissman
I have an issue where I am changing white-space in a drl file and suddenly
some rules stop firing, but others do not. Has anyone seen behavior like
this?
I have the resource-change-scanner configured to watch the drl file for
changes, and then the following output is displayed:
KnowledgeAgent applying ChangeSet
KnowledgeAgent new KnowledgeBase now built and in use
So the changes to the resource file are being detected and re-loaded.
--
View this message in context: http://drools.46999.n3.nabble.com/Rules-stop-firing-when-white-space-is-c...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 6 months
Drools: organizing and using a large fact base
by Ulrich Scholz
Dear all,
I'm designing a system that operates on data collected from software
installations deployed to customers. Every day, a batch of data comes in
from every customer. Over time, we want to build a knowledge base that,
e.g., fires for certain patterns in that data. (Yes, I think a rule engine
is the right tool for this task.)
The fact base will become large: 356 days x 1000 customers x 100 or so
facts. What are "reasonable" sizes of fact bases that Drools can cope with?
The kind of data and the expected rules might allow to restrict the data to
slices: Only data from one customer, only from a few customer in a time
period, etc. That sounds like OLAP: The data is a cube with dimensions
customer and time. For (re-)evaluating the rules to a specific end: slice
the cube, establish the Drools fact base from the slice, and fire rules of
the corresponding set.
Do you have suggestions on how to organize the data? What database
technologie to use?
Does what I say make any sense at all?
Best, Ulrich
--
View this message in context: http://drools.46999.n3.nabble.com/Drools-organizing-and-using-a-large-fac...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 6 months
Disable strict mode in 5.2 via Spring configuration
by dcrissman
We are currently using an older version of Drools and are looking to upgrade
to the current. When we attempt this in testing we get a lot of issues
around mvel being in strict mode. While we certainly would love to address
these syntax issues on a case by case basis, for the time being we'd like to
just disable strict mode so that we can move forward with other testing that
we need to do.
We are using Spring context files to setup our Drools environment and would
love to be able to configure mvel in the same place. I have searched around
and have been unable to find a direct answer to this question...
Is there a way to disable strict mode from within a Spring context file?
Thanks.
--
View this message in context: http://drools.46999.n3.nabble.com/Disable-strict-mode-in-5-2-via-Spring-c...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 6 months
rule parse error for null check
by Neel
Hi,I'm using drools-5.3.0.Beta1. I've following rule file:
import java.util.*;
declare Student
name : String @key
subjectGradeMap : HashMap
end
rule "Subject grade points"
dialect "mvel"
when
$u : Student()
then
if($u.subjectGradeMap == null)
{
$u.subjectGradeMap = new HashMap<String,Integer>();
}
$u.subjectGradeMap["CompSc"] += 100;
System.out.println("Marks added");
end
I get following error while rule compilation:Unable to Analyse Expression if($u.subjectGradeMap == null);
{
$u.subjectGradeMap = new HashMap<String,Integer>();
};
$u.subjectGradeMap["CompSc"] += 100;
System.out.println("Marks added");:
[Error: was expecting type: java.lang.Object; but found type: <Unknown>]
[Near : {... if($u.subjectGradeMap == null) ....}]
^
[Line: 1, Column: 1] : [Rule name='Subject grade points']
Please let me know if this is correct usage in the above scenario.
Thanks,Neel
14 years, 6 months
fireAllRules() doesn't return back
by Neel
Hi,I'm using drools-5.3.0.Beta1. I've following rule definition:
import java.util.*;
declare Student
name : String @key
subjectGradeMap : HashMap
end
rule "Subject grade points"
dialect "mvel"
when
$u : Student()
then
$u.subjectGradeMap["CompSc"] += 100;
System.out.println("Marks added");
end
While executing RHS of above rule, fireAllRules() doesn't return, it hangs.Please help.Thanks,Neel
14 years, 6 months