Base64.stringToObject(String s) can not used with a different class loader. Even if a different class loader is loaded before calling Base64.stringToObject(), the original class loader will sill be used.
Specifically, ClassLoaderObjectInputStream needs to use Class.forName() instead of ClassLoader.loadClass. The reason for this is because loadClass actually loads a new instance of the class into the JVM rather than fetch an already loaded class. This happens when doing cross-classloader loading which results in class in-equivalency.
To address this issue, a new method has been added to Base64:
stringToObject(String s, ClassLoader classLoader)
The new method will use the provided ClassLoader to convert the string to an object.