flink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject git commit: Add a FAQ entry about serializability errors
Date Mon, 22 Sep 2014 22:12:06 GMT
Repository: incubator-flink
Updated Branches:
  refs/heads/master 1e137be52 -> 8d8372167

Add a FAQ entry about serializability errors

Project: http://git-wip-us.apache.org/repos/asf/incubator-flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-flink/commit/8d837216
Tree: http://git-wip-us.apache.org/repos/asf/incubator-flink/tree/8d837216
Diff: http://git-wip-us.apache.org/repos/asf/incubator-flink/diff/8d837216

Branch: refs/heads/master
Commit: 8d8372167bf5e3a7a23cf7e8462bec676ef81d9a
Parents: 1e137be
Author: Stephan Ewen <sewen@apache.org>
Authored: Tue Sep 23 00:10:58 2014 +0200
Committer: Stephan Ewen <sewen@apache.org>
Committed: Tue Sep 23 00:10:58 2014 +0200

 docs/faq.md | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/docs/faq.md b/docs/faq.md
index 1008499..2480a4e 100644
--- a/docs/faq.md
+++ b/docs/faq.md
@@ -46,7 +46,7 @@ changes of all operators as the program progresses through the operations.
 ### How can I figure out why a program failed?
-- Thw JobManager web frontend (by default on port 8081) displays the exceptions
+- The JobManager web frontend (by default on port 8081) displays the exceptions
 of failed tasks.
 - If you run the program from the command-line, task exceptions are printed to
 the standard error stream and shown on the console.
@@ -69,6 +69,20 @@ execution.
 ## Errors
+### Why am I getting a "NonSerializableException" ?
+All functions in Flink must be serializable, as defined by [java.io.Serializable](http://docs.oracle.com/javase/7/docs/api/java/io/Serializable.html).
+Since all function interfaces are serializable, the exception means that one
+of the fields used in your function is not serializable.
+In particular, if your function is an inner class, or anonymous inner class,
+it contains a hidden reference to the enclosing class (usually called `this$0`, if you look
+at the function in the debugger). If the enclosing class is not serializable, this is probably
+the source of the error. Solutions are to
+- make the function a standalone class, or a static inner class (no more reference to the
enclosing class)
+- make the enclosing class serializable
+- use a Java 8 lambda function.
 ### I get an error message saying that not enough buffers are available. How do I fix this?
 If you run Flink in a massively parallel setting (100+ parallel threads),

View raw message