Hello!
Elaborating on the problem described yesterday: We work in the Linux
environment. Jess is loaded into a particular directory which is included
in the classpath. We are using servletrunner to run servlets. We have
put the servlet class files in the default class directory
corresponding to servletrunner : /usr/local/JSDK2.0/examples. The servlet
class makes a call to our Calljess.java
class which imports jess.* and instantiates a new Rete() object. The
program fails right at this point. It cannot find the file
jess/scriptlib.clp. Which is very much in the same directory as
Rete.class. This is the error message we get :
/******************************************************************/
/*This block describes the servlet settings */
/****************************************************************/
  servletrunner starting with settings:
  port = 8091
  backlog = 50
  max handlers = 100
  timeout = 5000
  servlet dir = ./examples
  document dir = ./examples
  servlet propfile = ./examples/servlet.properties
ULoginServlet: init
FQServlet: init
QueryServlet: init

/***********************************************************************/
/* This block describes the error returned by Jess                    */
/***********************************************************************/
Jess reported an error in routine batch.
  Message: Cannot open file.
        at jess.Batch.batch(Batch.java:37)
        at jess.Rete.loadScriptlib(Rete.java:1056)
        at jess.Rete.<init>(Rete.java:67)
        at jess.Rete.<init>(Rete.java:48)
        at Calljess.Query1(Calljess.java:27)
        at QueryServlet.doPost(QueryServlet.java:25)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:521)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
        at sun.servlet.http.HttpServerHandler.sendResponse(HttpServerHandler.java:165)
        at 
sun.servlet.http.HttpServerHandler.handleConnection(HttpServerHandler.java:121)
        at sun.servlet.http.HttpServerHandler.run(HttpServerHandler.java:90)
        at java.lang.Thread.run(Thread.java:475)

/************************************************************************/
Are there any other ways of getting around this problem. Please help.

Thank you.

---------- Forwarded message ----------
Date: Thu, 26 Apr 2001 04:51:53 -0700 (PDT)
From: [EMAIL PROTECTED]
To: Mona Marathe <[EMAIL PROTECTED]>
Cc: [EMAIL PROTECTED]
Subject: Re: JESS: Error while creating new Rete() object from a servlet


There's no Jess-specific environment variable (Java can't use
environment variables, of course, anyway.)  Given the command (batch
X), Jess tries several places to find X. First, it assumes X is a
filename re  lative to the current directory. If Jess can't find the
file there, it passes X to the getResource() method of
ClassLoader. Therefore, if X is "associated with" the file Rete.class,
it should be found. If Rete.class is in a JAR file, then the file
should be in that JAR. If Rete.class is being loaded from a directory,
then X should be in that same directory.

There is an issue with Jess60a5 and those few Java2 VMs that always
return null from Class.getClassLoader(). If what you're seeing is a
NullPointerException, then you're being bitten by this bug, which will
be corrected in Jess60a6. If, on the other hand, you're seeing an
IOException, then it's simply that the file isn't in any of the right
places to be found. Check your setup and try again.

I think Mona Marathe wrote:
> Hello!
> 
>       We are new to using Jess. We have been trying to create a GUI for a
> Jess-based application using a servlet. The Jess-based application is
> written in Java and imports the Jess classes. For initial testing we had
> written a main() function and tested it out simply. While integrating the
> class (which creates a new Rete() object) with a servlet we got an initial
> error at the stage
>       Rete a = new Rete();
>       Tracing through the error we discovered that the Batch function cannot
> find the file LIBRARY_NAME = "jess/scriptlib.clp". The file is very much
> there. The problem is that the environment cannot figure out the right
> path. Obviously some Jess-specific environment variable needs to be
> set. Could anyone tell us what it is?
> 
> Thank you
> 
> 
> 
> ---------------------------------------------------------------------
> 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]
---------------------------------------------------------------------


---------------------------------------------------------------------
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