I think snowice asiamail.com wrote:
[Charset iso-8859-1 unsupported, filtering to ASCII...]
> Hi,
>   i was trying to make use of JSR94 RI wrapper for the Jess rule engine to rewrite 
> your example for jess/example/pump. I wasn't sure how to go about it because the 
> Java API is quite vague, but below is what i came up with.


>         Reader ruleReader = new InputStreamReader( 
> Test.class.getClassLoader().getResourceAsStream( 
> "C:/Jess61p2/org/cp/jsr94/jess/pumps-fromjava.clp" ) );


> 
> Well, it managed to compile however when i tried to run it, it gave me a null 
> pointer exception 
> C:\Jess61p2>java org.jcp.jsr94.jess.Test
> Exception in thread "main" java.lang.NullPointerException
>         at java.io.Reader.<init>(Reader.java:61)
>         at java.io.InputStreamReader.<init>(InputStreamReader.java:55)
>         at org.jcp.jsr94.jess.Test.main(Test.java:34)


> 2)Why did my program give me such an error. The file is definitely there, but they 
> got a null pointer exception. I can't understand why...

Note that the NPE is not coming from the RI or from Jess; it's coming
from your code. The getResourceAsStream call above is failing because
you've mistyped the path (cp instead of jcp). I should mention that
adding classes to other people's packages this way is very bad form;
things not accessible from outside the package are deliberately not
accessible; they're not designed for public use. But anyway, the error
is just this typo in the path. But see below...

> 
> So here's my question,
> 1)Can i use files like "pumps-fromjava.clp" as an input for my Rule Set? If not, 
> what can i do to parse a whole list of rules at the same time? How about the 
> functions? where do i put them? can i put them in the same file?
> 

No, you can't; it has to be an XML file. See
http://herzberg.ca.sandia.gov/jess/ri_overview.shtml for more info. 



---------------------------------------------------------
Ernest Friedman-Hill  
Distributed Systems Research        Phone: (925) 294-2154
Sandia National Labs                FAX:   (925) 294-2234
PO Box 969, MS 9012                 [EMAIL PROTECTED]
Livermore, CA 94550         http://herzberg.ca.sandia.gov

--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the list
(use your own address!) List problems? Notify [EMAIL PROTECTED]
--------------------------------------------------------------------

Reply via email to