|
View:
New views
3 Messages
—
Rating Filter:
Alert me
|
|
|
JESS: Problem on handling the function 'batch'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. |
|
|
Re: JESS: Problem on handling the function 'batch'Francisco:
Instead of using batch(), you can use eval() with the contents of a file as a String. I have found that by loading the file myself using resource loading mechanisms that are native to my app server environment, and caching it in the application, then providing a String to eval() sped up performance by about an order of magnitude over a batch() with the same content. Of course, your mileage may vary. -d- On Mar 30, 2008, at 2: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. -------------------------------------------------------------------- To unsubscribe, send the words 'unsubscribe jess-users you@...' in the BODY of a message to majordomo@..., NOT to the list (use your own address!) List problems? Notify owner-jess-users@.... -------------------------------------------------------------------- |
|
|
Re: JESS: Problem on handling the function 'batch'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 ejfried@... Livermore, CA 94550 http://www.jessrules.com -------------------------------------------------------------------- To unsubscribe, send the words 'unsubscribe jess-users you@...' in the BODY of a message to majordomo@..., NOT to the list (use your own address!) List problems? Notify owner-jess-users@.... -------------------------------------------------------------------- |
| Free Forum Powered by Nabble | Forum Help |