[rules-users] Eval0Invoker : java.lang.NullPointerException

Michael Anstis michael.anstis at gmail.com
Wed Dec 14 16:59:40 EST 2011


Do the problematic rules work in isolation? i.e. if you try them
individually in a KnowledgeBase.

What if you try the problem rules without the eval? e.g.:-

rule "PAN Device MAC Address null or empty rule"
no-loop true
salience 200
       when
               $customer : Customer()
               $esis : ElectricServiceInterface() from
$customer.getElectricServiceInterfaces()
               $panDevice : PANDevice( MACAddress == null || == "" ) from
$esis.getPANdevices()
       then
               throw new MissingEntryFault("MAC Address cannot be null or
empty");
end

Also, don't get runtime NPE's confused with design-time NPE's (such as the
RETE viewer in Eclipse).

On 14 December 2011 21:08, Venkat <ven12344 at yahoo.com> wrote:

> Hi Manstis, PANDevice is not null, instead I am setting the value of
> "macAddress" using this object. So how can it be null, I am initializing
> this object.
>
> Also, as I said, the last two rules works fine for null value, but not the
> three before those. which are below rules
>
>
> PAN Device MAC Address null or empty rule
>
> PAN Device Install Code null or empty rule
>
> For the above two rules, I am checking for "empty" value in my test case.
>
> PAN Device Smart Device Model null rule
>
>
>
> Also, in the Eclipse, when I am going to "Rete" tab it is showing this
> error,
>
> "Unable to parse rules to show RETE view! null"
>
> I guess the null pointer exception is screwing everything.
>
> Thanks,
> Venkat.
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Eval0Invoker-java-lang-NullPointerException-tp3586222p3586769.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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20111214/c5ca46d4/attachment.html 


More information about the rules-users mailing list