Multiple registrations of transport actions on startup

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Multiple registrations of transport actions on startup

Alexander Reelsen
Hi,

I have these error messages in my log

[2011-12-26 01:09:39,942][WARN ][transport                ]
[Cannonball] Registered two transport handlers for action /indices/
suggest/refresh, handlers: /indices/suggest/refresh, /indices/suggest/
refresh
[2011-12-26 01:09:39,942][WARN ][transport                ]
[Cannonball] Registered two transport handlers for action /indices/
suggest/refresh/node, handlers: /indices/suggest/refresh/node, /
indices/suggest/refresh/node

The handler is the return string from a transportAction() and a
transportNodeAction() method each. The constructor of this action,
which extends a TransportNodesOperationAction, is called six times on
startup. As I merely copied the code from the
TransportNodesStatsAction, I am not sure what I am missing right now.

Can I add some neat debug level somewhere in order to find out more
information?

Thanks and happy holidays...


--Alexander
Reply | Threaded
Open this post in threaded view
|

Re: Multiple registrations of transport actions on startup

kimchy
Administrator
Are you registering the action as a singleton in guice?

On Mon, Dec 26, 2011 at 2:18 AM, Alexander Reelsen <[hidden email]> wrote:
Hi,

I have these error messages in my log

[2011-12-26 01:09:39,942][WARN ][transport                ]
[Cannonball] Registered two transport handlers for action /indices/
suggest/refresh, handlers: /indices/suggest/refresh, /indices/suggest/
refresh
[2011-12-26 01:09:39,942][WARN ][transport                ]
[Cannonball] Registered two transport handlers for action /indices/
suggest/refresh/node, handlers: /indices/suggest/refresh/node, /
indices/suggest/refresh/node

The handler is the return string from a transportAction() and a
transportNodeAction() method each. The constructor of this action,
which extends a TransportNodesOperationAction, is called six times on
startup. As I merely copied the code from the
TransportNodesStatsAction, I am not sure what I am missing right now.

Can I add some neat debug level somewhere in order to find out more
information?

Thanks and happy holidays...


--Alexander

Reply | Threaded
Open this post in threaded view
|

Re: Multiple registrations of transport actions on startup

Alexander Reelsen
Hey Shay

found the problem, Binding them in my plugin module as eager singleton
like this

bind(TransportSuggestAction.class).asEagerSingleton();

was not enough, when not adding the module via modules() method in the
class extending AbstractPlugin...


--Alexander

On Dec 26, 3:34 pm, Shay Banon <[hidden email]> wrote:

> Are you registering the action as a singleton in guice?
>
> On Mon, Dec 26, 2011 at 2:18 AM, Alexander Reelsen <
>
>
>
>
>
>
>
> [hidden email]> wrote:
> > Hi,
>
> > I have these error messages in my log
>
> > [2011-12-26 01:09:39,942][WARN ][transport                ]
> > [Cannonball] Registered two transport handlers for action /indices/
> > suggest/refresh, handlers: /indices/suggest/refresh, /indices/suggest/
> > refresh
> > [2011-12-26 01:09:39,942][WARN ][transport                ]
> > [Cannonball] Registered two transport handlers for action /indices/
> > suggest/refresh/node, handlers: /indices/suggest/refresh/node, /
> > indices/suggest/refresh/node
>
> > The handler is the return string from a transportAction() and a
> > transportNodeAction() method each. The constructor of this action,
> > which extends a TransportNodesOperationAction, is called six times on
> > startup. As I merely copied the code from the
> > TransportNodesStatsAction, I am not sure what I am missing right now.
>
> > Can I add some neat debug level somewhere in order to find out more
> > information?
>
> > Thanks and happy holidays...
>
> > --Alexander