Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
3.8.0
-
None
Description
Ran into an issue where a saved parser was relying on a plugin for Daffodil. Note that this plugin needs to be present when both compiling and running the schema.
When attempting to run the saved parser without the plugin being present on the classpath, I would get the following stack trace:
java.lang.ClassCastException: cannot assign instance of scala.collection.immutable.List$SerializationProxy to field org.apache.daffodil.runtime1.processors.ModelGroupRuntimeData.groupMembers of type scala.collection.Seq in instance of org.apache.daffodil.runtime1.processors.SequenceRuntimeData
at java.base/java.io.ObjectStreamClass$FieldReflector.setObjFieldValues(ObjectStreamClass.java:2096)
at java.base/java.io.ObjectStreamClass$FieldReflector.checkObjectFieldValueTypes(ObjectStreamClass.java:2060)
at java.base/java.io.ObjectStreamClass.checkObjFieldValueTypes(ObjectStreamClass.java:1349)
at java.base/java.io.ObjectInputStream$FieldValues.defaultCheckFieldValues(ObjectInputStream.java:2697)
at java.base/java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2498)
at java.base/java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2284)
at java.base/java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1762)
at java.base/java.io.ObjectInputStream$FieldValues.<init>(ObjectInputStream.java:2618)
at java.base/java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2469)
at java.base/java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2284)
at java.base/java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1762)
at java.base/java.io.ObjectInputStream$FieldValues.<init>(ObjectInputStream.java:2618)
at java.base/java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2469)
at java.base/java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2284)
at java.base/java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1762)
at java.base/java.io.ObjectInputStream.readObject(ObjectInputStream.java:540)
at java.base/java.io.ObjectInputStream.readObject(ObjectInputStream.java:498)
at scala.collection.immutable.List$SerializationProxy.readObject(List.scala:527)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at java.base/java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1102)
at java.base/java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2444)
at java.base/java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2284)
at java.base/java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1762)
at java.base/java.io.ObjectInputStream$FieldValues.<init>(ObjectInputStream.java:2618)
at java.base/java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2469)
at java.base/java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2284)
at java.base/java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1762)
at java.base/java.io.ObjectInputStream$FieldValues.<init>(ObjectInputStream.java:2618)
at java.base/java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:678)
at org.apache.daffodil.runtime1.processors.SchemaSetRuntimeData.readObject(SchemaSetRuntimeData.scala:51)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at java.base/java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1102)
at java.base/java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2444)
at java.base/java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2284)
at java.base/java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1762)
at java.base/java.io.ObjectInputStream$FieldValues.<init>(ObjectInputStream.java:2618)
at java.base/java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2469)
at java.base/java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2284)
at java.base/java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1762)
at java.base/java.io.ObjectInputStream.readObject(ObjectInputStream.java:540)
at java.base/java.io.ObjectInputStream.readObject(ObjectInputStream.java:498)
at org.apache.daffodil.core.compiler.Compiler.reload(Compiler.scala:273)
at org.apache.daffodil.core.compiler.Compiler.reload(Compiler.scala:218)
at org.apache.daffodil.cli.Main.$anonfun$createProcessorFromParser$1(Main.scala:990)
at org.apache.daffodil.lib.util.Timer$.getTimeResult(Timer.scala:78)
at org.apache.daffodil.lib.util.Timer$.getResult(Timer.scala:37)
at org.apache.daffodil.cli.Main.createProcessorFromParser(Main.scala:990)
at org.apache.daffodil.cli.Main.runIgnoreExceptions(Main.scala:1146)
at org.apache.daffodil.cli.Main.run(Main.scala:1950)
at org.apache.daffodil.cli.Main$.main(Main.scala:875)
at org.apache.daffodil.cli.Main.main(Main.scala)
It took quite a while to figure out what the problem was. Don't know if it would be possible or reasonable, but it would be nice if any dependencies like this could be baked into the saved parser flie.