Error deploying Guvnor 6.0.0.Beta1 on Tomcat 7
by maunakea
I was excited to try out Guvnor 6. Downloaded the Beta1 and tried deploying
on Tomcat 7.0.32. It deployed fine, but when I access the URL, I get the
trace below. Anybody able to deploy on Tomcat 7?
org.jboss.errai.bus.client.api.base.MessageDeliveryFailure: error invoking
endpoint
at
org.jboss.errai.bus.server.io.ConversationalEndpointCallback.callback(ConversationalEndpointCallback.java:132)
at
org.jboss.errai.bus.server.io.RemoteServiceCallback.callback(RemoteServiceCallback.java:54)
at
org.jboss.errai.cdi.server.CDIExtensionPoints$3.callback(CDIExtensionPoints.java:512)
at
org.jboss.errai.bus.client.framework.DeliveryPlan.deliver(DeliveryPlan.java:43)
...
Caused by: java.lang.NullPointerException
at
org.uberfire.backend.server.UserServicesImpl.buildPath(UserServicesImpl.java:71)
at
org.uberfire.backend.server.UserServicesImpl$Proxy$_$$_WeldClientProxy.buildPath(UserServicesImpl$Proxy$_$$_We
at
org.uberfire.backend.server.WorkbenchServicesImpl.getPathToDefaultEditors(WorkbenchServicesImpl.java:105)
at
org.uberfire.backend.server.WorkbenchServicesImpl.loadDefaultEditorsMap(WorkbenchServicesImpl.java:76)
at
org.uberfire.backend.server.WorkbenchServicesImpl$Proxy$_$$_WeldClientProxy.loadDefaultEditorsMap(WorkbenchSer
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.jboss.errai.bus.server.io.ConversationalEndpointCallback.callback(ConversationalEndpointCallback.java:114)
... 29 more
*** Message delivery failure ***
Bus: org.jboss.errai.bus.server.ServerMessageBusImpl@134137c
Message: CommandType=loadDefaultEditorsMap:,
ErrorTo=org.uberfire.client.workbench.services.WorkbenchServices:RPC.loadDef
errorMessage: Error calling remote service:
org.uberfire.client.workbench.services.WorkbenchServices:RPC
exception: org.jboss.errai.bus.client.api.base.MessageDeliveryFailure: error
invoking endpoint
disconnect: false
org.jboss.errai.bus.client.api.base.MessageDeliveryFailure: error invoking
endpoint
at
org.jboss.errai.bus.server.io.ConversationalEndpointCallback.callback(ConversationalEndpointCallback.java:132)
at
org.jboss.errai.bus.server.io.RemoteServiceCallback.callback(RemoteServiceCallback.java:54)
at
org.jboss.errai.cdi.server.CDIExtensionPoints$3.callback(CDIExtensionPoints.java:512)
at
org.jboss.errai.bus.client.framework.DeliveryPlan.deliver(DeliveryPlan.java:43)
--
View this message in context: http://drools.46999.n3.nabble.com/Error-deploying-Guvnor-6-0-0-Beta1-on-T...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 7 months
window:length with variables as constraints not working correctly
by Andreas
Hello,
I'm having a problem using sliding windows length
I would like to get the average oft he last 5 Events of the AccountNumber
"123"
(rule: FiveLastEventsWhichBelongsToTheAccount).
If there are no Events with other AccountNumbers and if the AccountNumber is
directly added as String as a rule constraint, both cases will work
correctly as I understand the rule behaviour
But
If there are Events available for different AccountNumbers and the
AccountNumber is extracted from the $account : Account() to use it as a
constraint to check if the Event belongs to the AccountNumber the condition
is not working like first filter then window; it seems to work like first
window then filter)
I don’t know if it should work like this or if it is maybe a bug.
If I’m wrong, how is it possible to solve my problem, so that I don’t need
to write a rule for every possible account number.
Thanks in advanced
Andreas
I’m using drools version 5.3.5 because of the NPE (
https://issues.jboss.org/browse/DROOLS-78?page=com.atlassian.jira.plugin....),
which don’t occurs in this test case but in other rules I’ve implemented. So
it would be nice to have a solution for version 5.3.5.
For Testing you can use the following classes and drl File:
public class Account {
private String number = "";
public Account() {
super();
}
public String getNumber() {
return number;
}
public void setNumber(String number) {
this.number = number;
}
}
public class Event implements Serializable {
private static final long serialVersionUID = 1L;
private String accountNumber = "";
private double amount = 0.00;
public Event(String accountNumber, double amount) {
this.accountNumber = accountNumber;
this.amount = amount;
}
public String getAccountNumber() {
return accountNumber;
}
public void setAccountNumber(String accountNumber) {
this.accountNumber = accountNumber;
}
public double getAmount() {
return amount;
}
public void setAmount(double amount) {
this.amount = amount;
}
}
Rule file
declare Event
@role( event )
end
rule "FiveLastEventsWhichBelongsToTheAccount"
when
$account : Account()
$averageOfAmount : Number( doubleValue > 0 )
from accumulate(
Event(
//accountNumber == “123“, //works
accountNumber == $account.number, //not working if
more than one
//AccountNumbers available during all events
$amount : amount
)
over window:length( 5 ) from
entry-point EventStream,
average($amount)
)
then
System.out.println("Average of aveOfLastClaims: " + $averageOfAmount);
End
TesterClass:
public class Tester {
private static final String DRL_FILENAME = "account.drl";
private static final String ENTRY_POINT = "EventStream";
private static KnowledgeBase knowledgeBase = null;
private static StatefulKnowledgeSession session = null;
private static Account account123 = null;
private static String accountNumber123 = "123";
private static Account account456 = null;
private static String accountNumber456 = "456";
private static void setUp() {
prepareKnowledgeBase();
prepareStatefulKnowledgeSession();
prepareAccounts();
}
private static void prepareAccounts() {
account123 = new Account();
account123.setNumber(accountNumber123);
account456 = new Account();
account456.setNumber(accountNumber456);
}
private static void prepareStatefulKnowledgeSession() {
KnowledgeSessionConfiguration sessConfig =
KnowledgeBaseFactory.newKnowledgeSessionConfiguration();
sessConfig.setOption(ClockTypeOption.get("pseudo"));
session = knowledgeBase.newStatefulKnowledgeSession(sessConfig, null);
}
private static void prepareKnowledgeBase() {
try {
KnowledgeBuilder builder = KnowledgeBuilderFactory.newKnowledgeBuilder();
builder.add(ResourceFactory.newClassPathResource(DRL_FILENAME),
ResourceType.DRL);
KnowledgeBuilderErrors errors = builder.getErrors();
if (errors.size() > 0) {
for (KnowledgeBuilderError error : errors) {
System.err.println(error);
}
throw new IllegalArgumentException("Could not parse knowledge.");
}
knowledgeBase = KnowledgeBaseFactory.newKnowledgeBase();
knowledgeBase.addKnowledgePackages(builder.getKnowledgePackages());
} catch (Exception e) {
e.printStackTrace();
}
}
public static void main(String[] args) {
setUp();
try {
SessionPseudoClock clock = session.getSessionClock();
WorkingMemoryEntryPoint eventStream =
session.getWorkingMemoryEntryPoint(ENTRY_POINT);
eventStream.insert(new Event(accountNumber123, 50.00));
eventStream.insert(new Event(accountNumber456, 500.00));
clock.advanceTime(5, TimeUnit.DAYS);
eventStream.insert(new Event(accountNumber123, 40.00));
eventStream.insert(new Event(accountNumber456, 400.00));
clock.advanceTime(10, TimeUnit.DAYS);
eventStream.insert(new Event(accountNumber123, 30.00));
eventStream.insert(new Event(accountNumber456, 300.00));
clock.advanceTime(15, TimeUnit.DAYS);
eventStream.insert(new Event(accountNumber123, 20.00));
eventStream.insert(new Event(accountNumber456, 200.00));
clock.advanceTime(20, TimeUnit.DAYS);
eventStream.insert(new Event(accountNumber123, 10.00));
eventStream.insert(new Event(accountNumber456, 100.00));
session.insert(account123);
session.fireAllRules();
} catch (Throwable t) {
t.printStackTrace();
}
}
}
--
View this message in context: http://drools.46999.n3.nabble.com/window-length-with-variables-as-constra...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 7 months
[fusion] weird race conditions and a null pointer exception
by burmanator
I am running 2 rules that are very similar but with a slight change:
rule One
when
$foo : Foo($name : Name, $msg : Message !="")
$prev : ArrayList(size<1) from collect( Foo(Name==$name, Message == $msg,
this before $foo)
$list : Set(size>0) from accumulate( Foo(Name == $name, $msgs: Message !=
$msg, this after $foo), collectSet($msgs))
then
System.out.println($name + "\twent from \"" + $msg + "\"\tto " + $list);
end
rule Two
when
$foo : Foo($name : Name, $msg : Message !="")
Not( Foo(Name==$name, Message == $msg, this before $foo))
$list : Set(size>0) from accumulate( Foo(Name == $name, $msgs: Message !=
$msg, this after $foo), collectSet($msgs))
then
System.out.println($name + "\twent A from \"" + $msg + "\"\tto " + $list);
end
rule One works just fine however its rule Two I seem to be having trouble
with. In my main method I have an initial print statement, then I go through
this whole process of parsing XML files into objects and then adding those
objects into the session. Once all the objects are entered I do a print out,
I then call fireAllRules on the session and then do another print out.
When I use rule Two, my program starts firing the rules and displaying their
results almost immediately, even before the 2nd print out (sometimes even
before the first initial print out). Most of the time I get a Null Pointer
Exception but it does occasionally finish running. In the cases it does
finish it spits out the output from most of the rules then displays the 2nd
printout, the print out from a rule and then the ending print out. When it
does throw the null pointer exception I get:
java.lang.NullPointerException
at org.drools.core.util.LinkedList.remove(LinkedList.java:133)
at
org.drools.common.DefaultAgenda.addActivation(DefaultAgenda.java.446)
at
org.drools.common.DefaultAgenda.modifyActivation(DefaultAgenda.java:382)
at
org.drools.reteoo.RuleTerminalNode.modifyLeftTuple(RuleTerminalNode.java:301)
at
org.drools.reteoo.SingleLeftTupleSinkAdapter.propagateModifyChildLeftTuple(SingleLeftTupleSinkAdapter.java:259)
at
org.drools.reteoo.AccumulateNode.exaluateResultConstraints(AccumulateNode.java:676)
at
org.drools.reteoo.ReteooWorkingMemory$EvaluateResultConstraints.execute(ReteooWorkingMemory.java:590)
at
org.drools.common.PropagationContextImpl.evaluateActionQueue(PropagationContextimple:350)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:355)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:311)
at
org.drools.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:903)
at
org.drools.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:847)
at
org.drools.imp.StatefulKnowledgeSessionImpl.insert(StatefulKnowledgeSessionImpl.java:269)
at test2.Engine2.main(Engine2.java:80)
However sometimes when it throws the Null pointer exception, it prints out
some of the results of the rules in the middle of the display of the
exception, such as:
java.lang.NullPointerExceptionName1 went A from "msg1" to [msg2]
Name2 went A from "msg1" to [msg2]
at org.drools.core.util.LinkledList.remove(LinkedList.java.133)
and you know the rest.
When I run both rules together, for some reason it seems to run rule One
over the same name and message pair multiple times even though based on the
logic it should only run it based on the first occurrence.
Also I don't know if this matters but there are 361,694 objects that are
entered into the session, 44,269 of which are Foo objects
--
View this message in context: http://drools.46999.n3.nabble.com/fusion-weird-race-conditions-and-a-null...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 7 months
Exception when using retract
by Weiss, Wolfgang
Hi all!
I noticed problems when using retract in rules. Thereby, I get sometimes NullPointerExceptions like this (Drools Version 6.0.0.Beta1):
Exception executing consequence for rule "rule 6 - ts filter" in test: java.lang.NullPointerException
at org.drools.core.runtime.rule.impl.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:39)
at org.drools.core.common.DefaultAgenda.fireActivation(DefaultAgenda.java:1409)
at org.drools.core.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:1328)
at org.drools.core.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1546)
at org.drools.core.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:637)
at org.drools.core.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:601)
at org.drools.core.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:233)
at test.DroolsMain.insertEvent(DroolsMain.java:50)
at test.EventSender.run(EventSender.java:73)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.NullPointerException
at org.drools.core.util.index.LeftTupleIndexHashTable.remove(LeftTupleIndexHashTable.java:381)
at org.drools.core.reteoo.NotNode.retractLeftTuple(NotNode.java:301)
at org.drools.core.reteoo.CompositeLeftTupleSinkAdapter.doPropagateRetractLeftTuple(CompositeLeftTupleSinkAdapter.java:261)
at org.drools.core.reteoo.CompositeLeftTupleSinkAdapter.propagateRetractRightTuple(CompositeLeftTupleSinkAdapter.java:172)
at org.drools.core.reteoo.JoinNode.retractRightTuple(JoinNode.java:181)
at org.drools.core.reteoo.ObjectTypeNode.retractObject(ObjectTypeNode.java:344)
at org.drools.core.reteoo.EntryPointNode.retractObject(EntryPointNode.java:406)
at org.drools.core.common.NamedEntryPoint.delete(NamedEntryPoint.java:591)
at org.drools.core.base.DefaultKnowledgeHelper.retract(DefaultKnowledgeHelper.java:429)
at test.Rule_rule_6___ts_filter247591339.defaultConsequence(Rule_rule_6___ts_filter247591339.java:18)
at test.Rule_rule_6___ts_filter247591339DefaultConsequenceInvokerGenerated.evaluate(Unknown Source)
at test.Rule_rule_6___ts_filter247591339DefaultConsequenceInvoker.evaluate(Unknown Source)
at org.drools.core.common.DefaultAgenda.fireActivation(DefaultAgenda.java:1399)
... 8 more
Or, using Drools 5.5.1-SNAPSHOT
Exception executing consequence for rule "rule 3 - remove start stop fact" in test: java.lang.NullPointerException
at org.drools.runtime.rule.impl.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:39)
at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:1291)
at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:1215)
at org.drools.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1450)
at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:710)
at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:674)
at org.drools.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:230)
at test.DroolsMain.insertEvent(DroolsMain.java:50)
at test.EventSender.run(EventSender.java:73)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException
at org.drools.base.DefaultKnowledgeHelper.retract(DefaultKnowledgeHelper.java:419)
at test.Rule_rule_3___remove_start_stop_fact.defaultConsequence(Rule_rule_3___remove_start_stop_fact.java:8)
at test.Rule_rule_3___remove_start_stop_factDefaultConsequenceInvokerGenerated.evaluate(Unknown Source)
at test.Rule_rule_3___remove_start_stop_factDefaultConsequenceInvoker.evaluate(Unknown Source)
at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:1281)
... 8 more
The problematic rules mostly look something like this:
rule "rule 6 - ts filter"
agenda-group "evaluation"
when
$evtA : Event(type == EventType.START) from entry-point "InputStream"
$evtB : Event(type == EventType.START, this after $evtA, this != $evtA, senderId == $evtA.senderId) from entry-point "InputStream"
then
//do something
//...
retract($evtA);
end
The exception does not immediately occur. Sometimes it occurs sooner, sometimes it takes longer until it occurs. When the exception is thrown, it looks like that the event is not removed from the knowledge base (I watch the number of events in the knowledge base - fact count). I made the experience that this problem only occurs when the rule file grows (e.g. when there are more than 10 rules to execute) and when the load increases. To work temporarily around this problem, I set the java process to use only 1 processor in the windows task manager - which looks like this is a multi threading issue.
I can reproduce this exception with the Drools versions 5.5.0, 5.5.1-SNAPSHOT and 6.0.0.Beta1. I did not test the previous versions explicitly.
Please find attached a small dummy test application to reproduce this problem. Execute therefore the main method from the class "test.DroolsMain". Depending on your machine and load, the problem occurs sometimes sooner or sometimes later. Or, you might notice some other exception, but the problem when retracting events or facts is currently the biggest one in my productive applications.
Best regards,
Wolfgang
11 years, 7 months
Getting Started with an simple sample
by Stefan Schuster
Hello,
I’m still in the phase of learning the basics with drools. Therefor I
created a simplified problem that I try to realize it with drools:
I have several detectors, each of them measures something and converts it
into an integer value between 1 one 6. Every Minute a new measurement is
performed.
When a detector reaches a value of 5 or above, a textfile is created with
the name of the detector as filename and a predefined text as content. When
the detector reaches a value of 3 or less, the texfile is deleted.
My problem is that I’m still “thinking in java” and not yet “thinking in
drools”.
I guess the measured values would be facts that I insert (like the
key-pressed events in the pong-example) to the knowledgebase. But now I
stumble, I have no idea how to continue. Could anyone give me a helping
hand for the next steps?
Thanks in advance
Stefan
11 years, 7 months
How to Compute against WorkingMemory in Drools ?
by vr
I have been looking at the following scenario
1. Alerts are generated by an enterprise system and Sent to the Rule Engine
in batches.
2. I must check the alert batch for possible correlation between the alerts
based on Rules defined in my Rule file (.drl)
*3. Verify if any Correlation already exists for the alerts received if yes
update that correlation with fresh alert data*
4. if no correlation exists i do nothing.
5. If a Correlation exists and No correlation is present in RE representing
the same for those group of alerts I create a New Correlation and update the
RE.
*Steps 1 to 3 are repeated every 15 seconds in the system,*
How do I keep the Objects in Drools to keep checking for Correlation
scenarios as and when I receive data from the enterprise system at regular
intervals so that i can update existing correlation as metioned at *Step 3*
Any approach or suggestion would be very helpful.
-----
Thanks for the support ...!!!
VR
--
View this message in context: http://drools.46999.n3.nabble.com/How-to-Compute-against-WorkingMemory-in...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 7 months
Drools 5.4: How to use functions and clauses
by vr
Hi All,
I am new to Drools and the RE concept and I have the following Rule
defined in my *.drl* file in Eclipse.
*Requirement:*
I want to be able to fetch the Alert List from the Alert Object
and if the alert source attribute is the same i want to combine
multiple alerts present in the List
stated below into a single Unique alert based on some checks
rule "Correlate"
when
$alert : Alert()
$list : Alert ( sourceName=="NETWORK NAME") from $alert.alerts
///alerts is a ArrayList of Alert Objects/
then
checkForMoreStuff($list); /// I passes each alert to the
function or something not sure...?/ end
function void checkForMoreStuff(Alert alert) { // Not sure if this is
required }
--
View this message in context: http://drools.46999.n3.nabble.com/Drools-5-4-How-to-use-functions-and-cla...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 7 months
How to hold a Collection of Objects in memory for processing ?.
by vr
Hi All,
This is the rule defined in my drl file
rule "Entry"
salience 10
when
$alert : Alert()
$list : Alert ( sourceName=="DATA") from $alert.alerts // 1.
Iterate over List of ALerts
then
checkForAlertDescription($list); // 2. I am passing one Alert per
match
end
Is there a way to hold the *Entire List at Step one * in the Drools Memory
so that i can take the Entire list for processing with in the function
defined at Step 2
Instead of the single alert that i have at the moment
Any suggestions would be helpful.
Drools v 5.4.0 Final
-----
Thanks for the support ...!!!
VR
--
View this message in context: http://drools.46999.n3.nabble.com/How-to-hold-a-Collection-of-Objects-in-...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 7 months
Maintain assets synchronized between members of a team
by ciberg2
Hi,
My Drools project is going well and now it's time for some people starting
creating and deploying new Excel decision tables onto the repository.
For that we are using the Eclipse plugin, I've created a general project
that replicates the package structure so everyone can start deploying these
new tables.
My problem is maintaining all the projects in each team member computer
synchronized. Using Eclipse Tools I can commit and update existing assets
but I've not found a way to get all the new assets not existing in the local
computer.
The only way is getting resources from repository but that has to be done
one by one which is not an ideal way to do it because there will be many,
and to add to the problem doing that the downloaded excel files lose all
formatting and become corrupted.
I thought of using GIT to synch all the files but it seems silly to have to
put the files in a new repository when I already have them in one (Guvnor).
What do you think will be the best way to guarantee that all team members
have the same versions of the assests on their local computers?
--
View this message in context: http://drools.46999.n3.nabble.com/Maintain-assets-synchronized-between-me...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 7 months