allow the replacement of non-serializable objects.
diff --git a/src/main/java/org/apache/ode/jacob/vpu/ExecutionQueueImpl.java b/src/main/java/org/apache/ode/jacob/vpu/ExecutionQueueImpl.java index 42393f8..ce872fa 100644 --- a/src/main/java/org/apache/ode/jacob/vpu/ExecutionQueueImpl.java +++ b/src/main/java/org/apache/ode/jacob/vpu/ExecutionQueueImpl.java
@@ -641,8 +641,9 @@ * @throws IOException */ protected Object replaceObject(Object obj) throws IOException { - if (!Serializable.class.isAssignableFrom(obj.getClass())) { - throw new IllegalArgumentException("Cannot replace non Serializable instance of " + obj.getClass()); + if (!Serializable.class.isAssignableFrom(obj.getClass()) && + !(_replacementMap != null && _replacementMap.isReplaceable(obj))) { + throw new IllegalArgumentException("Cannot replace non-serializable or non-replacable instance of " + obj.getClass()); } if (obj instanceof org.apache.ode.jacob.oo.ChannelProxy) {