[
https://issues.jboss.org/browse/DROOLS-2517?page=com.atlassian.jira.plugi...
]
Toshiya Kobayashi commented on DROOLS-2517:
-------------------------------------------
Sent a PR unit test and fix
NullPointerException in BaseClassFieldReader.writeExternal() when a
global method is used in LHS and serialize package
----------------------------------------------------------------------------------------------------------------------
Key: DROOLS-2517
URL:
https://issues.jboss.org/browse/DROOLS-2517
Project: Drools
Issue Type: Bug
Components: core engine
Affects Versions: 7.7.0.Final
Reporter: Toshiya Kobayashi
Assignee: Mario Fusco
Labels: support
Under the conditions:
* A rule uses a method of global variable in LHS. e.g. Person(myUtil.transform(name) ==
"John-san")
* A package is serialized
Serializing the package throws NullPointerException.
{noformat}
java.lang.NullPointerException: null
at
org.drools.core.base.BaseClassFieldReader.writeExternal(BaseClassFieldReader.java:196)
at
org.drools.core.base.extractors.MVELObjectClassFieldReader.writeExternal(MVELObjectClassFieldReader.java:72)
at java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1459)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1430)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:348)
at
org.drools.core.base.ClassFieldAccessorStore$FieldLookupEntry.writeExternal(ClassFieldAccessorStore.java:384)
at java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1459)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1430)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:348)
at java.util.concurrent.ConcurrentHashMap.writeObject(ConcurrentHashMap.java:1413)
at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:1028)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1496)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:348)
at
org.drools.core.base.ClassFieldAccessorStore.writeExternal(ClassFieldAccessorStore.java:61)
at java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1459)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1430)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:348)
at
org.drools.core.definitions.impl.KnowledgePackageImpl.writeExternal(KnowledgePackageImpl.java:250)
at java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1459)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1430)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:348)
at java.util.ArrayList.writeObject(ArrayList.java:762)
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.invokeWriteObject(ObjectStreamClass.java:1028)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1496)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:348)
at
org.drools.compiler.integrationtests.SerializedPackageMergeTest.testBuildAndSerializePackagesWithGlobalMethodInLHS(SerializedPackageMergeTest.java:244)
{noformat}
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)