【发布时间】:2013-02-18 15:07:09
【问题描述】:
我正在尝试使用自定义属性创建 MXBean,但我得到 javax.management.NotCompliantMBeanException IJmsDestinationMBean.getAttributes 具有无法转换为开放类型的参数或返回类型
我已阅读到 MXBean 属性必须与 OpenType 兼容。 我将如何使我的属性以这种方式工作? 以下所有类都在同一个包中。
class JmsDestinationMBean implements IJmsDestinationMBean{
protected JmsDestinationAttributes attributes = new JmsDestinationAttributes();
@Override
public JmsDestinationAttributes getAttributes() {
return this.attributes;
}
}
@MXBean
interface IJmsDestinationMBean {
JmsDestinationAttributes getAttributes()
}
class JmsDestinationAttributes {
protected String name
protected int messagesCurrentCount
protected int consumersCurrentCount
String getName() {
this.name;
}
int getMessagesCurrentCount() {
this.messagesCurrentCount;
}
int getConsumersCurrentCount() {
this.consumersCurrentCount;
}
}
【问题讨论】:
-
您的实现类是否与您的接口在同一个包中?看看这个链接forums.oracle.com/forums/thread.jspa?messageID=4795137。
-
它们都在同一个包中。我在该链接中没有找到任何帮助。
-
您是否查看过“发布时间:2010 年 9 月 7 日上午 7:08”,其中包含有关您发布的类似错误的一些信息。例外是相同的,但主要问题可能是其他问题。我只能在没有看到很难调试的代码的情况下尝试提供帮助。 forums.oracle.com/forums/thread.jspa?messageID=4795137.
-
这只是一个java应用程序。
-
您能告诉我您使用的是 jre6 还是 jre1.6.0_01 或其他版本。尝试使用较旧的 jre 而不是 jre1.6.0_01(以前的 jre 版本,jre6)。希望这有助于并解决您的问题