I can reproduce that error with Foo and Bar, running Jess7.1a1, due to
some null pointer exception in the eval. But the documentation for the
Jess function "call" says: "The functor call may be omitted if the
method being called is non-static." I guess that means that the call,
as tried by Henrique, is in error. Using the correct form:
  System.out.println( jess.eval( "(call System currentTimeMillis)" ) );
works fine.

But now the question is, why does
  jess.eval( "(System.currentTimeMillis)" );
work in the first place - it does, on the same system, omitting the bload calls.

kr
Wolfgang

On 7/6/07, Ernest Friedman-Hill <[EMAIL PROTECTED]> wrote:
Running "Bar" followed by "Foo" works for me (Jess 7.1a1). Does is
not work for you?

public class Bar {
    public static void main(String[] foo) throws Exception {
            Rete jess = new Rete();
            FileInputStream fis = new FileInputStream
("the_file.bsave");
            jess.bload(fis);
            fis.close();
            System.out.println(jess.eval
("(System.currentTimeMillis)"));
    }
}


public class Foo {
    public static void main(String[] foo) throws Exception {
            Rete jess = new Rete();
            FileOutputStream fos = new FileOutputStream
("the_file.bsave");
            jess.bsave(fos);
            fos.close();
    }
}





On Jul 6, 2007, at 8:36 AM, Henrique Lopes Cardoso wrote:

> Hi,
>
> If I bload a file (even an empty one), I get an "Error during
> execution"
> when executing (System.currentTimeMillis).
>
> Here's my code:
>
>             Rete jess = new Rete();
>             FileInputStream fis = new FileInputStream
> ("the_file.bsave");
>             jess.bload(fis);
>             fis.close();
>             jess.eval("(System.currentTimeMillis)");
>
> It works fine if I read a .clp jess file using Jesp.
>
> Henrique
>
> --
> ----- - - - - -  -  -  -  -  -   -   -
> Henrique Lopes Cardoso
> DEEC/FEUP
> Rua Dr. Roberto Frias | 4200-465 Porto
> PORTUGAL
> (+351)225081400 ext.1315
> [EMAIL PROTECTED] | www.fe.up.pt/~hlc
> ----- - - - - -  -  -  -  -  -   -   -
>
> --------------------------------------------------------------------
> 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 owner-jess-
> [EMAIL PROTECTED]
> --------------------------------------------------------------------

---------------------------------------------------------
Ernest Friedman-Hill
Advanced Software Research          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]
--------------------------------------------------------------------



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