[rules-users] NullPointerException when updating a fact

Wolfgang Laun wolfgang.laun at gmail.com
Tue Jul 30 10:10:08 EDT 2013


This is a regression that happened on the way from 5.3.0 to 5.4.0.
Apparently it is the extension of the generic class
   public class FirstName extends Value<String> { }
that causes the NPE (in 5.5.0) and an unsupported operation exception
in 5.4.0. 5.2.0 and 5.3.0 handle this correctly, 5.1.1 seems to have a
restriction (can't regex-match an Object) but at least it doesn't
crash.

There is indeed a sad decline in quality on the path leading to 5.5.0...

-W


On 30/07/2013, Stephen Masters <stephen.masters at me.com> wrote:
> If you wish to see it working, you can grab my maven test harness with your
> code in here:
>
> 	git clone -b 2013-07-30-validate-first-name
> git at github.com:gratiartis/scattercode-drools-scenarios.git
>
> Just run the test in src/test/java/demos/validate/ValidateTest.java
>
> However, I now know why yours is failing. The project above uses Drools
> 5.4.0. I'm guessing that you're using 5.5.0.Final, because if I switch
> version in my pom.xml, then I get a NullPointerException. I suspect that you
> have hit upon one of the many bugs in 5.5.0.Final.
>
> Steve
>
>
>
>
> On 30 Jul 2013, at 09:50, Stephen Masters <stephen.masters at me.com> wrote:
>
>> The fact that all of your classes were static was ringing alarm bells, so
>> I tested it without that.
>>
>> It works perfectly well if you remove 'static' from everything.
>>
>> Steve
>>
>>
>> On 30 Jul 2013, at 08:43, schenka7 <eugen.berenstein at gmail.com> wrote:
>>
>>> I have appended the code that leads to the exception.
>>>
>>> I have also noticed that the exception doesn't arise when using the
>>> concrete
>>> FirstName type in the retracting rule. I have been using the generic
>>> base
>>> class Value because I didn't want to write the same rule for all types
>>> extending from it.
>>>
>>> Main.java <http://drools.46999.n3.nabble.com/file/n4025204/Main.java>
>>> validation.drl
>>> <http://drools.46999.n3.nabble.com/file/n4025204/validation.drl>
>>>
>>>
>>>
>>> --
>>> View this message in context:
>>> http://drools.46999.n3.nabble.com/NullPointerException-when-updating-a-fact-tp4025181p4025204.html
>>> Sent from the Drools: User forum mailing list archive at Nabble.com.
>>> _______________________________________________
>>> rules-users mailing list
>>> rules-users at lists.jboss.org
>>> https://lists.jboss.org/mailman/listinfo/rules-users
>>
>>
>> _______________________________________________
>> rules-users mailing list
>> rules-users at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>


More information about the rules-users mailing list