[rules-users] Drools fusion how to I catch an Exception

RichardAmbridge richard.ambridge at gmail.com
Wed Sep 5 10:08:03 EDT 2012


I have tried with 5.3.0 and 5.4.0, each time I run it the getErrors is blank
(and hasErrors() is false)

So the compile is always passing for me.


However, when I run it under 5.4.0 (was using 5.3.0) I now get in the
output:
Inserting message
Fire all rules
Hello added
Sleep 10
After5 then start
Unable to execute timer job!
Exception executing consequence for rule "After5" in com.sample: [Error:
unable to resolve method: org.drools.base.DefaultKnowledgeHelper.$m()
[arglength=0]]
[Near : {... System.out.println( "After5 th ....}]
             ^
[Line: 1, Column: 1]
	at
org.drools.runtime.rule.impl.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:39)
	at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:1283)
	at
org.drools.common.DefaultAgenda.fireTimedActivation(DefaultAgenda.java:1330)
.....etc...


So in 5.4.0 the exception is caught someplace inside drools and printed to
the output.

My question still remains,   how can I get notified in my code that an
exception has happened?

Thanks for the replies,
Ric




--
View this message in context: http://drools.46999.n3.nabble.com/Drools-fusion-how-to-I-catch-an-Exception-tp4019597p4019604.html
Sent from the Drools: User forum mailing list archive at Nabble.com.


More information about the rules-users mailing list