Open oscar-broman opened 9 years ago
The reason this happened was I did streamPickle.unpickle[Any]
followed by pattern matching. It worked when it was used via the console or in production, but not during dev mode. Being explicit about what I want to unpickle works in all modes.
@phaller, @heathermiller Is this a known behavior that can be solved by a stoke of a pen (or a membrane keyboard)?
This is a general issue with all serialization frameworks that use any form of runtime reflection in the presence of classloaders (e.g. ObjectInputStream). What you have to do is set the currentMirror
in the internal
package of pickling to the appropriate one so pickling can find your classes. Otherwise, pickling assumes System classloader (or current thread context classloader) which is probably wrong for play dev-mode.
I think we'll have to doucment this usage explicitly and provide some nice hooks for dealing with this issue.
Also, the 0.11.x branch should be removing the need for reflection on pickling tags, whcih MAY help solve your issue if you can compile with staticOnly
imported.
When Play is running with hot reloating (
sbt run
), pickling can't load a very simple, sealed class.The class is declared in another file as such: