]
Geoffrey De Smet updated DROOLS-1507:
-------------------------------------
Affects Version/s: 6.5.0.Final
Error message "unable to invole method" should mention DRL
line
---------------------------------------------------------------
Key: DROOLS-1507
URL:
https://issues.jboss.org/browse/DROOLS-1507
Project: Drools
Issue Type: Bug
Components: core engine
Affects Versions: 6.5.0.Final
Reporter: Geoffrey De Smet
Assignee: Mario Fusco
In a complex DRL file we wrote something like this:
{code}
when
Visit(foo != null, $w : foo.weekOfYear)
not Visit(foo.weekOfYear < $w)
then
...
end
{code}
throws this exception:
{code}
java.lang.RuntimeException: cannot invoke getter: getFoo ...
at
org.mvel2.optimizers.impl.refl.nodes.GetterAccessor.getValue(GetterAccessor.java:74)
...
Caused by: java.lang.RuntimeException: unable to invoke method: ....foo.getWeekOfYear:
target of method is null
at
org.mvel2.optimizers.impl.refl.nodes.GetterAccessor.getValue(GetterAccessor.java:66)
at
org.mvel2.optimizers.impl.refl.nodes.GetterAccessor.getValue(GetterAccessor.java:40)
...
Caused by: java.lang.NullPointerException
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
org.mvel2.optimizers.impl.refl.nodes.GetterAccessor.getValue(GetterAccessor.java:43)
{code}
with no DRL line.