You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@flink.apache.org by Hequn Cheng <ch...@gmail.com> on 2018/07/05 11:56:07 UTC

Re: Facing issue in RichSinkFunction

Hi Amol,

The implementation of the RichSinkFunction probably contains a field that
is not serializable. To avoid serializable exception, you can:
1. Marking the field as transient. This makes the serialization mechanism
skip the field.
2. If the field is part of the object's persistent state, the type of the
field must implement Serializable.

Furthermore, you can remove some fields to locate the problem fields.

Best, Hequn


On Thu, Jul 5, 2018 at 5:23 PM, Amol S - iProgrammer <am...@iprogrammer.com>
wrote:

> Hello folks,
>
> I am trying to write my streaming result into mongodb using
> RIchSinkFunction as below.
>
> gonogoCustomerApplicationStream.addSink(mongoSink)
>
> where mongoSink is Autowired i.e. injected object and it is giving me below
> error.
>
> The implementation of the RichSinkFunction is not serializable. The object
> probably contains or references non serializable fields.
>
> what is solution on this?
>
> -----------------------------------------------
> *Amol Suryawanshi*
> Java Developer
> amols@iprogrammer.com
>
>
> *iProgrammer Solutions Pvt. Ltd.*
>
>
>
> *Office 103, 104, 1st Floor Pride Portal,Shivaji Housing Society,
> Bahiratwadi,Near Hotel JW Marriott, Off Senapati Bapat Road, Pune - 411016,
> MH, INDIA.**Phone: +91 9689077510 | Skype: amols_iprogrammer*
> www.iprogrammer.com <sa...@iprogrammer.com>
> ------------------------------------------------
>