You're mistaken that setting the property java.class.path changes the
path that the application classloader will use to load classes; that
property is basically read-only, and represents the classpath at JVM
launch.
Anyway, "batch" will indeed find files along the classpath. If your
application's "root directory" is on the classpath, and the CLP file
is in a subdirectory "foo" below that root directory, then either
'batch("/foo/filename.clp")' or 'batch("foo/filename.clp")' would
find it just fine.
On Mar 30, 2008, at 5:53 PM, francisco santiago wrote:
Hello. This is my first time using Jess. I have a full project in
which I'm making some changes. This project works via ANT
(build.xml file fully functional).
The project is working at 100%, but we want to run it without ANT.
ANT manages the classpath to add some paths to critical locations
into the app.
I'm having a problem when invoking the function 'batch' in Jess
when I give it an argument like 'fileName.clp'.
Jess reports an error saying it cannot open the file. The file is
under a subdirectory into the app base directory. If I put the file
into this root directory, all works well.
But it's necessary to have those clp's placed in a subfolder.
I've tried using System.getProperties().setProperty
("java.class.path",'clp's-directory-path'), but only Java code find
it useful by using Class.getResourceAsStream() to get acces to the
resources (as 'fileName.clp' is). But Jess still gives the same
error, like it doesn't see the changes done to the classpath via
Java code in execution time.
'java.class.path' property contains paths to the ./ and ./build
locations initially. I've noted that placing directly the clp's
into those places makes Jess find them. Any other location doesn't
work. Appending to that classpath variable the path to my dir of
clp's is the solution I've tried, as explained in the paragraph above.
Thank you so much for yout attention and sorry for the length of
the e-mail. I think that details were necesary.
---------------------------------------------------------
Ernest Friedman-Hill
Informatics & Decision Sciences Phone: (925) 294-2154
Sandia National Labs FAX: (925) 294-2234
PO Box 969, MS 9012 [EMAIL PROTECTED]
Livermore, CA 94550 http://www.jessrules.com
--------------------------------------------------------------------
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]
--------------------------------------------------------------------