Is there a way I can add custom GUI components?
I have tried jarring them and dropping the JAR into
lib/ext. The class load okay but then when the
DashBoardFactory tries to set one of the methods I get
a NoClassDefError for javax.management.ObjectName!
EXCEPTION:
java.lang.NoClassDefFoundError:
javax/management/ObjectName
at java.lang.Class.getMethods0(Native Method)
at java.lang.Class.getDeclaredMethods
(Class.java:1034)
at java.beans.Introspector$1.run
(Introspector.java:847)
at java.security.AccessController.doPrivileged
(Native Method)
at
java.beans.Introspector.getPublicDeclaredMethods
(Introspector.java:845)
at java.beans.Introspector.internalFindMethod
(Introspector.java:878)
at java.beans.Introspector.findMethod
(Introspector.java:974)
at java.beans.PropertyDescriptor.<init>
(PropertyDescriptor.java:46)
at
org.mc4j.console.util.BeanUtil.getPropertyDescriptor
(BeanUtil.java:82)
at
org.mc4j.console.dashboard.AttributeFactory.setAttribute
(AttributeFactory.java:72)
at
org.mc4j.console.dashboard.AttributeFactory.loadAttribut
es(AttributeFactory.java:56)
at
org.mc4j.console.dashboard.DashboardComponentFactory
.build(DashboardComponentFactory.java:59)
at
org.mc4j.console.dashboard.DashboardFactory.buildV1Co
mponent(DashboardFactory.java:208)
at
org.mc4j.console.dashboard.DashboardFactory.buildV1Co
ntent(DashboardFactory.java:180)
at
org.mc4j.console.dashboard.DashboardFactory.buildV1Co
mponent(DashboardFactory.java:225)
at
org.mc4j.console.dashboard.DashboardFactory.buildV1Co
ntent(DashboardFactory.java:180)
at
org.mc4j.console.dashboard.DashboardFactory.buildDashb
oard(DashboardFactory.java:150)
at
org.mc4j.console.bean.DashboardsAction$ActSubMenuMo
del.performActionAt(DashboardsAction.java:184)
at
org.openide.awt.Actions$SubMenuBridge$ISubActionListe
ner.actionPerformed(Actions.java:666)
at
javax.swing.AbstractButton.fireActionPerformed
(AbstractButton.java:1445)
at
javax.swing.AbstractButton$ForwardActionEvents.actionP
erformed(AbstractButton.java:1499)
at
javax.swing.DefaultButtonModel.fireActionPerformed
(DefaultButtonModel.java:373)
at javax.swing.DefaultButtonModel.setPressed
(DefaultButtonModel.java:245)
at javax.swing.AbstractButton.doClick
(AbstractButton.java:274)
at
javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandl
er.mouseReleased(BasicMenuItemUI.java:882)
at java.awt.Component.processMouseEvent
(Component.java:3710)
at java.awt.Component.processEvent
(Component.java:3539)
at java.awt.Container.processEvent
(Container.java:1159)
at java.awt.Component.dispatchEventImpl
(Component.java:2588)
at java.awt.Container.dispatchEventImpl
(Container.java:1208)
at java.awt.Component.dispatchEvent
(Component.java:2492)
at
java.awt.LightweightDispatcher.retargetMouseEvent
(Container.java:2451)
at
java.awt.LightweightDispatcher.processMouseEvent
(Container.java:2216)
at
java.awt.LightweightDispatcher.dispatchEvent
(Container.java:2125)
at java.awt.Container.dispatchEventImpl
(Container.java:1195)
at java.awt.Window.dispatchEventImpl
(Window.java:923)
at java.awt.Component.dispatchEvent
(Component.java:2492)
[catch] at java.awt.EventQueue.dispatchEvent
(EventQueue.java:334)
at
java.awt.EventDispatchThread.pumpOneEventForHierarch
y(EventDispatchThread.java:126)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy
(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.pumpEvents
(EventDispatchThread.java:88)
at java.awt.EventDispatchThread.run
(EventDispatchThread.java:80)
Logged In: YES
user_id=773314
I think this is probably because your dashboard component is
in the application (system) classloader, while the JMX
classes, like ObjectName are in the module classloader.
The classloading situation for MC4J is a bit complicated to
support multiple servers. The correct solution to this would
be to load the lib/ext jars into each module, rather than
the system classloader. As a quicker fix, you can probably
just place your classes directly into the module Jar.