[jboss-jira] [JBoss JIRA] Resolved: (JBRULES-2226) Creating custom ConsequenceExceptionHandler with application restart
Mark Proctor (JIRA)
jira-events at lists.jboss.org
Tue May 17 21:21:00 EDT 2011
[ https://issues.jboss.org/browse/JBRULES-2226?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Mark Proctor resolved JBRULES-2226.
-----------------------------------
Resolution: Out of Date
No feedback, no idea if this is a still a problem. Please provide self contained easy to run out of the box unit test if this continues to be a problem.
> Creating custom ConsequenceExceptionHandler with application restart
> --------------------------------------------------------------------
>
> Key: JBRULES-2226
> URL: https://issues.jboss.org/browse/JBRULES-2226
> Project: Drools
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: drools-api
> Affects Versions: 5.0.1.FINAL
> Environment: JBoss AS 5.1
> Drools 5.0.1
> JBoss ESB 4.6
> Reporter: Uros Majeric
> Assignee: Mark Proctor
>
> I have a JBoss ESB and in it I have created my custom ConsequenceExceptionHandler. When I deploy the esb everything is ok. When I redeploy the application, deployment goes fine. But when my application get an error (exception), my custom exception handler should catch the exception (in method handleException(Activation activation, WorkingMemory workingMemory, Exception exception)), but instead of catching the exception get an error:
> java.lang.RuntimeException: Unable to instantiate object for class 'si.aditus.drools.CustomConsequenceExceptionHandler'
> My custom Exception Handler:
> public class CustomConsequenceExceptionHandler implements ConsequenceExceptionHandler {
> public void handleException(Activation activation, WorkingMemory workingMemory, Exception exception) {
> if (!(exception instanceof MyException || exception instanceof OtherException)) {
> System.err.println(exception.getClass());
> exception.printStackTrace();
> return;
> }
> System.out.println("exceptions: "+exception);
> }
>
> }
> Knowledge Base instantiation:
> KnowledgeBaseConfiguration kbc = KnowledgeBaseFactory.newKnowledgeBaseConfiguration();
> ((RuleBaseConfiguration)kbc).setConsequenceExceptionHandler(CustomConsequenceExceptionHandler.class.getName());
> KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase(kbc);
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list