Uploaded image for project: 'JBoss BRMS Platform'
  1. JBoss BRMS Platform
  2. RHBRMS-3058

[GSS](6.4.z) Inconsistent values returned by AccessorKey.hashCode causes NullPointerException during binary deserialization

    Details

    • Type: Bug
    • Status: Verified (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 6.4.7.GA
    • Fix Version/s: 6.4.9
    • Component/s: BRE
    • Labels:
    • Target Release:
    • Fix Build:
      CR1

      Description

      Consider the following sequence of events:

      1. serialize a set of text rule files
      2. create a binary file for the serialized rule files
      3. deserialize the binary file created in the step 2.

      When each step is executed in different JVM runs, step 3 fails with a NullPointerException:

      java.lang.NullPointerException: null
      	at org.drools.core.reteoo.CompositeObjectSinkAdapter.isHashable(CompositeObjectSinkAdapter.java:158)
      	at org.drools.core.reteoo.CompositeObjectSinkAdapter.getHashableAccessor(CompositeObjectSinkAdapter.java:149)
      	at org.drools.core.reteoo.CompositeObjectSinkAdapter.addObjectSink(CompositeObjectSinkAdapter.java:108)
      	at org.drools.core.reteoo.SingleObjectSinkAdapter.addObjectSink(SingleObjectSinkAdapter.java:55)
      	at org.drools.core.reteoo.ObjectSource.addObjectSink(ObjectSource.java:216)
      	at org.drools.core.reteoo.LeftInputAdapterNode.attach(LeftInputAdapterNode.java:155)
      	at org.drools.core.reteoo.builder.BuildUtils.attachNode(BuildUtils.java:141)
      	at org.drools.core.reteoo.builder.GroupElementBuilder$AndBuilder.buildTupleSource(GroupElementBuilder.java:126)
      	at org.drools.core.reteoo.builder.GroupElementBuilder$AndBuilder.build(GroupElementBuilder.java:109)
      	at org.drools.core.reteoo.builder.GroupElementBuilder.build(GroupElementBuilder.java:68)
      	at org.drools.core.reteoo.builder.ReteooRuleBuilder.addSubRule(ReteooRuleBuilder.java:161)
      	at org.drools.core.reteoo.builder.ReteooRuleBuilder.addRule(ReteooRuleBuilder.java:133)
      	at org.drools.core.reteoo.ReteooBuilder.addRule(ReteooBuilder.java:110)
      	at org.drools.core.impl.KnowledgeBaseImpl.internalAddRule(KnowledgeBaseImpl.java:1526)
      	at org.drools.core.impl.KnowledgeBaseImpl.internalAddPackages(KnowledgeBaseImpl.java:915)
      	at org.drools.core.impl.KnowledgeBaseImpl.lambda$addPackages$1(KnowledgeBaseImpl.java:717)
      	at org.drools.core.impl.KnowledgeBaseImpl.enqueueModification(KnowledgeBaseImpl.java:734)
      	at org.drools.core.impl.KnowledgeBaseImpl.addPackages(KnowledgeBaseImpl.java:717)
      	at org.drools.compiler.integrationtests.SerializedPackageMergeTwoSteps2Test.testBuildAndSerializePackagesInTwoSteps2(SerializedPackageMergeTwoSteps2Test.java:88)
      

      If making one single run for all 3 steps, everything works fine.

      The problem are inconsistent hashCode values for the AccessorKey object when the JVM is restarted, due to the usage of Enum.hashCode:
      https://github.com/kiegroup/drools/blob/master/drools-core/src/main/java/org/drools/core/base/AccessorKey.java#L48

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  mfusco Mario Fusco
                  Reporter:
                  mputz Martin Weiler
                  Tester:
                  Tibor Zimanyi
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: