[rules-users] StackOverflowError when serializing KnowledgeBase

Andargor andargor at yahoo.com
Thu Jul 29 15:05:10 EDT 2010


Thanks! So I assume the latest snapshot is not 5.2.0M1, which is the predicted fix version.

For anyone having the problem, I used the -Xss5m java parameter as a workaround for now.

A.


--- On Tue, 7/27/10, Mark Proctor <mproctor at codehaus.org> wrote:

> From: Mark Proctor <mproctor at codehaus.org>
> Subject: Re: [rules-users] StackOverflowError when serializing KnowledgeBase
> To: rules-users at lists.jboss.org
> Date: Tuesday, July 27, 2010, 11:03 PM
>   On 27/07/2010 22:36, Andargor
> wrote:
> > Second try, sorry for spamming. Does anyone have an
> idea why serialization of a large knowledge base fails with
> a stack error?
> It's to do with Java's poor ability to serialise linked
> lists:
> https://jira.jboss.org/browse/JBRULES-2335
> https://jira.jboss.org/browse/JBRULES-946
> 
> Mark
> > A.
> >
> > --- On Thu, 7/22/10, Andargor<andargor at yahoo.com> wrote:
> >
> >> From: Andargor<andargor at yahoo.com>
> >> Subject: Re: [rules-users] StackOverflowError when
> serializing KnowledgeBase
> >> To: rules-users at lists.jboss.org
> >> Date: Thursday, July 22, 2010, 8:12 PM
> >> Sorry, forgot to mention, I have
> >> tried 5.1.0M1, and yesterday's snapshot.
> >>
> >> --- On Thu, 7/22/10, Andargor<andargor at yahoo.com>
> >> wrote:
> >>
> >>> From: Andargor<andargor at yahoo.com>
> >>> Subject: StackOverflowError when serializing
> >> KnowledgeBase
> >>> To: rules-users at lists.jboss.org
> >>> Date: Thursday, July 22, 2010, 8:10 PM
> >>> Hello,
> >>>
> >>> After adding a few hundred rules, and with the
> same
> >> code,
> >>> KnowledgeBase serialization has started to
> generate
> >>> StackOverflowError. I have increased the VM
> stack size
> >> as a
> >>> workaround, but I was hoping to implement
> something
> >> more
> >>> robust.
> >>>
> >>> I specifically need to serialize the
> KnowledgeBase,
> >> and not
> >>> the session.
> >>>
> >>> I'm using this code:
> >>>
> >>>      private void
> dumpKnowledgeBase(String file,
> >>> KnowledgeBase kbase) {
> >>>         
>    try {
> >>>         
>    
> >>>     FileOutputStream
> ostream = new
> >>> FileOutputStream(file);
> >>>         
>    
> >>> 
>    DroolsObjectOutputStream p = new
> >>> DroolsObjectOutputStream(ostream);
> >>>         
>    
> >>>     p.writeObject(kbase);
> >>>         
>    
> >>>     p.flush();
> >>>         
>    
> >>>     ostream.close();
> >>>         
>    }
> >>>         
>    catch
> >>> (Exception e) {
> >>>         
>    
> >>> 
>    System.err.println(e);
> >>>         
>    
> >>>     e.printStackTrace();
> >>>         
>    
> >>> 
>    System.err.println("Could not write
> >>> knowledge base "+file);
> >>>         
>    }
> >>>      }
> >>>
> >>>
> >>> This is due to writeObject recursion? Any
> ideas?
> >>>
> >>> A.
> >>>
> >>>
> >>>
> >>>
> >>
> >>       
> >>
> >> _______________________________________________
> >> rules-users mailing list
> >> rules-users at lists.jboss.org
> >> https://lists.jboss.org/mailman/listinfo/rules-users
> >>
> >
> >
> >
> > _______________________________________________
> > rules-users mailing list
> > rules-users at lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/rules-users
> >
> >
> 
> 
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
> 


      




More information about the rules-users mailing list