[ 
https://issues.apache.org/jira/browse/NIFI-1284?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15062303#comment-15062303
 ] 

Oleg Zhurakousky commented on NIFI-1284:
----------------------------------------

Big +1 on this one. 
I'd say the rule of thumb should be that we should be cautious on components 
that are being serialized. What Bryan discovered is actually a bigger issue 
since serialization was dragging the outer class and all its attributes (some 
of which may not be serializable). On top of that if such outer class was also 
an inner class the the vicious cycle of pulling parent would continue which 
even if succeeded would end up serializing much more then it was intended. And 
that may also have security implications.

LGTM

> Unable to serialize SiteToSiteClientConfig
> ------------------------------------------
>
>                 Key: NIFI-1284
>                 URL: https://issues.apache.org/jira/browse/NIFI-1284
>             Project: Apache NiFi
>          Issue Type: Improvement
>    Affects Versions: 0.4.0, 0.3.0
>            Reporter: Bryan Bende
>            Assignee: Bryan Bende
>            Priority: Minor
>             Fix For: 0.5.0
>
>         Attachments: NIFI-1284.patch
>
>
> While using the SiteToSiteClient with a third party framework that uses Kryo 
> serialization, I ran into this issue:
> Caused by: com.esotericsoftware.kryo.KryoException: Class cannot be created 
> (missing no-arg constructor): 
> org.apache.nifi.remote.client.SiteToSiteClient$Builder$1
> $1 is the anonymous inner class created in 
> SiteToSiteClient.Builder.buildConfig().
> The issue here is that behind the scenes the anonymous inner class ends up 
> with a constructor which takes the outer class an arg, so there ends up being 
> no 0-arg constructor.
> Putting this ticket in to see if it is possible to somehow move that 
> anonymous inner class to a static inner class.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to