Eyal,

Don't instantiate it in the main method just set it when you are defining
the variable.

private static List<String> SHARED_LIST = Arrays.asList("item1","item2");

On Thu, Dec 4, 2014 at 2:01 PM, Eyal Golan <[email protected]> wrote:

> Hi all,
> I am newbie with Storm and having some issues with static objects in the
> topology.
> In the main class, where I set the topology, I also set a static object.
> It's actually a wrapper for a collection of strings.
> This object needs to he shared between different bolts.
> It's big so I want it to be only one instance.
>
> The problem is that when a bolt tries to get this static instance: example
> - MyMain.Shared... It's null. Although I instantiated it in the main method.
>
> I guess I'm doing something wrong.
>
> Thanks for any assistance.
>
> Eyal
>
> Sent from my Android phone
>

Reply via email to