[jboss-jira] [JBoss JIRA] Created: (JBRULES-1521) ClassNotFound when deserializing rulebase

Edson Tirelli (JIRA) jira-events at lists.jboss.org
Thu Mar 20 14:33:52 EDT 2008


ClassNotFound when deserializing rulebase
-----------------------------------------

                 Key: JBRULES-1521
                 URL: http://jira.jboss.com/jira/browse/JBRULES-1521
             Project: JBoss Drools
          Issue Type: Bug
      Security Level: Public (Everyone can see)
          Components: Drl Parser/Builder, Reteoo
    Affects Versions: 4.0.5
            Reporter: Edson Tirelli
         Assigned To: Edson Tirelli
             Fix For: 4.0.6, 5.0.0-M1


Hi Group Members,
 
In Drools 4.0.5 release most of the bugs with "Working Memory serialization" are fixed. But still the feature has few bugs.
 
The bug scenario :
1. Create a rule Base & Working Memory (Stateful Session).
2. Assert some objects in Working Memory & call fireAll()
3. Serialize both  Rule Base & Working Memory.
4. De Serialize Rule Base & Working Memory.
5. Remove Pkg/rule from Rule Base.
6. Serialize both Rule Base & Working Memory.
7. De Serialize Rule Base & Working Memory. ---------> In this step Working Memory De Serialization fails with java.lang.ClassNotFoundException.
8. Assert some more objects in Working Memory & call fireAll()
 
I have tested the scenario using "MarshallingTest.java" from Drools Codebase. In the MarshallingTest.testSerializeAddRemove_NoClassDefFoundError() test case,
I have appended bellow mentioned code snippet at end:
 

        ruleBase = (RuleBase) serializeIn( serializedRulebase );
        session = ruleBase.newStatefulSession( new ByteArrayInputStream( serializedSession ) );    //  throws java.lang.ClassNotFoundException Exception
        results = (List) session.getGlobal( "results" );
             
        InternalFactHandle stilton5 = (InternalFactHandle) session.insert( new Cheese( "stilton", 30 ) );
        InternalFactHandle brie5 = (InternalFactHandle) session.insert( new Cheese( "brie", 30 ) );
        InternalFactHandle bob7 = (InternalFactHandle) session.insert( new Person( "bob", 30 ) );
        InternalFactHandle bob8 = (InternalFactHandle) session.insert( new Person( "bob", 40 ) );
        session.fireAllRules();
 
        assertEquals( 8,
                      results.size() );
        assertEquals( bob7.getObject(),
                      results.get( 6 ) );
        assertEquals( bob8.getObject(),
                      results.get( 7 ) );
       
        serializedSession = null;
        serializedRulebase = null;
       
        serializedSession = serializeOut( session );
        serializedRulebase = serializeOut( ruleBase );
       
        session.dispose();
 
 
One more bug is:  Can not serialize Working Memory if  Rule contains Accumulate or Collect Conditional element. Because, both of them have nested static class "AccumulateMemory" & "CollectMemory" respectively, which are not serializable.
 

We want to use Drools in our project with its "Working Memory serialization" feature to maintain state of Rule Engine between executions. So Fix of All bugs related to "Working Memory serialization" feature is very important for us.
 
 
Thanks
Siddhartha


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list