Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7787195
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T20:35:11+00:00 2026-06-01T20:35:11+00:00

Hello recently I started working on a JMX bean implementation. I then publish the

  • 0

Hello recently I started working on a JMX bean implementation.

I then publish the below bean, run JConsole, connect to the bean, register for notification. However when the notification is sent i get the following error:

Apr 13, 2012 5:31:26 PM ClientNotifForwarder NotifFetcher.fetchOneNotif
WARNING: Failed to deserialize a notification: java.io.NotSerializableException: com.*.jmx.TaskMergeMBean

Any help will be most welcome, I’ve spent the better part of a day trying to figure this one out.

Thanks,
Jonathan

public class TaskMBean extends NotificationBroadcasterSupport implements DynamicMBean {

  private final TaskStateChangedEventListener taskChangedListener;

  public TaskMBean (DriverIf driver) {
    taskChangedListener= new TaskStateChangedEventListener (this);
    driver.registerMergeTaskStateChangedListener(mergeTaskChangedListener);
  }
  @Override
  public MBeanNotificationInfo[] getNotificationInfo() {
    String[] types = new String[] { AttributeChangeNotification.ATTRIBUTE_CHANGE };
    String name = AttributeChangeNotification.class.getName();
    String description = "An attribute of this MBean has changed";
    MBeanNotificationInfo info = new MBeanNotificationInfo(types, name,description);
    return new MBeanNotificationInfo[] { info };
  }

  @Override
  public Object getAttribute(String attribute) throws AttributeNotFoundException,          MBeanException,
      ReflectionException {
    // TODO Auto-generated method stub
    return null;
  }

  @Override
  public void setAttribute(Attribute attribute) throws AttributeNotFoundException,
      InvalidAttributeValueException, MBeanException, ReflectionException {
    // TODO Auto-generated method stub

  }

  @Override
  public AttributeList getAttributes(String[] attributes) {
    // TODO Auto-generated method stub
    return null;
  }

  @Override
  public AttributeList setAttributes(AttributeList attributes) {
    // TODO Auto-generated method stub
    return null;
  }

  @Override
  public Object invoke(String actionName, Object[] params, String[] signature)
      throws MBeanException, ReflectionException {
    // TODO Auto-generated method stub
    return null;
  }

  @Override
  public MBeanInfo getMBeanInfo() {
    MBeanNotificationInfo haltInfo =
        new MBeanNotificationInfo(
            new String[] { "NOTIFICATION_TYPE_MERGE_STATE_CHANGE" },
            Notification.class.getName(), "server halt on fatal error");
    MBeanNotificationInfo[] notifications = new MBeanNotificationInfo[] { haltInfo };
    return new OpenMBeanInfoSupport(XhiveMergeMBean.class.getName(), "", null, null, null,
        notifications);
  }
}

public class TaskStateChangedEventListener implements Serializable {

  static final String NOTIFICATION_TYPE_MERGE_STATE_CHANGE = "com.xhive.lucene.merge";
  private final NotificationBroadcasterSupport broadcaster;
  private int notificationSequence = 1;

  public TaskStateChangedEventListener (NotificationBroadcasterSupport broadcaster) {
    this.broadcaster = broadcaster;
  }

  @Override
  public void notify(Object source) {
    Notification n =
        new AttributeChangeNotification(this, notificationSequence++,    System.currentTimeMillis(), "", "", "int", 1, 2);
    broadcaster.sendNotification(n);
  }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T20:35:12+00:00Added an answer on June 1, 2026 at 8:35 pm

    What Peter said. But also…..

    Notifications usually (but not always) have to be serialized, so using this as the notification source tends to put a dent in that. (pun intended)

    So you need to make completely sure that the the instance of this is serializable (and preferably usefully so) or better yet, send a simpler representation of what this is, like the ObjectName of the MBean. The intent is for the receiver (or the filter) to be able to determine the source of the notification, so I find that consistent use of informative ObjectNames really helps.

    And lastly, JConsole tends to be a bit thin on business classes (by default I mean) so if you’re relying on JConsole a lot and you want to be able to view all your notifications cleanly, you need to make sure you only use core JDK types in your payload.

    (Or use OpenTypes (same thing) or enable remote class loading (not worth the hassle)).

    //Nicholas

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Useful Regular Expression Tutorial Hello, I recently started coding in javascript. I
Hello fellow programmers! Recently, I started learning Git, and pretty quickly discovered the amazing
Recently, I have a try to build and run sample hello world program of
Hello dear members of stackoverflow I've recently started learning C++, today I wrote a
Hello i have recently started using vim editor ( actually the plugin for netbeans
I recently started working with Eclipse to build Android Applications. I have made a
Hello I've recently been tasked with working on a Delphi project. Before I was
Hello First sorry for my english. I have started recently my first project on
Hello I have been recently working on Django search forms recently and have tired
I was recently reading about the Arduino's Hello World application, and I thought to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.