[
https://issues.jboss.org/browse/JBRULES-3042?page=com.atlassian.jira.plug...
]
Geoffrey De Smet updated JBRULES-3042:
--------------------------------------
Fix Version/s: 5.4.0.Beta1
(was: 5.3.0.Final)
KnowledgeAgent.applyChangeSet(notExistingResource) should throw an
understandable exception instead of a NullPointerException
-----------------------------------------------------------------------------------------------------------------------------
Key: JBRULES-3042
URL:
https://issues.jboss.org/browse/JBRULES-3042
Project: Drools
Issue Type: Bug
Security Level: Public(Everyone can see)
Reporter: Geoffrey De Smet
Fix For: 5.4.0.Beta1
Discovered by the guvnor-examples MortgageClientExample
The exception is essentially eaten here in KnowledgeAgentImpl:
{code}
try {
changeSet = reader.read( resource.getReader() );
} catch ( Exception e ) {
this.listener.exception( new RuntimeException(
"Unable to parse
ChangeSet",
e ) );
}
{code}
OK, it logs it, but it doesn't throw an exception (might be related to use of the
Agent in spring??? where we don't want it to die on a network IO problem?).
Instead a NPE occurs later because the changeSet is still null:
{code}
Exception in thread "main" java.lang.NullPointerException
at
org.drools.agent.impl.KnowledgeAgentImpl.processChangeSet(KnowledgeAgentImpl.java:223)
at org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:189)
at org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:174)
at
org.drools.guvnor.examples.mortgage.client.MortgageClientExample.readKnowledgeBase(MortgageClientExample.java:81)
at
org.drools.guvnor.examples.mortgage.client.MortgageClientExample.main(MortgageClientExample.java:39)
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 com.intellij.rt.execution.application.AppMain.main(AppMain.java:115)
{code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see:
http://www.atlassian.com/software/jira