When you say the loop works fine, do the System.out&#39;s print what you expect?<br><br><div class="gmail_quote">On 17 July 2012 10:34, ashwindrool <span dir="ltr">&lt;<a href="mailto:ashwin.khandelwal86@gmail.com" target="_blank">ashwin.khandelwal86@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Sorry Mike,Laune<br>
<br>
<br>
I am handling 100thousand records for that i am using CSV file and<br>
converting those records into objects which i am using for further<br>
calculation.<br>
<br>
According to my requirement i have loop array inside DRL file<br>
<br>
So i wrote following code in .java<br>
* agCsv.setPolCounterList(polCounterList);<br>
 agCsv.setAgentList(agentListArray);<br>
<br>
                  // local block end for policy---------------------------------------<br>
                  //firing  all rules from here-------------<br>
                        ksession.fireAllRules();<br>
                     //after firing rules destroying session object<br>
                        ksession.dispose();<br>
                        *<br>
<br>
after this  i am executing following rule DRL file<br>
<br>
*rule &quot;Loop Test&quot;<br>
    salience 50<br>
        when<br>
<br>
        $a:AgentCSVBean()<br>
<br>
<br>
        then<br>
<br>
          for(Integer agentList: $a.getAgentList()) {<br>
<br>
           System.out.println(&quot;--sam=====&quot;+agentList);<br>
<br>
      }<br>
<br>
<br>
<br>
end*<br>
<br>
Now above loop execute absolutely well but after finishing loop it throws<br>
Error<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://drools.46999.n3.nabble.com/How-handle-exception-thrown-while-looping-in-DRL-file-tp4018727p4018732.html" target="_blank">http://drools.46999.n3.nabble.com/How-handle-exception-thrown-while-looping-in-DRL-file-tp4018727p4018732.html</a><br>

<div class="HOEnZb"><div class="h5">Sent from the Drools: User forum mailing list archive at Nabble.com.<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</div></div></blockquote></div><br>