[jboss-jira] [JBoss JIRA] Created: (JBRULES-2226) Creating custom ConsequenceExceptionHandler with application restart

Uros Majeric (JIRA) jira-events at lists.jboss.org
Mon Aug 3 07:19:29 EDT 2009


Creating custom ConsequenceExceptionHandler with application restart
--------------------------------------------------------------------

                 Key: JBRULES-2226
                 URL: https://jira.jboss.org/jira/browse/JBRULES-2226
             Project: JBoss 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.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list