[rules-users] Exception in Banking Tutorial in Drools expert guide...

Tan Hui Onn huionn at gmail.com
Fri Sep 23 07:08:31 EDT 2011


Obviously, it should be  for (int i=0; i < facts.length;i++), right?

2011/9/23 Manohar Kokkula <manohar.kokkula at tcs.com>

> Hi,
>
> I am trying to execute Banking Tutorial Example given in Drools expert(*
> http://downloads.jboss.com/drools/docs/5.0.1.26597.FINAL/drools-expert/html_single/index.html#d0e7769
> *<http://downloads.jboss.com/drools/docs/5.0.1.26597.FINAL/drools-expert/html_single/index.html#d0e7769>),but
> im getting following error,
>
> Exception in thread "main" java.lang.ClassCastException:
> java.util.ArrayList cannot be cast to org.hibernate.mapping.Collection
> at com.sample.RuleRunner.runRules(RuleRunner.java:32)
> at com.sample.Example1.main(Example1.java:5)
>
> And when i try to resolve this i am getting another error:
>
> java.lang.ArrayIndexOutOfBoundsException: 0
>         at com.code.RuleRunner.runRules(RuleRunner.java:45)
>         at com.code.Example1.main(Example1.java:5)
>
> *Code snippet :*
>
>  for (int i=0; i <=facts.length;i++)
>         {
>             System.out.println("222");
>                 Object fact = facts[i]; *//The error is for this line of
> code*
>
>
>            System.out.println( "Inserting fact: " + fact );
>            ksession.insert(fact);
>
>            System.out.println("333");
>         }
>
>
>
> could any body help me on this.
>
>
> Manohar Kokkula
> Mailto: manohar.kokkula at tcs.com
>
> =====-----=====-----=====
> Notice: The information contained in this e-mail
> message and/or attachments to it may contain
> confidential or privileged information. If you are
> not the intended recipient, any dissemination, use,
> review, distribution, printing or copying of the
> information contained in this e-mail message
> and/or attachments to it are strictly prohibited. If
> you have received this communication in error,
> please notify us by reply e-mail or telephone and
> immediately and permanently delete the message
> and any attachments. Thank you
>
>
>
> _______________________________________________
> 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/20110923/649ac89f/attachment.html 


More information about the rules-users mailing list