[rules-dev] Error unmarshalling KnowledgeBase

nestabur nestabur at gmail.com
Fri Jul 31 08:47:54 EDT 2009


Hi all,

I'm getting 2 different errors trying to unmarshalling 2 different KBases:

1: org.drools.RuntimeDroolsException: unable to determine operator for
symbol [after]
2: java.io.StreamCorruptedException: invalid stream header: 776CACED

The 1st one seems to be caused when using the operator after in the DRL, so
the marshalling/unmarshalling strategies dont support CEP rules?

The 2nd one could be caused because of using different marshallers ... but I
use the same!!

My marshalling methods are:

	public void save(FileOutputStream out) throws IOException{
		
		DroolsObjectOutputStream droolsOut = new DroolsObjectOutputStream(out);
		droolsOut.writeObject(ksession.getKnowledgeBase());		
		Marshaller mas = createMarshaller(ksession.getKnowledgeBase());
		mas.marshall(droolsOut, ksession);
	}
	
	public void load(FileInputStream input) throws IOException,
ClassNotFoundException{
		
		DroolsObjectInputStream droolsIn = new DroolsObjectInputStream(input);		
		KnowledgeBase kbase = (KnowledgeBase)droolsIn.readObject();		
		Marshaller mas = createMarshaller(kbase);		
		ksession = mas.unmarshall(input);
	}
	
	private Marshaller createMarshaller(KnowledgeBase kbase){
		ObjectMarshallingStrategyAcceptor acceptor =
MarshallerFactory.newClassFilterAcceptor(new String[]{"*.*"});
		ObjectMarshallingStrategy strategy =
MarshallerFactory.newSerializeMarshallingStrategy(acceptor);
		return MarshallerFactory.newMarshaller(kbase,new
ObjectMarshallingStrategy[]{strategy});
	}

-- 
View this message in context: http://www.nabble.com/Error-unmarshalling-KnowledgeBase-tp24755828p24755828.html
Sent from the drools - dev mailing list archive at Nabble.com.



More information about the rules-dev mailing list