Hide Forgot
Help Desk Ticket Reference: https://c.na7.visual.force.com/apex/Case_View?id=500A0000005fAzW&sfdc.override=1 Workaround: Workaround Exists Workaround Description: Set 'Version' in JBDS properties editor. securitylevel_name: Public If you have a rule flow(.rf) in your package and the rule flow doesn't have version attribute(='Version' is empty in JBDS properties editor), ResourceChangeScanner causes NullPointerException. Attached a test case as DroolsExam33_ResourceChangeScanner_NPE.zip. - Unzip DroolsExam33_ResourceChangeScanner_NPE.zip - Import it as an eclipse project (You may need to modify 'Java Build Path') - Create 'testflow' package in BRMS - Upload Rule1.drl and Rule1to10.rf in src/main/rules dir to 'testflow' package - build package in BRMS - Run TestFlow.java -- While running, build package in BRMS again -- NPE will be thrown [2011:01:04 18:01:642:exception] java.lang.RuntimeException: KnowledgeAgent exception while trying to deserialize KnowledgeDefinitionsPackage at org.drools.agent.impl.KnowledgeAgentImpl.addResourcesToKnowledgeBase(KnowledgeAgentImpl.java:916) at org.drools.agent.impl.KnowledgeAgentImpl.rebuildResources(KnowledgeAgentImpl.java:704) at org.drools.agent.impl.KnowledgeAgentImpl.buildKnowledgeBase(KnowledgeAgentImpl.java:584) at org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:185) at org.drools.agent.impl.KnowledgeAgentImpl$ChangeSetNotificationDetector.run(KnowledgeAgentImpl.java:1106) at java.lang.Thread.run(Thread.java:619) Caused by: java.lang.NullPointerException at org.drools.process.core.impl.ProcessImpl.equals(ProcessImpl.java:134) at java.util.HashMap.put(HashMap.java:376) at java.util.HashSet.add(HashSet.java:200) at org.drools.agent.impl.KnowledgeAgentImpl$RegisteredResourceMap.putDefinition(KnowledgeAgentImpl.java:1150) at org.drools.agent.impl.KnowledgeAgentImpl.addDefinitionMapping(KnowledgeAgentImpl.java:1037) at org.drools.agent.impl.KnowledgeAgentImpl.buildResourceMapping(KnowledgeAgentImpl.java:496) at org.drools.agent.impl.KnowledgeAgentImpl.buildResourceMapping(KnowledgeAgentImpl.java:443) at org.drools.agent.impl.KnowledgeAgentImpl.addResourcesToKnowledgeBase(KnowledgeAgentImpl.java:912) ... 5 more It doesn't happen with Drools trunk build. (nor BRMS 5.0.2) In BRMS 5.1.0, org.drools.process.core.impl.ProcessImpl.equals() is based on name and version. ==== public boolean equals(final Object o) { if ( o instanceof ProcessImpl ) { return ((ProcessImpl) o).getName().equals( this.name ) && ((ProcessImpl) o).getVersion().equals( this.version ); } return false; } ==== In jBPM 5.0-CR1 which Drools trunk depends on, org.jbpm.process.core.impl.ProcessImpl.equals() is based on id. ==== public boolean equals(final Object o) { if ( o instanceof ProcessImpl ) { if (this.id != null) { return ((ProcessImpl) o).getId() == null; } return this.id.equals(((ProcessImpl) o).getId()); } return false; } ====
Attachment: Added: DroolsExam33_ResourceChangeScanner_NPE.zip
Release Notes Text: Added: Changed equals and hashcode methods. Done.