« Return to Thread: JESS: JessLong Illegal argument exception

JESS: JessLong Illegal argument exception

by Brian Rogosky :: Rate this Message:

Reply to Author | View in Thread

Some parts of this message have been removed. Learn more about Nabble's security policy.

Hello,

I’m experiencing an “Illegal Argument” exception when calling the “long” function.  It appears to only happen with one particular number 1157650583 out of hundreds of thousands used.  The number is stored in a slot of Float type.  This number works fine in a test environment with a simple call to the function with the exact number, i.e. (long 1157650583).  However the exception fires with the full set of code in the production environment where I am running Jess 7.0p2 and Java 5.  In production, a call to the Java Long class to do the conversion of the same number works fine, but the Jess long call always fails.  I’ve listed the log output below.

 

Has anyone seen a problem like this?  I have not yet put the code into an environment where I can run a debugger over it but I am considering it.  I am also considering replacing the Jess long call with a call to Long.longValue(). 

 

**** log output ****

 

debugging city id = 1157650583

 

*** call to Java Long works fine *** [Thread-1] DEBUG - In provider-default rule in country.clp: (new java.lang.Long ?city) longValue = 1157650583

 

*** call to (long ?city) throws an exception *** [Thread-1] ERROR -

Jess reported an error in routine long

      while executing (long ?city)

      while executing (printout debug "In provider-default rule in country.clp: It will fail HERE: (long ?city) = " (long ?city) crlf)

      while executing defrule provider-default::provider-default.

  Message: Illegal argument 1157650583.

      at jess.JessLong.call(Unknown Source)

      at jess.FunctionHolder.call(Unknown Source)

      at jess.Funcall.execute(Unknown Source)

      at jess.FuncallValue.resolveValue(Unknown Source)

      at jess.Printout.call(Unknown Source)

      at jess.FunctionHolder.call(Unknown Source)

      at jess.Funcall.execute(Unknown Source)

      at jess.Defrule.fire(Unknown Source)

      at jess.Activation.fire(Unknown Source)

      at jess.Agenda.run(Unknown Source)

      at jess.Agenda.run(Unknown Source)

      at jess.Rete.run(Unknown Source)

      at jess.Rete.run(Unknown Source)

      at com.quova.research.Jessengine.JessRuleAlgorithm.process(JessRuleAlgorithm.java:152)

      at com.quova.research.handler.HandlerImpl.run(HandlerImpl.java:185)

      at com.quova.research.service.NetworkServiceImpl.processNetworkRequest(NetworkServiceImpl.java:36)

      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

 

Thanks in advance,

Brian

 

 

 

 « Return to Thread: JESS: JessLong Illegal argument exception