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 <[EMAIL PROTECTED]>:
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<http://farechase.yahoo.com/promo-generic-14795097;_ylc=X3oDMTFtNW45amVpBF9TAzk3NDA3NTg5BF9zAzI3MTk0ODEEcG9zAzEEc2VjA21haWx0YWdsaW5lBHNsawNxMS0wNw--%0A>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
_______________________________________________
rules-users mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/rules-users