Hi Eric,

"definstance," like a number of other Jess functions, has to call into
your Java code to do its work. Sometimes your code will throw an
exception, and what Jess does is wrap that exception in a
JessException and re-throw it. It looks to me as if that's what's
happened here. "Invalid remove" is not an error message anywhere in
Jess 7.0a4, so I'm thinking that it's coming from some other Java
code.

Can you change your JessException catch block to do something like

} catch (JessException ex) {
  ...
  if (ex.getCause() != null)
    ex.getCause().printStackTrace();

That stack trace would give you (and us) a better idea of what was
happening. 

I think Eric Foertsch wrote:
> Hello 
>  
> Could someone if this is an error on my part or a bug? I am getting this
> Jess exception error "Invalid Remove" but am not sure why.  I am running
> Jess 7.0A4
>  
> I start asserting various facts,firing rules  and execution functions
> (see below)
>  
>  ==> f-0 (MAIN::comparative-relative-strength)
>  ==> f-1 (MAIN::base-for-crs "SP-500")
>  ==> f-2 (MAIN::find-stock-info "SP-500")
> ==> Activation: MAIN::get-stock-info :  f-2
>  ==> f-3 (MAIN::find-stock-info DPTR)
> ==> Activation: MAIN::get-stock-info :  f-3
>  ==> f-4 (MAIN::over-n-days)
>  ==> f-5 (MAIN::starting-n-days-ago)
> FIRE 1 MAIN::get-stock-info f-3
>  ==> f-6 (MAIN::epsStock ....)
>  ==> f-7 (MAIN::stock (class <External-Address:java.lang.Class>) (.....)
> FIRE 2 MAIN::get-stock-info f-2
>  ==> f-8 (MAIN::epsStock ....)
>  
> And I get the following exception:
>  
> Exception occured
> Stack trace
>  
>  while executing (definstance stock ?tc2000stock)
>  while executing deffunction getTC2000StockInfo
>  while executing (getTC2000StockInfo ?symbol 500 "all")
>  while executing defrule MAIN::get-stock-info
>  while executing (run)
> Error in Java. Cause 
> Invalid remove
> Jess code in Error:( run ) 
>  
> And here is the function. 
>  
> (deffunction getTC2000StockInfo (?symbol ?numberDays ?ratings)
>     "Call TC2000 stock server to get info on requested stock"
>     (bind ?tc2000stock (?*tc2000Server* getStockData ?symbol ?numberDays
> ?ratings))
>       (assert-eps-per-quarter ?tc2000stock )
>       (definstance stock ?tc2000stock )
>     )
>  
> I was wondering if there is a problem with the symbols. I assert fact
> with symbol "SP-500" but noticed in the exception trace it shows only
> "500". If I use a symbol without a hyphen I don't get the error.
>  
> Any words of advice would be welcome.
>  
> Eric Foertsch



---------------------------------------------------------
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://herzberg.ca.sandia.gov

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