The function docs for (batch) (in chapter8 of the manual) say that the
argument is a file, and if and only if Jess is running in an applet
(i.e., Rete.setApplet() has been called) then (batch) will try to find
the file hanging off of the applet's documentBase. No place does the
manual say that batch takes a URL; if this works in an applet, it's
just undefined behavior -- a coincidence.
If you want to load Jess code from a URL, then the only legal way to
do it is to do it yourself. This is pretty easy -- something like
Rete engine = ...;
URL url = new URL("http://foo");
Reader r = new InputStreamReader(url.openStream());
Jesp j = new Jesp(r, engine);
// Read until end-of-file
Value v = j.parse(false);
would work fine. This is all that (batch) does.
I think Rajaram Subramanian wrote:
> Hi,
> I had used Jess as an intelligent help system in a computer-aided
> education project. In my earlier design, i had used Jess on the client
> side but am now moving it to the server. My applet will make an
> URLConnection and pass a fact to the servlet; this gets passed to the rule
> engine and after going thro rule base will be returned a help string. The
> applet collects it and displays it on the GUI. Well, at least, thats the
> plan :}
> The problem is that i am very new to servlets and in my class LabServlet i
> do,
> rete_.executeCommand("(batch http://127.0.0.1/servlets/scriptlib.clp)");
>
> and i have scriptlib.clp in that directory. But it is not able to locate
> this file and i get the error message...
>
> Jess exception in servlet !!! Jess reported an error in routine batch
> while executing (batch http://127.0.0.1/servlets/scriptlib.clp).
> Message: Cannot open file.
> Program text: ( batch http://127.0.0.1/servlets/scriptlib.clp ) at line
> 0.
>
> I am using Apache server with Apache JServ as the servlet engine. Please
> do let me know if you see a reason for my problem,
>
> Thank you,
> Raj.
>
>
>
> --------------------------------------------------------------------
> 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]
> --------------------------------------------------------------------
>
---------------------------------------------------------
Ernest Friedman-Hill
Distributed Systems Research Phone: (925) 294-2154
Sandia National Labs FAX: (925) 294-2234
Org. 8920, MS 9012 [EMAIL PROTECTED]
PO Box 969 http://herzberg.ca.sandia.gov
Livermore, CA 94550
--------------------------------------------------------------------
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]
--------------------------------------------------------------------