You’ve probably configured your system to be using persistence?
In which case what you are persisting needs to be serializable so that it can be persisted
Thomas
From: rules-users-bounces@lists.jboss.org [mailto:rules-users-bounces@lists.jboss.org]
On Behalf Of Wolfgang Laun
Sent: 23 August 2010 12:17
To: Rules Users List
Subject: [rules-users] counting facts of a kind
As simple as it gets:
rule countHigh
when
$n : Number() from accumulate ( $sgc : StartGoalConn() count( $sgc ) )
then
System.out.println( "plain routes: " + $n );
end
And yet, it fails:
Exception in thread "main" org.drools.RuntimeDroolsException: java.lang.ClassCastException: rss.ixl.route.TrainStartGoalConn cannot be cast to java.io.Serializable
Sure, adding "implements Serializable" to StartGoalConn fixes this. But why is this necessary?
FYI, StartGoalConn is abstract superclass of TrainStartGoalConn - just in case this has some bearing on this issue.
Best
-W