Hi Gaminda,

   What you can'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.

   Regards,
      Edson

2007/4/6, Gaminda Jayakody <my_vista2007@yahoo.com>:
Hi
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
 
final Reader source = new InputStreamReader( BaseRuleImpl.class.getResourceAsStream(rulefile.drl));
 
could you kindly give me a solutin to this.
Thank You
Gaminda
 


Finding fabulous fares is fun.
Let Yahoo! FareChase search your favorite travel sites to find flight and hotel bargains.




--
  Edson Tirelli
  Software Engineer - JBoss Rules Core Developer
  Office: +55 11 3124-6000
  Mobile: +55 11 9218-4151
  JBoss, a division of Red Hat @ www.jboss.com