[GLASSFISH-14405] Use consistent mbean object name Created: 03/Nov/10  Updated: 23/Apr/15

Status: In Progress
Project: glassfish
Component/s: amx
Affects Version/s: 4.0
Fix Version/s: future release

Type: Bug Priority: Critical
Reporter: Nazrul Assignee: Peter Bower
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Issue Links:
Dependency
blocks GLASSFISH-14357 [BLOCKING] cannot access web applicat... Resolved
Issuezilla Id: 14,405
Tags: 3_1-exclude, javaee_ri_target

 Description   

[Tracking Issue]

Refer to issue 14357 for context.

We seem to be using both "amx:" and "com.sun.appserv:". We should be using one
name consistently for all GlassFish object names.

Given that we are de-emphasiging AMX, should we use "com.sun.appserv:" (for JSR
77, monitoring mbeans, etc.)?

Since email thread did not work, I am creating this issue to finalize a decision
on this.



 Comments   
Comment by Nazrul [ 09/Nov/10 ]

If we are able to change, using something like "glassfish:" is probably a good
choice.

Comment by Amy Roh [ 16/Nov/10 ]

Fixed in web container.

Sending
core/kernel/src/main/java/com/sun/enterprise/v3/server/ServerContextImpl.java
Transmitting file data .
Committed revision 42857.

Comment by Nazrul [ 01/Dec/10 ]

See also issue GLASSFISH-14923

Comment by Nazrul [ 06/Dec/10 ]

The tomcat created mbeans were conflicting during load time of AMX mbeans. Since this is late in 3.1, we decided to leave the tomcat created mbeans under "glassfish-web:". We will also try to comment out (not create) mbeans that are not needed by web container initialization. During 3.2, we will try to not rely on mbeans for configuration update notification in web container.

Prasad will try to rename "amx:" to "glassfish:" if there are no issues.

Comment by Amy Roh [ 06/Dec/10 ]

Changed web domain to "glassfish-web" in svn 43495 and removed unused Tomcat MBeans registration in svn 43514

Comment by prasads [ 06/Dec/10 ]

This would be fixed in 3.2

Comment by prasads [ 09/Dec/10 ]

There are a couple of issues that we need to look at :
1. There is a conflict due to two Mbeans being created for a WebModule/Servlet/Wrapper. This is confusing.
2. Since there are two MBeans being created both of them are being registered as NotificationHandlers for mbean notifications.
3. These Mbeans are loaded at different times . The ones created by Tomcat are loaded at startup and the ones created by AMX are loaded on demand.

The outcome of #1 is that its confusing to see two MBeans of same type being created for a single WebModule, Servlet under the same domain. While one represents the JSR77 Mbean created by GlassFish, the other one represents the MBean created by Tomcat for its internal lifecycle management. The user would need to use the former, but there is no way for him/her to know which one to use.

