I am trying to use java script engine to execute some rules on data set. But it is throwing
NotSerializableException for jdk.nashorn.api.scripting.NashornScriptEngine.Not sure how to resolve this. Thanks Caused by: java.io.NotSerializableException: jdk.nashorn.api.scripting.NashornScriptEngine at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1184) at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1509) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178) at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:348) at org.apache.flink.util.InstantiationUtil.serializeObject(InstantiationUtil.java:314) at org.apache.flink.api.java.ClosureCleaner.ensureSerializable(ClosureCleaner.java:95) |
Hi, I guess you have a user function with a field for the scripting engine. Can you change your user function into a Rich* function, initialize the scripting engine in the open() method and make the field transient? That should resolve it. On Fri, Jun 5, 2015 at 10:25 AM, Ashutosh Kumar <[hidden email]> wrote:
|
Thanks Robert.I tried this . It does not throw NotSerializableException exception.But the open method is not getting called. On Fri, Jun 5, 2015 at 1:58 PM, Robert Metzger <[hidden email]> wrote:
|
That should not happen. Which function (map, join, ..) are you using? Are you using the the batch or the streaming API? Which version of Flink are you using? On Fri, Jun 5, 2015 at 11:35 AM, Ashutosh Kumar <[hidden email]> wrote:
|
Hello,
I'm having the exact same problem. I'm using a filter function on a datastream. My flink version is 1.1.3. What could be the problem? Regards, Pedro Chaves.
Best Regards,
Pedro Chaves |
Hi Pedro, Which problem are you having, the NotSerializableException or not seeing open() called on a RichFunction? Greg On Wed, Nov 2, 2016 at 10:47 AM, PedroMrChaves <[hidden email]> wrote: Hello, |
Free forum by Nabble | Edit this page |