Look at the line 58 of RulesTest class and you will find the problem. Try to always analyse the stacktrace if there are no drools classes involved, then it is not a Drools error. And remember, the debugger is your friend ;)<div>

<br></div><div>Best, <br><br><div class="gmail_quote">2010/6/7 David Sinclair <span dir="ltr">&lt;<a href="mailto:dsinclair@chariotsolutions.com">dsinclair@chariotsolutions.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<div class="im">This has nothing to do with Drools. It looks like you are giving Writer bad input perhaps??<br><br></div><div class="im"><p class="MsoNormal"><font color="red" face="Courier New" size="2"><span style="font-size:10pt;font-family:&quot;Courier New&quot;;color:red">Exception in thread &quot;main&quot; </span></font><u><font color="navy" face="Courier New" size="2"><span style="font-size:10pt;font-family:&quot;Courier New&quot;;color:navy">java.lang.NullPointerException</span></font></u><font face="Courier New" size="2"><span style="font-size:10pt;font-family:&quot;Courier New&quot;"></span></font></p>




<p class="MsoNormal"><font color="red" face="Courier New" size="2"><span style="font-size:10pt;font-family:&quot;Courier New&quot;;color:red">      at java.io.Writer.write(Unknown
Source)</span></font><font face="Courier New" size="2"><span style="font-size:10pt;font-family:&quot;Courier New&quot;"></span></font></p>

<p class="MsoNormal"><font color="red" face="Courier New" size="2"><span style="font-size:10pt;font-family:&quot;Courier New&quot;;color:red">      at
com.org.RulesTest.main(</span></font><u><font color="navy" face="Courier New" size="2"><span style="font-size:10pt;font-family:&quot;Courier New&quot;;color:navy">RulesTest.java:58</span></font></u><font color="red" face="Courier New" size="2"><span style="font-size:10pt;font-family:&quot;Courier New&quot;;color:red">)</span></font></p>


<p class="MsoNormal"><br><font color="red" face="Courier New" size="2"><span style="font-size:10pt;font-family:&quot;Courier New&quot;;color:red"></span></font></p><br><br></div><div class="gmail_quote"><div class="im">2010/6/7 Fnu Mahalakshmi <span dir="ltr">&lt;<a href="mailto:FMahalakshmi@nyx.com" target="_blank">FMahalakshmi@nyx.com</a>&gt;</span><br>


</div><blockquote class="gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex">








<div link="blue" vlink="purple" lang="EN-US">

<div>

<p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10pt;font-family:Arial">Hi,</span></font></p><div><div></div><div class="h5">

<p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10pt;font-family:Arial"> </span></font></p>

<p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10pt;font-family:Arial">I am trying out this example from the book :</span></font></p>

<pre><font color="black" face="Courier New" size="2"><span style="font-size:10pt">public class Room {</span></font></pre><pre><font color="black" face="Courier New" size="2"><span style="font-size:10pt">    private String name</span></font></pre>


<pre><font color="black" face="Courier New" size="2"><span style="font-size:10pt">    // getter and setter methods here</span></font></pre><pre><font color="black" face="Courier New" size="2"><span style="font-size:10pt">}</span></font></pre>


<pre><font color="black" face="Courier New" size="2"><span style="font-size:10pt">public classs Sprinkler {</span></font></pre><pre><font color="black" face="Courier New" size="2"><span style="font-size:10pt">    private Room room;</span></font></pre>


<pre><font color="black" face="Courier New" size="2"><span style="font-size:10pt">    private boolean on;</span></font></pre><pre><font color="black" face="Courier New" size="2"><span style="font-size:10pt">    // getter and setter methods here</span></font></pre>


<pre><font color="black" face="Courier New" size="2"><span style="font-size:10pt">}</span></font></pre><pre><font color="black" face="Courier New" size="2"><span style="font-size:10pt">public class Fire {</span></font></pre>


<pre><font color="black" face="Courier New" size="2"><span style="font-size:10pt">    private Room room;</span></font></pre><pre><font color="black" face="Courier New" size="2"><span style="font-size:10pt">    // getter and setter methods here</span></font></pre>


<pre><font color="black" face="Courier New" size="2"><span style="font-size:10pt">}</span></font></pre>

<p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10pt;font-family:Arial"> </span></font></p>

<p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10pt;font-family:Arial">I load 2 input files: 1. with data of fire and Room { f1,
r1;f2, r2}</span></font></p>

<p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10pt;font-family:Arial">                          
2. with data of sprinkler and Room { “ “, r1; “ “ , r2}</span></font></p>

<p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10pt;font-family:Arial"> </span></font></p>

<p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10pt;font-family:Arial">I am writing rule “ if fire exists in room start
sprinkler” { so if f1 and r1 in this case: I should get s1, r1 }</span></font></p>

<p class="MsoNormal"><font color="black" face="Courier New" size="2"><span style="font-size:10pt;font-family:&quot;Courier New&quot;;color:black">when</span></font></p>

<p class="MsoNormal"><font color="black" face="Courier New" size="2"><span style="font-size:10pt;font-family:&quot;Courier New&quot;;color:black">   
Fire($room : room)</span></font></p>

<p class="MsoNormal"><font color="black" face="Courier New" size="2"><span style="font-size:10pt;font-family:&quot;Courier New&quot;;color:black">   
$sprinkler : Sprinkler( room == $room, modified == false )</span></font></p>

<p class="MsoNormal"><font color="black" face="Courier New" size="2"><span style="font-size:10pt;font-family:&quot;Courier New&quot;;color:black">Then</span></font></p>

