I've tried to clean up my testing to be sure and created a few different
scenarios. All of them end with the same result:
java.lang.ClassCastException: [B
at org.drools.rule.Package.readExternal(Package.java:197)
at
org.drools.definitions.impl.KnowledgePackageImp.readExternal(KnowledgePackageImp.java:99)
at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1756)
at
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1717)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
at java.util.ArrayList.readObject(ArrayList.java:591)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:946)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1812)
at
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1719)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
at
org.drools.core.util.DroolsStreamUtils.streamIn(DroolsStreamUtils.java:189)
at
org.drools.core.util.DroolsStreamUtils.streamIn(DroolsStreamUtils.java:173)
at
org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:488)
at
org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:28)
I am serializing Collection<KnowledgePackage> to a file (.pkg). I get the
same error whether I:
- Create a KAgent from a changeset pointing to the .pkg
- Add a changset resource pointing to the .pkg to a KBuilder
- Add the pkg directly to the KBuilder
I have verified that if I manually deserialize the object from the file, it
successfully deserializes to the Collection<KnowledgePackage>.
--
View this message in context:
http://drools-java-rules-engine.46999.n3.nabble.com/creating-pkg-from-drl...
Sent from the Drools - User mailing list archive at
Nabble.com.