Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.63 KB | None | 0 0
  1. public class UserProvisionerProfiler implements UserProvisionerProfilerMBean {
  2.  
  3. @Override
  4. public int getTotalNumberOfUsers() {
  5. return activeClients.size();
  6. }
  7. }
  8.  
  9. public interface UserProvisionerProfilerMBean {
  10.  
  11. public int getTotalNumberOfUsers();
  12.  
  13. }
  14.  
  15. UserProvisionerProfiler userProvisionerProfiler = new UserProvisionerProfiler();
  16.  
  17. MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
  18. ObjectName name = new ObjectName(userProvisionerProfiler.getClass().getPackage().getName() + ":type=" + userProvisionerProfiler.getClass().getName());
  19.  
  20. mbs.registerMBean(userProvisionerProfiler, name);
  21.  
  22. 1356 [1;31mERROR[39m [main], UserProvisioner ; Unhandled exception caught in main()
  23. javax.management.NotCompliantMBeanException: MBean class UserProvisioner$UserProvisionerProfiler does not implement DynamicMBean, and neither follows the Standard MBean conventions (javax.management.NotCompliantMBeanException: Class UserProvisioner$UserProvisionerProfiler is not a JMX compliant Standard MBean) nor the MXBean conventions (javax.management.NotCompliantMBeanException: UserProvisioner$UserProvisionerProfiler: Class UserProvisioner$UserProvisionerProfiler is not a JMX compliant MXBean)
  24. at com.sun.jmx.mbeanserver.Introspector.checkCompliance(Introspector.java:171)
  25. at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(DefaultMBeanServerInterceptor.java:317)
  26. at com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(JmxMBeanServer.java:512)
  27. UserProvisioner.registerThisAsMBean(UserProvisioner.java:734)
  28. UserProvisioner.start(UserProvisioner.java:797)
  29. UserProvisioner.main(UserProvisioner.java:844)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement