When I run my Dataflow pipeline, I get the exception below complaining that my DoFn can\'t be serialized. How do I fix this?
Here\'s the stack trace:
To add to what Jeremy says...
Another common cause of Serializable issues is when you use an anonymous DoFn within a non-static context. Anonymous inner classes have an implicit pointer to the enclosing class, which will cause it to get serialized as well.