Again? You posted a similar problem some days ago. The stacktrace you have posted doesn't involve any drools' class. Did you try to debug your code? According to the error, I'm 90% sure that ruleSource is null.<div>
Please, try to debug or try different solutions before posting here. What you have here is a basic java error. </div><div><br></div><div>Best,<br><br><div class="gmail_quote">2010/6/16 Fnu Mahalakshmi <span dir="ltr"><<a href="mailto:FMahalakshmi@nyx.com">FMahalakshmi@nyx.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div lang="EN-US" link="blue" vlink="purple">
<div>
<p class="MsoNormal" style="text-autospace:none"><font size="2" color="black" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:black">Hi guys,</span></font></p>
<p class="MsoNormal" style="text-autospace:none"><font size="2" color="black" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:black"> </span></font></p>
<p class="MsoNormal" style="text-autospace:none"><font size="2" color="black" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:black">I am trying to create a very basic dsl which is giving me the
following error stack:</span></font></p>
<p class="MsoNormal" style="text-autospace:none"><font size="2" color="black" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:black"> </span></font></p>
<p class="MsoNormal" style="text-autospace:none"><font size="2" color="black" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:black">The code to add the dsl is as follows:</span></font></p>
<p class="MsoNormal" style="text-autospace:none"><font size="2" color="black" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:black"> </span></font></p>
<p class="MsoNormal" style="text-autospace:none"><font size="2" color="black" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:black">InputStream <span style="background:yellow">ruleSource</span> =
RuleRunner.</span></font><b><font size="2" color="#7f0055" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:#7F0055;font-weight:bold">class</span></font></b><font size="2" color="black" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:black">.getClassLoader().getResourceAsStream(</span></font><font size="2" color="#2a00ff" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:#2A00FF">"/Rule1.dslr"</span></font><font size="2" color="black" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:black">);</span></font><font size="2" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New""></span></font></p>
<p class="MsoNormal" style="text-autospace:none"><font size="2" color="black" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:black">InputStream dslSource = RuleRunner.</span></font><b><font size="2" color="#7f0055" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:#7F0055;font-weight:bold">class</span></font></b><font size="2" color="black" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:black">.getClassLoader().getResourceAsStream(</span></font><font size="2" color="#2a00ff" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:#2A00FF">"/sample-dsl.dsl"</span></font><font size="2" color="black" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:black">);</span></font><font size="2" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New""></span></font></p>
<p class="MsoNormal" style="text-autospace:none"><font size="2" color="black" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:black"> </span></font><font size="2" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New""></span></font></p>
<p class="MsoNormal" style="text-autospace:none"><font size="2" color="black" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:black">
</span></font><font size="2" color="#3f7f5f" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:#3F7F5F">//Load the
rules , using DSL</span></font><font size="2" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New""></span></font></p>
<p class="MsoNormal" style="text-autospace:none"><font size="2" color="black" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:black"> addRulesToThisPackage.addPackageFromDrl(</span></font><font size="2" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New""></span></font></p>
<p class="MsoNormal" style="text-autospace:none"><font size="2" color="black" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:black"> </span></font><b><font size="2" color="#7f0055" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:#7F0055;font-weight:bold">new</span></font></b><font size="2" color="black" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:black"> InputStreamReader(<span style="background:silver">ruleSource</span>),</span></font><font size="2" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New""></span></font></p>
<p class="MsoNormal" style="text-autospace:none"><font size="2" color="black" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:black"> </span></font><b><font size="2" color="#7f0055" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:#7F0055;font-weight:bold">new</span></font></b><font size="2" color="black" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:black"> InputStreamReader(dslSource));</span></font><font size="2" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New""></span></font></p>
<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size:10.0pt;font-family:Arial"> </span></font></p>
<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size:10.0pt;font-family:Arial">I have both the sample-dsl .dsl and Rule1.dslr in my working
directory.</span></font></p>
<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size:10.0pt;font-family:Arial"> </span></font></p>
<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size:10.0pt;font-family:Arial">Error encountered at adding the dsl to the package (last
line)</span></font></p>
<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size:10.0pt;font-family:Arial"> </span></font></p>
<p class="MsoNormal"><font size="2" face="Arial"><span style="font-size:10.0pt;font-family:Arial">Error stack:</span></font></p>
<p class="MsoNormal" style="text-autospace:none"><font size="2" color="red" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:red">Exception in thread "main" </span></font><u><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy">java.lang.NullPointerException</span></font></u><font size="2" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New""></span></font></p>
<p class="MsoNormal" style="text-autospace:none"><font size="2" color="red" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:red"> at
java.io.Reader.<init>(Unknown Source)</span></font><font size="2" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New""></span></font></p>
<p class="MsoNormal" style="text-autospace:none"><font size="2" color="red" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:red"> at
java.io.InputStreamReader.<init>(Unknown Source)</span></font><font size="2" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New""></span></font></p>
<p class="MsoNormal" style="text-autospace:none"><font size="2" color="red" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:red"> at com.org.RuleRunner.loadRuleFile(</span></font><u><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy">RuleRunner.java:96</span></font></u><font size="2" color="red" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:red">)</span></font><font size="2" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New""></span></font></p>
<p class="MsoNormal" style="text-autospace:none"><font size="2" color="red" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:red"> at com.org.RuleRunner.loadRules(</span></font><u><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy">RuleRunner.java:48</span></font></u><font size="2" color="red" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:red">)</span></font><font size="2" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New""></span></font></p>
<p class="MsoNormal" style="text-autospace:none"><font size="2" color="red" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:red"> at
com.org.RuleRunner.runStatelessRules(</span></font><u><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy">RuleRunner.java:109</span></font></u><font size="2" color="red" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:red">)</span></font><font size="2" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New""></span></font></p>
<p class="MsoNormal"><font size="2" color="red" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:red"> at
com.org.RulesTest.main(</span></font><u><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy">RulesTest.java:41</span></font></u><font size="2" color="red" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:red">)</span></font></p>
<p class="MsoNormal"><font size="2" color="red" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:red"> </span></font></p>
<p class="MsoNormal"><font size="2" color="red" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:red">my dsl file has
basic mapping as per the online documentations.</span></font></p>
<p class="MsoNormal"><font size="2" color="red" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:red"> </span></font></p>
<p class="MsoNormal"><font size="2" color="red" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:red">The dsl rule I created
is:</span></font></p>
<p class="MsoNormal" style="text-autospace:none"><b><font size="2" color="#960000" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:#960000;font-weight:bold">expander</span></font></b><font size="2" color="black" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:black"> sample-dsl.dsl</span></font><font size="2" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New""></span></font></p>
<p class="MsoNormal" style="text-autospace:none"><font size="2" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New""> </span></font></p>
<p class="MsoNormal" style="text-autospace:none"><b><font size="2" color="#960000" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:#960000;font-weight:bold">rule</span></font></b><font size="2" color="black" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:black"> </span></font><font size="2" color="green" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:green">"A status
changes B status"</span></font><font size="2" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New""></span></font></p>
<p class="MsoNormal" style="text-autospace:none"><font size="2" color="black" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:black"> </span></font><b><font size="2" color="#960000" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:#960000;font-weight:bold">when</span></font></b><font size="2" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New""></span></font></p>
<p class="MsoNormal" style="text-autospace:none"><font size="2" color="black" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:black"> There
</span></font><b><font size="2" color="#960000" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:#960000;font-weight:bold">is</span></font></b><font size="2" color="black" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:black"> an A</span></font><font size="2" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New""></span></font></p>
<p class="MsoNormal" style="margin-left:1.75in;text-autospace:none"><font size="2" color="black" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:black"><span>-<font size="1" face="Times New Roman"><span style="font:7.0pt "Times New Roman"">
</span></font></span></span></font><font size="2" color="black" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:black">has an address</span></font></p>
<p class="MsoNormal" style="margin-left:1.0in;text-autospace:none"><font size="2" color="black" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:black">There is a B</span></font></p>
<p class="MsoNormal" style="margin-left:1.0in;text-autospace:none"><font size="2" color="black" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:black"> - has name</span></font><font size="2" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New""></span></font></p>
<p class="MsoNormal" style="text-autospace:none"><font size="2" color="black" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:black"> </span></font><b><font size="2" color="#960000" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:#960000;font-weight:bold">then</span></font></b><font size="2" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New""></span></font></p>
<p class="MsoNormal" style="text-autospace:none"><font size="2" color="black" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:black"> -
print updated A </span></font><b><font size="2" color="#960000" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:#960000;font-weight:bold">and</span></font></b><font size="2" color="black" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:black"> Aaddress</span></font><font size="2" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New""></span></font></p>
<p class="MsoNormal" style="text-autospace:none"><b><font size="2" color="#960000" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:#960000;font-weight:bold">End</span></font></b></p>
<p class="MsoNormal" style="text-autospace:none"><b><font size="2" color="#960000" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:#960000;font-weight:bold"> </span></font></b></p>
<p class="MsoNormal" style="text-autospace:none"><b><font size="2" color="#960000" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:#960000;font-weight:bold"> </span></font></b></p>
<p class="MsoNormal" style="text-autospace:none"><b><font size="2" color="#960000" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:#960000;font-weight:bold">I have created DSL in eclipse.</span></font></b></p>
<p class="MsoNormal" style="text-autospace:none"><b><font size="2" color="#960000" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:#960000;font-weight:bold"> </span></font></b></p>
<p class="MsoNormal" style="text-autospace:none"><b><font size="2" color="#960000" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:#960000;font-weight:bold">Is the code I added for it to be loaded to my
package correct?? Or am I missing something????</span></font></b></p>
<p class="MsoNormal" style="text-autospace:none"><b><font size="2" color="#960000" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:#960000;font-weight:bold"> </span></font></b></p>
<p class="MsoNormal" style="text-autospace:none"><b><font size="2" color="#960000" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:#960000;font-weight:bold"> </span></font></b></p>
<p class="MsoNormal" style="text-autospace:none"><b><font size="2" color="#960000" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:#960000;font-weight:bold">Please help.</span></font></b></p>
<p class="MsoNormal" style="text-autospace:none"><b><font size="2" color="#960000" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:#960000;font-weight:bold"> </span></font></b></p>
<p class="MsoNormal" style="text-autospace:none"><b><font size="2" color="#960000" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:#960000;font-weight:bold">Thanks.</span></font></b></p>
<p class="MsoNormal" style="text-autospace:none"><b><font size="2" color="#960000" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:#960000;font-weight:bold">M</span></font></b><font size="2" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New""></span></font></p>
<p class="MsoNormal"><font size="2" color="red" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:red"> </span></font></p>
</div>
<pre></pre>
<p></p><hr size="1"><p></p>
<p><strong><font color="green">Please consider the environment before printing this email.</font></strong></p>
<p><strong>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.
</strong></p><pre></pre></div>
<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>