Uploaded image for project: 'Drools'
  1. Drools
  2. DROOLS-944

KieBase deserialization throws NullPointerException

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Blocker
    • Resolution: Done
    • Affects Version/s: 6.2.0.Final, 6.3.0.Final
    • Fix Version/s: 6.4.0.Beta1
    • Component/s: core engine
    • Labels:
      None
    • Environment:

      Java 8, Maven 3 (required to run the attached reproducer)

    • Docs QE Status:
      NEW
    • QE Status:
      NEW

      Description

      When deserializing a serialized KieBase, sometimes a NullPointerException occurs.

      It seems to be related to specific patterns in the DRL file (esp. in MVEL expressions). The attached reproducer (Maven 3 project requiring Java 8) contains a sample DRL file with the suspicious content. When calling "mvn install", the build fails with the following stacktrace:

      java.lang.NullPointerException: null
              at org.drools.core.base.BaseClassFieldReader.equals(BaseClassFieldReader.java:107)
              at org.drools.core.base.extractors.MVELObjectClassFieldReader.equals(MVELObjectClassFieldReader.java:165)
              at java.util.HashMap.putVal(HashMap.java:634)
              at java.util.HashMap.put(HashMap.java:611)
              at java.util.HashSet.readObject(HashSet.java:334)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:497)
              at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1017)
              at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1896)
              at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1801)
              at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351)
              at java.io.ObjectInputStream.readObject(ObjectInputStream.java:371)
              at org.drools.core.rule.MVELDialectRuntimeData.readExternal(MVELDialectRuntimeData.java:101)
              at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1840)
              at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1799)
              at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351)
              at java.io.ObjectInputStream.readObject(ObjectInputStream.java:371)
              at java.util.HashMap.readObject(HashMap.java:1396)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:497)
              at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1017)
              at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1896)
              at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1801)
              at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351)
              at java.io.ObjectInputStream.readObject(ObjectInputStream.java:371)
              at org.drools.core.rule.DialectRuntimeRegistry.readExternal(DialectRuntimeRegistry.java:59)
              at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1840)
              at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1799)
              at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351)
              at java.io.ObjectInputStream.readObject(ObjectInputStream.java:371)
              at org.drools.core.definitions.impl.KnowledgePackageImpl.readExternal(KnowledgePackageImpl.java:292)
              at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1840)
              at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1799)
              at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351)
              at java.io.ObjectInputStream.readObject(ObjectInputStream.java:371)
              at java.util.HashMap.readObject(HashMap.java:1396)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:497)
              at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1017)
              at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1896)
              at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1801)
              at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351)
              at java.io.ObjectInputStream.readObject(ObjectInputStream.java:371)
              at org.drools.core.impl.KnowledgeBaseImpl.readExternal(KnowledgeBaseImpl.java:459)
              at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1840)
              at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1799)
              at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351)
              at java.io.ObjectInputStream.readObject(ObjectInputStream.java:371)
              at test.ReproducerTest.deserialize(ReproducerTest.java:52)
              at test.ReproducerTest.runAsJUnitTest(ReproducerTest.java:25)

      When changing the suspicious pattern to something different, the test runs fine.

      Since there is no work-around for us, we request for assistance on this one from some specialist in MVEL and/or Drools ...

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                mfusco Mario Fusco
                Reporter:
                rene.zanner René Zanner
              • Votes:
                2 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: