Hi Satheesh,

That’s because lambas are not serializable. An easy workaround is to do
something like this.

https://dzone.com/articles/how-and-why-to-serialialize-lambdas

However, you should try to understand the reason why lambas are not
serializable, and if doing this workaround won’t have any unwanted side
effects.

Best,
Hugo

On Tue, Oct 22, 2019 at 10:56 PM Satheesh Akkinepally
<[email protected]> wrote:

> I tried to run the Join example (
> org.apache.storm.starter.streams.JoinExample) using LocalCluster and it
> fails out of the box with the below error
>
> Exception in thread "main" java.lang.IllegalStateException: Bolt 'bolt2'
> contains a non-serializable field of type
> org.apache.storm.starter.streams.JoinExample $$Lambda$1/376416077, which
> was instantiated prior to topology creation.
> org.apache.storm.starter.streams.JoinExample $$Lambda$1/376416077 should be
> instantiated within the prepare method of 'bolt2 at the earliest.
>                 at
> org.apache.storm.topology.TopologyBuilder.createTopology(TopologyBuilder.java:121)
>                 at
> org.apache.storm.streams.StreamBuilder.build(StreamBuilder.java:188)
>                 at
> org.apache.storm.starter.streams.JoinExample.main(JoinExample.java:56)
> Caused by: java.lang.RuntimeException: java.io.NotSerializableException:
> org.apache.storm.starter.streams.JoinExample $$Lambda$1/376416077
>                 at
> org.apache.storm.utils.Utils.javaSerialize(Utils.java:524)
>                 at
> org.apache.storm.topology.TopologyBuilder.createTopology(TopologyBuilder.java:116)
>                 ... 2 more
> Caused by: java.io.NotSerializableException:
> org.apache.storm.starter.streams.JoinExample $$Lambda$1/376416077
>
> Any idea? I am new to the Storm and would like to use the modern streaming
> apis for my use case
>
> Thank You!
>
>

Reply via email to