diff --git a/src/bsh/XThis.java b/src/bsh/XThis.java
index <HASH>..<HASH> 100644
--- a/src/bsh/XThis.java
+++ b/src/bsh/XThis.java
@@ -69,6 +69,10 @@ public class XThis extends This
 		return "'this' reference (XThis) to Bsh object: " + namespace;
 	}
 
+	private Object readResolve() throws ObjectStreamException {
+		throw new NotSerializableException("Deserializing XThis not supported");
+	}
+
 	/**
 		Get dynamic proxy for interface, caching those it creates.
 	*/
Prevent deserialization of XThis