[rules-users] drools 5.0.1 generating fact types as non-serializable classes

cjohnston cjohnston at innovativeinfo.com
Mon May 31 20:31:30 EDT 2010


Hello,  I have declared  a fact type in a drl file:

package com.innovativeinfo.amacus.drools.model
declare AmacusUser
        id : long
        timeZone : String
end

which according to
http://downloads.jboss.com/drools/docs/5.0.1.26597.FINAL/drools-expert/html_single/index.html#d0e3378
should result in a generated class that implements Serializable.

However when I try to persist the KnowledgeSession, I get:

Caused by: java.io.NotSerializableException:
com.innovativeinfo.amacus.drools.model.AmacusUser
        at
java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1081)
        at
java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:302)
        at
org.drools.marshalling.impl.SerializablePlaceholderResolverStrategy.write(SerializablePlaceholderResolverStrategy.java:37)
        at
org.drools.marshalling.impl.OutputMarshaller.writeFactHandle(OutputMarshaller.java:278)
        at
org.drools.marshalling.impl.OutputMarshaller.writeFactHandles(OutputMarshaller.java:242)
        at
org.drools.marshalling.impl.OutputMarshaller.writeSession(OutputMarshaller.java:85)
        at
org.drools.marshalling.impl.DefaultMarshaller.marshall(DefaultMarshaller.java:117)
        at
org.drools.persistence.session.JPASessionMarshallingHelper.getSnapshot(JPASessionMarshallingHelper.java:76)

Is there a configuration option I need to set to generate Serializable fact
types? Or is this a bug in 5.0.1? I realize I can define "fact types" myself
as classes in Java, but would prefer to use the shortened syntax if
possible.

Any advice appreciated.
Cheers 
-- 
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/drools-5-0-1-generating-fact-types-as-non-serializable-classes-tp860037p860037.html
Sent from the Drools - User mailing list archive at Nabble.com.



More information about the rules-users mailing list