# JMX NotificationEmitter problem: addNotificationListener of the Module is not invoked

**URL:** https://community.wowza.com/t/jmx-notificationemitter-problem-addnotificationlistener-of-the-module-is-not-invoked/35193
**Category:** Wowza Developer Dojo
**Tags:** wowza-streaming-server-java-api
**Created:** [November 14, 2011, 5:36pm UTC](https://community.wowza.com/t/jmx-notificationemitter-problem-addnotificationlistener-of-the-module-is-not-invoked/35193 "2011-11-14T17:36:41Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Mauro\_Gattari](https://avatars.discourse-cdn.com/v4/letter/m/f08c70/32.png) [@Mauro\_Gattari](https://community.wowza.com/u/Mauro_Gattari)
#### Post date: [November 14, 2011, 5:36pm UTC](https://community.wowza.com/t/jmx-notificationemitter-problem-addnotificationlistener-of-the-module-is-not-invoked/35193/1 "2011-11-14T17:36:41Z")

</div>

Hi,

I’m successfully connecting to a custom module through a JMX client, I can invoke methods remotely without problems.

Now I’d like to have the module emits notifications to the client.

The module is declared as follows:

```auto
public class StreamManager extends ModuleBase implements NotificationEmitter

```

I’ve provided an implementation for the methods declared in the interface (the implementation actually delegates to a private NotificationBroadcasterSupport object).

On the client side I connect to the module and add a notification listener:

```auto
mbeanServerConnection.addNotificationListener(streamManagerObjectName, myListener, null, null);	       

```

However, the addNotificationListener of the module (StreamManager) is never invoked and therefore notifications are not delivered.

Might there be any reason that prevents addNotificationListener of the module to be invoked?

Thanks for any help

---

<div class="post-metadata">

### Author: ![Mauro\_Gattari](https://avatars.discourse-cdn.com/v4/letter/m/f08c70/32.png) [@Mauro\_Gattari](https://community.wowza.com/u/Mauro_Gattari)
#### Post date: [November 15, 2011, 11:30am UTC](https://community.wowza.com/t/jmx-notificationemitter-problem-addnotificationlistener-of-the-module-is-not-invoked/35193/2 "2011-11-15T11:30:05Z")

</div>

The Notification node of the module instance in Jconsole appears empty, so It seems that the Module does not expose the Notifications (getNotificationInfo() is not called?) it can broadcast.

That’s probably why the addNotificationListener of the module is not called.

Any help why?

Thanks

---

<div class="post-metadata">

### Author: ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)
#### Post date: [November 16, 2011, 3:12pm UTC](https://community.wowza.com/t/jmx-notificationemitter-problem-addnotificationlistener-of-the-module-is-not-invoked/35193/3 "2011-11-16T15:12:11Z")

</div>

I’m not sure how to help with this. Have you seen this article?

[https://www.wowza.com/docs/how-to-expose-an-attribute-or-method-of-a-custom-application-module-through-jmx-jconsole](https://www.wowza.com/docs/how-to-expose-an-attribute-or-method-of-a-custom-application-module-through-jmx-jconsole)

Richard

---

<div class="post-metadata">

### Author: ![Mauro\_Gattari](https://avatars.discourse-cdn.com/v4/letter/m/f08c70/32.png) [@Mauro\_Gattari](https://community.wowza.com/u/Mauro_Gattari)
#### Post date: [November 16, 2011, 4:20pm UTC](https://community.wowza.com/t/jmx-notificationemitter-problem-addnotificationlistener-of-the-module-is-not-invoked/35193/4 "2011-11-16T16:20:27Z")

</div>

Method invokation works fine through a jmx connection to the Module, but I think the Module cannot emit notifications.

I’ve encapsulated all the code in a mbean that I’ve registered manually in the Module onAppStart method, this way notifications work.

Thanks.