<p class="MsoNormal"><font color="black" face="Courier New" size="2"><span style="font-size:10pt;font-family:&quot;Courier New&quot;;color:black">   
$sprinkler.setmodified(true);     </span></font></p>

<p class="MsoNormal"><font color="black" face="Courier New" size="2"><span style="font-size:10pt;font-family:&quot;Courier New&quot;;color:black">   
modify( $sprinkler ) { setSprinkle( “s1” ) };</span></font></p>

<p class="MsoNormal"><font color="black" face="Times New Roman" size="3"><span style="font-size:12pt;color:black">end</span></font></p>

<p class="MsoNormal"><font color="black" face="Times New Roman" size="3"><span style="font-size:12pt;color:black"> </span></font></p>

<p class="MsoNormal"><font color="black" face="Times New Roman" size="3"><span style="font-size:12pt;color:black">But this gives me error:</span></font></p>

<p class="MsoNormal"><font color="red" face="Courier New" size="2"><span style="font-size:10pt;font-family:&quot;Courier New&quot;;color:red">Exception in thread &quot;main&quot; </span></font><u><font color="navy" face="Courier New" size="2"><span style="font-size:10pt;font-family:&quot;Courier New&quot;;color:navy">java.lang.NullPointerException</span></font></u><font face="Courier New" size="2"><span style="font-size:10pt;font-family:&quot;Courier New&quot;"></span></font></p>




<p class="MsoNormal"><font color="red" face="Courier New" size="2"><span style="font-size:10pt;font-family:&quot;Courier New&quot;;color:red">      at java.io.Writer.write(Unknown
Source)</span></font><font face="Courier New" size="2"><span style="font-size:10pt;font-family:&quot;Courier New&quot;"></span></font></p>

<p class="MsoNormal"><font color="red" face="Courier New" size="2"><span style="font-size:10pt;font-family:&quot;Courier New&quot;;color:red">      at
com.org.RulesTest.main(</span></font><u><font color="navy" face="Courier New" size="2"><span style="font-size:10pt;font-family:&quot;Courier New&quot;;color:navy">RulesTest.java:58</span></font></u><font color="red" face="Courier New" size="2"><span style="font-size:10pt;font-family:&quot;Courier New&quot;;color:red">)</span></font></p>




<p class="MsoNormal"><font color="red" face="Courier New" size="2"><span style="font-size:10pt;font-family:&quot;Courier New&quot;;color:red"> </span></font></p>

<p class="MsoNormal"><font color="red" face="Courier New" size="2"><span style="font-size:10pt;font-family:&quot;Courier New&quot;;color:red">From what I
observed this rule is not getting fired at all.</span></font></p>

<p class="MsoNormal"><font color="red" face="Courier New" size="2"><span style="font-size:10pt;font-family:&quot;Courier New&quot;;color:red">I want this rule
to be fired on the data in my second input file.</span></font></p>

<p class="MsoNormal"><font color="red" face="Courier New" size="2"><span style="font-size:10pt;font-family:&quot;Courier New&quot;;color:red">The rules for my
first input file get executed properly.</span></font></p>

<p class="MsoNormal"><font color="red" face="Courier New" size="2"><span style="font-size:10pt;font-family:&quot;Courier New&quot;;color:red"> </span></font></p>

<p class="MsoNormal"><font color="red" face="Courier New" size="2"><span style="font-size:10pt;font-family:&quot;Courier New&quot;;color:red">Can any1 tell me
where I am going wrong??</span></font></p>

<p class="MsoNormal"><font color="red" face="Courier New" size="2"><span style="font-size:10pt;font-family:&quot;Courier New&quot;;color:red">Is there any way
in which we can use the modified data { after rules are fired on the first
input data and it is  modified}to fire another set of rules on the same
input depending on the next input file???</span></font></p>

<p class="MsoNormal"><font color="red" face="Courier New" size="2"><span style="font-size:10pt;font-family:&quot;Courier New&quot;;color:red"> </span></font></p>

<p class="MsoNormal"><font color="red" face="Courier New" size="2"><span style="font-size:10pt;font-family:&quot;Courier New&quot;;color:red">Thank you.</span></font></p>

<p class="MsoNormal"><font color="red" face="Courier New" size="2"><span style="font-size:10pt;font-family:&quot;Courier New&quot;;color:red"> </span></font></p>

<p class="MsoNormal"><font color="red" face="Courier New" size="2"><span style="font-size:10pt;font-family:&quot;Courier New&quot;;color:red">-M</span></font><font face="Arial" size="2"><span style="font-size:10pt;font-family:Arial"></span></font></p>




</div></div></div><div><div></div><div class="h5">

<pre></pre>

<p></p><hr size="1">
<p><b><font color="green">Please consider the environment before printing this email.</font></b></p>
<p><b>Visit our website at <a href="http://www.nyse.com" target="_blank">http://www.nyse.com</a> <br>

*****************************************************************************
<br>
Note:  The information contained in this message and any attachment to it is privileged, confidential and protected from disclosure.  If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited.  If you have received this communication in error, please notify the sender immediately by replying to the message, and please delete it from your system.  Thank you.  NYSE Euronext.

</b></p><pre></pre></div></div></div>


<br><div class="im">_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank">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>
<br></div></blockquote></div><br>
<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>
<br></blockquote></div><br><br clear="all"><br>-- <br>XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX<br><br>Esteban Aliverti<br>
</div>