<br>&nbsp;&nbsp; Hi Gaminda, <br><br>&nbsp;&nbsp; What you can&#39;t do in J2EE containers is to access the filesystem directly. Doing a getResourceAsStream() as you are doing is allowed, specially because your drl file may be inside the application jar/war/ear. If you are having a NPE, the problem is that the container is not finding your file in your classpath, so what you need to do is to fix the classpath. The strategy, though, is a valid one and works.
<br><br>&nbsp;&nbsp; Regards,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Edson<br><br><div><span class="gmail_quote">2007/4/6, Gaminda Jayakody &lt;<a href="mailto:my_vista2007@yahoo.com">my_vista2007@yahoo.com</a>&gt;:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>Hi</div>  <div>I wnat to implement drools at the Session Bean layer of a J2EE application. But reading .drl file as follows cause exceptin in the server. because of I/O operation</div>  <div>&nbsp;</div>  <div>final Reader source = new InputStreamReader(
BaseRuleImpl.class.getResourceAsStream(rulefile.drl));</div>  <div>&nbsp;</div>  <div>could you kindly give me a solutin to this.</div>  <div>Thank You</div><span class="sg">  <div>Gaminda</div></span><span class="ad">  <div>&nbsp;
</div><p> 

</p><hr size="1">Finding fabulous fares is fun.<br><a href="http://farechase.yahoo.com/promo-generic-14795097;_ylc=X3oDMTFtNW45amVpBF9TAzk3NDA3NTg5BF9zAzI3MTk0ODEEcG9zAzEEc2VjA21haWx0YWdsaW5lBHNsawNxMS0wNw--%0A" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
Let Yahoo! FareChase search your favorite travel sites</a> to find flight and hotel bargains.<p></p></span></blockquote></div><br><br clear="all"><br>-- <br>&nbsp;&nbsp;Edson Tirelli<br>&nbsp;&nbsp;Software Engineer - JBoss Rules Core Developer
<br>&nbsp;&nbsp;Office: +55 11 3124-6000<br>&nbsp;&nbsp;Mobile: +55 11 9218-4151<br>&nbsp;&nbsp;JBoss, a division of Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a>