[JBoss JIRA] Created: (JBRULES-2226) Creating custom ConsequenceExceptionHandler with application restart
by Uros Majeric (JIRA)
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
13 years, 7 months
[JBoss JIRA] Created: (JBRULES-2147) NullPointerException in org.drools.rule.builder.PatternBuilder.getDeclarationsMap()
by Juergen none (JIRA)
NullPointerException in org.drools.rule.builder.PatternBuilder.getDeclarationsMap()
-----------------------------------------------------------------------------------
Key: JBRULES-2147
URL: https://jira.jboss.org/jira/browse/JBRULES-2147
Project: JBoss Drools
Issue Type: Feature Request
Security Level: Public (Everyone can see)
Components: drools-compiler (expert)
Affects Versions: 5.0.1.FINAL
Environment: java 1.5, linux x64, jboss 4.0.5
Reporter: Juergen none
Assignee: Mark Proctor
I understand my rules/fact objects might not be proper (still searching), but resulting in a NullPointerException is not proper as well
entry.getValue().getExtractor().getExtractToClass() yields NullPointerException, because entry.getValue().getExtractor() is null
eclipse debug variable:
value org.drools.rule.Declaration (id=502)
identifier "schoolForm" (id=501)
internalFact false
pattern org.drools.rule.Pattern (id=508)
behaviors null
constraints java.util.ArrayList<E> (id=520)
declaration org.drools.rule.Declaration (id=521)
declarations java.util.HashMap<K,V> (id=522)
index 1
objectType org.drools.base.ClassObjectType (id=524)
offset 0
source null
readAccessor null
Stacktrace:
java.lang.reflect.InvocationTargetException
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:585)
...
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.lang.NullPointerException
at org.drools.rule.builder.PatternBuilder.getDeclarationsMap(PatternBuilder.java:641)
at org.drools.rule.builder.PatternBuilder.build(PatternBuilder.java:574)
at org.drools.rule.builder.PatternBuilder.buildConstraint(PatternBuilder.java:244)
at org.drools.rule.builder.PatternBuilder.build(PatternBuilder.java:196)
at org.drools.rule.builder.PatternBuilder.build(PatternBuilder.java:104)
at org.drools.rule.builder.GroupElementBuilder.build(GroupElementBuilder.java:69)
at org.drools.rule.builder.RuleBuilder.build(RuleBuilder.java:68)
at org.drools.compiler.PackageBuilder.addRule(PackageBuilder.java:1159)
at org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:649)
at org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:278)
at org.drools.jsr94.rules.admin.LocalRuleExecutionSetProviderImpl.createRuleExecutionSet(LocalRuleExecutionSetProviderImpl.java:158)
at org.drools.jsr94.rules.admin.LocalRuleExecutionSetProviderImpl.createRuleExecutionSet(LocalRuleExecutionSetProviderImpl.java:93)
...
--
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
13 years, 7 months