[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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 <amols@xxxxxxxxxxxxxxx> wrote:
Hello folks,

I am trying to write my streaming result into mongodb using
RIchSinkFunction as below.


where mongoSink is Autowired i.e. injected object and it is giving me below

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

*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* <sachin@xxxxxxxxxxxxxxx>