The outcome of #2 is that the wrong mBean handles the notification coming from the mBean Server . This results in an ugly message.
[#|2010-11-23T13:42:34.233+0530|WARNING|glassfish3.1|org.apache.catalina.connector.MapperListener|_ThreadID=15;_ThreadName=Thread-1;|Error registering Wrapper glassfish:pp=/J2EEDomain/J2EEServer/WebModule[jsfastrologer],type=Servlet,name=default,j2eeType=Servlet,J2EEServer=server,WebModule=jsfastrologer,J2EEApplication=null
javax.management.MBeanException
at org.glassfish.admin.amx.impl.mbean.AMXImplBase.handleException(AMXImplBase.java:830)
at org.glassfish.admin.amx.impl.mbean.AMXImplBase.handleInvokeThrowable(AMXImplBase.java:846)
at org.glassfish.admin.amx.impl.mbean.AMXImplBase.invoke(AMXImplBase.java:878)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:857)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:795)
at com.sun.enterprise.v3.admin.DynamicInterceptor.invoke(DynamicInterceptor.java:353)
at org.apache.catalina.connector.MapperListener.registerWrapper(MapperListener.java:667)
at org.apache.catalina.connector.MapperListener.handleNotification(MapperListener.java:369)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor$ListenerWrapper.handleNotification(DefaultMBeanServerInterceptor.java:1776)
at javax.management.NotificationBroadcasterSupport.handleNotification(NotificationBroadcasterSupport.java:274)
at javax.management.NotificationBroadcasterSupport$SendNotifJob.run(NotificationBroadcasterSupport.java:339)
at javax.management.NotificationBroadcasterSupport$1.execute(NotificationBroadcasterSupport.java:324)
at javax.management.NotificationBroadcasterSupport.sendNotification(NotificationBroadcasterSupport.java:247)
at javax.management.MBeanServerDelegate.sendNotification(MBeanServerDelegate.java:205)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.sendNotification(DefaultMBeanServerInterceptor.java:1563)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.internal_addObject(DefaultMBeanServerInterceptor.java:1538)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerDynamicMBean(DefaultMBeanServerInterceptor.java:986)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerObject(DefaultMBeanServerInterceptor.java:938)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(DefaultMBeanServerInterceptor.java:330)
at com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(JmxMBeanServer.java:516)
at com.sun.enterprise.v3.admin.DynamicInterceptor.registerMBean(DynamicInterceptor.java:438)
at org.glassfish.admin.amx.impl.j2ee.RegistrationSupport.registerJ2EEChild(RegistrationSupport.java:555)
at org.glassfish.admin.amx.impl.j2ee.RegistrationSupport.registerWebModuleAndItsComponents(RegistrationSupport.java:408)
at org.glassfish.admin.amx.impl.j2ee.RegistrationSupport.createAppMBeans(RegistrationSupport.java:267)
at org.glassfish.admin.amx.impl.j2ee.RegistrationSupport.processApplicationRef(RegistrationSupport.java:527)
at org.glassfish.admin.amx.impl.j2ee.RegistrationSupport.registerApplications(RegistrationSupport.java:479)
at org.glassfish.admin.amx.impl.j2ee.RegistrationSupport.<init>(RegistrationSupport.java:163)
at org.glassfish.admin.amx.impl.j2ee.J2EEServerImpl.registerChildren(J2EEServerImpl.java:121)
at org.glassfish.admin.amx.impl.j2ee.DASJ2EEServerImpl.registerChildren(DASJ2EEServerImpl.java:73)
at org.glassfish.admin.amx.impl.mbean.AMXImplBase.postRegisterHook(AMXImplBase.java:972)
at org.glassfish.admin.amx.impl.mbean.MBeanImplBase.postRegister(MBeanImplBase.java:352)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.postRegisterInvoke(DefaultMBeanServerInterceptor.java:1058)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerDynamicMBean(DefaultMBeanServerInterceptor.java:997)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerObject(DefaultMBeanServerInterceptor.java:938)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(DefaultMBeanServerInterceptor.java:330)
at com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(JmxMBeanServer.java:516)
at com.sun.enterprise.v3.admin.DynamicInterceptor.registerMBean(DynamicInterceptor.java:438)
at org.glassfish.admin.amx.impl.mbean.AMXImplBase.registerChild(AMXImplBase.java:1025)
at org.glassfish.admin.amx.impl.j2ee.J2EEDomainImpl.registerChildren(J2EEDomainImpl.java:104)
at org.glassfish.admin.amx.impl.mbean.AMXImplBase.postRegisterHook(AMXImplBase.java:972)
at org.glassfish.admin.amx.impl.mbean.MBeanImplBase.postRegister(MBeanImplBase.java:352)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.postRegisterInvoke(DefaultMBeanServerInterceptor.java:1058)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerDynamicMBean(DefaultMBeanServerInterceptor.java:997)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerObject(DefaultMBeanServerInterceptor.java:938)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(DefaultMBeanServerInterceptor.java:330)
at com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(JmxMBeanServer.java:516)
at com.sun.enterprise.v3.admin.DynamicInterceptor.registerMBean(DynamicInterceptor.java:438)
at org.glassfish.admin.amx.impl.j2ee.loader.AMXJ2EEStartupService.loadAMXMBeans(AMXJ2EEStartupService.java:253)
at org.glassfish.admin.amx.impl.AMXStartupService$AMXLoaderThread.run(AMXStartupService.java:305)
Caused by: java.lang.NoSuchMethodException: no operation findMappingObjectnull in glassfish:pp=/J2EEDomain/J2EEServer/WebModule[jsfastrologer],type=Servlet,name=default,j2eeType=Servlet,J2EEServer=server,WebModule=jsfastrologer,J2EEApplication=null
at org.glassfish.admin.amx.impl.mbean.AMXImplBase.invokeManually(AMXImplBase.java:897)
at org.glassfish.admin.amx.impl.mbean.AMXImplBase.invoke(AMXImplBase.java:874)

The #3 ,makes it hard for us to plugin the Tomcat created MBeans into the AMX subsystem instead of creating a new Mbean .

All these 3 issues have to be considered and an optimal solution found. The time required for this effort makes it impossible to fix in v3.1

Comment by prasads [ 20/Feb/11 ]

Assigning issues to Naman

Comment by Peter Bower [ 13/Mar/13 ]

Object names are part of the public API. Therefore, we can't remove them at this time.

Generated at Wed Jun 03 13:09:56 UTC 2015 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.