Issue Details (XML | Word | Printable)

Key: GLASSFISH-3067
Type: Bug Bug
Status: Open Open
Priority: Minor Minor
Assignee: jluehe
Reporter: llc
Votes: 2
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
glassfish

Could not get Attributes for WebModule MBean

Created: 25/May/07 01:50 PM   Updated: 19/Mar/12 05:39 AM
Component/s: web_container
Affects Version/s: 9.1pe
Fix Version/s: not determined

Time Tracking:
Not Specified

File Attachments: 1. File mbean.war (3 kB) 25/May/07 04:01 PM - jluehe

Environment:

Operating System: All
Platform: All


Issuezilla Id: 3,067
Tags:
Participants: gfbugbridge, guojje, jluehe, llc, sirajg and Tom Mueller


 Description  « Hide

Running the AMX unit test com.sun.enterprise.management.base.GetSetAttributeTest results in the
following failures:

WARNING: Could not get Attributes for "amx:j2eeType=WebModule,name=//__asadmin/
web1,J2EEServer=server,J2EEApplication=null"
DefaultWebXML

WARNING: Could not get Attributes for "amx:j2eeType=WebModule,name=//
server/,J2EEServer=server,J2EEApplication=null"
DefaultWebXML

WARNING: Could not get Attributes for "amx:j2eeType=WebModule,name=//server/__wstx-
services,J2EEServer=server,J2EEApplication=null"
DefaultWebXML
Override

AMX gets these Attributes from the underlying com.sun.appserv MBean. The getting of them seems to
be flaky. When I ran the test again, I see different failures:

WARNING: Could not get Attributes for "amx:j2eeType=WebModule,name=//
server/,J2EEServer=server,J2EEApplication=null"
HasWebServices

WARNING: Attribute HasWebServices failed with class javax.management.AttributeNotFoundException:
HasWebServices

WARNING: Could not get Attributes for "amx:j2eeType=WebModule,name=//server/__wstx-
services,J2EEServer=server,J2EEApplication=null"
HasWebServices

WARNING: Attribute HasWebServices failed with class javax.management.AttributeNotFoundException:
HasWebServices



jluehe added a comment - 25/May/07 02:54 PM

Hi Lloyd, when filing a regression bug, it would help if the exact build number
on which the regression was noticed was included in the bug report.

The only recent change in the JMX area that might be related has been an
incremental fix for:

https://glassfish.dev.java.net/issues/show_bug.cgi?id=2999
("Web app in EAR breaks getChildTargetModuleID")

which added "name" to the list of MBean attributes of a web module, but I don't
see how this could have caused what you are seeing. Also, when accessing a web
module MBean via the HTML adaptor, I still see "hasWebServices", along with the
new "name" attribute, exposed.


llc added a comment - 25/May/07 03:10 PM

It might be that this isuse has existed for some time (many months). That's why I can't say when.

Please note that some of the MBeans have the Attribute, and some do not. So you can't just check one
of them and assume it's OK.


jluehe added a comment - 25/May/07 03:12 PM
      • Issue 3070 has been marked as a duplicate of this issue. ***

jluehe added a comment - 25/May/07 03:57 PM

I've attached a simple WAR whose servlet retrieves all MBeans of type
"j2eeType=WebModule", and then logs (to server.log) the MBean's object name
along with all the MBean's attribute names and values.

Please deploy the WAR and access its servlet at this path: /mbean/MBeanServlet

You will see that for each web module, the "hasWebServices" attribute can be
read successfully and returns the expected value: It returns "false" for all the
system apps except for:

com.sun.appserv:j2eeType=WebModule,name=//server/__wstx-services,J2EEApplication=null,J2EEServer=server|#]

for which it returns "true".

So, I don't think this is a web container issue.

Please assign back to me if you feel differently.


jluehe added a comment - 25/May/07 04:01 PM

Created an attachment (id=936)
Test webapp


gfbugbridge added a comment - 25/May/07 05:01 PM

<BT6562475>


llc added a comment - 29/May/07 04:39 PM

The problem is flaky success (or failure) of the Attributes. AMX just tries to get the Attributes, and they
sporadicaly fail. Yes, I think it's a problem in the com.sun.appserv MBean.

Quite possibly it's a timing issue--some sort of initialization problem. It is most definitely not an AMX
problem, and it most definitely exists.


llc added a comment - 29/May/07 04:49 PM

[First, I don't know if this is a WebModule problem or an 'admin' problem--I just know it's not an AMX
problem.]

I tried jmxcmd (command line interface) directly against the com.sun.appserv:j2eeType=WebModule
MBeans, and the attributes cannot be obtained; see below; nothing is returned:

jmxcmd> find com.sun.appserv:j2eeType=WebModule
com.sun.appserv:j2eeType=WebModule,name=//__asadmin/,J2EEServer=server,J2EEApplication=null
com.sun.appserv:j2eeType=WebModule,name=//__asadmin/
web1,J2EEServer=server,J2EEApplication=null
com.sun.appserv:j2eeType=WebModule,name=//server/,J2EEServer=server,J2EEApplication=null
com.sun.appserv:j2eeType=WebModule,name=//server/
_JWSappclients,J2EEServer=server,J2EEApplication=_JWSappclients
com.sun.appserv:j2eeType=WebModule,name=//server/__wstx-
services,J2EEServer=server,J2EEApplication=null
jmxcmd> get tldScanTime com.sun.appserv:j2eeType=WebModule,*
jmxcmd> get defaultWebXml com.sun.appserv:j2eeType=WebModule,*
jmxcmd>

Here is a stack crawl from the server side showing an example of the failure:

[#|2007-05-29T16:43:22.405-0700|WARNING|sun-appserver9.1|javax.enterprise.system.stream.err|
_ThreadID=21;_ThreadName=RMI TCP Connection(18)192.168.1.5;_RequestID=88ba213a
b009-4816-91fe-cd2b79a161e2;|
javax.management.AttributeNotFoundException: Cannot find attribute tldScanTime get method name
at com.sun.org.apache.commons.modeler.BaseModelMBean.getAttribute(BaseModelMBean.java:
313)
at com.sun.jmx.mbeanserver.DynamicMetaDataImpl.getAttribute(DynamicMetaDataImpl.java:96)
at com.sun.jmx.mbeanserver.MetaDataImpl.getAttribute(MetaDataImpl.java:181)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.getAttribute
(DefaultMBeanServerInterceptor.java:638)
at com.sun.jmx.mbeanserver.JmxMBeanServer.getAttribute(JmxMBeanServer.java:659)
at sun.reflect.GeneratedMethodAccessor17.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.sun.enterprise.admin.util.proxy.ProxyClass.invoke(ProxyClass.java:90)
at $Proxy1.getAttribute(Unknown Source)
at com.sun.enterprise.admin.server.core.jmx.SunoneInterceptor.getAttribute
(SunoneInterceptor.java:317)
at com.sun.enterprise.interceptor.DynamicInterceptor.getAttribute(DynamicInterceptor.java:192)
at com.sun.enterprise.management.support.DelegateToMBeanDelegate.getAttribute
(DelegateToMBeanDelegate.java:122)
at com.sun.enterprise.management.support.MappedDelegate.getAttribute(MappedDelegate.java:
244)
at com.sun.enterprise.management.support.AMXImplBase.delegateGetAttribute(AMXImplBase.java:
828)
at com.sun.enterprise.management.support.AMXImplBase.getAttributeInternal(AMXImplBase.java:
1061)
at com.sun.enterprise.management.support.AMXImplBase.getAttribute(AMXImplBase.java:1020)
at com.sun.enterprise.management.support.AMXImplBase.getAttributes(AMXImplBase.java:1119)
at com.sun.jmx.mbeanserver.DynamicMetaDataImpl.getAttributes(DynamicMetaDataImpl.java:125)
at com.sun.jmx.mbeanserver.MetaDataImpl.getAttributes(MetaDataImpl.java:189)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.getAttributes
(DefaultMBeanServerInterceptor.java:696)
at com.sun.jmx.mbeanserver.JmxMBeanServer.getAttributes(JmxMBeanServer.java:686)
at com.sun.enterprise.interceptor.DynamicInterceptor.getAttributes(DynamicInterceptor.java:232)
at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1389)
at javax.management.remote.rmi.RMIConnectionImpl.access$100(RMIConnectionImpl.java:81)
at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run
(RMIConnectionImpl.java:1245)
at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation
(RMIConnectionImpl.java:1341)
at javax.management.remote.rmi.RMIConnectionImpl.getAttributes(RMIConnectionImpl.java:633)
at sun.reflect.GeneratedMethodAccessor286.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
at sun.rmi.transport.Transport$1.run(Transport.java:153)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:466)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:707)
at java.lang.Thread.run(Thread.java:613)


jluehe added a comment - 31/May/07 02:31 PM
      • Issue 3074 has been marked as a duplicate of this issue. ***

jluehe added a comment - 01/Jun/07 04:16 PM

Hmm, this seems to be working for me:

jmxcmd> connect --protocol sun-as-rmi --port 8686 --user admin --password-file
/home/luehe/pwd local-rmi
Established connection to local-rmi using sun-as-rmi
Connection local-rmi
(USER=admin,PASSWORD_FILE=/home/luehe/pwd,PASSWORD=adminadmin,PROTOCOL=sun-as-rmi,cache-mbean-info=false,HOST=localhost,PORT=8686)
is now the active connection

jmxcmd> find com.sun.appserv:j2eeType=WebModule
com.sun.appserv:j2eeType=WebModule,name=//__asadmin/,J2EEServer=server,J2EEApplication=null
com.sun.appserv:j2eeType=WebModule,name=//__asadmin/web1,J2EEServer=server,J2EEApplication=null
com.sun.appserv:j2eeType=WebModule,name=//server/,J2EEServer=server,J2EEApplication=null
com.sun.appserv:j2eeType=WebModule,name=//server/_JWSappclients,J2EEServer=server,J2EEApplication=_JWSappclients
com.sun.appserv:j2eeType=WebModule,name=//server/__wstx-services,J2EEServer=server,J2EEApplication=null

jmxcmd> get tldScanTime com.sun.appserv:j2eeType=WebModule,*
--com.sun.appserv:j2eeType=WebModule,name=//__asadmin/web1,J2EEApplication=null,J2EEServer=server--
tldScanTime=6

--com.sun.appserv:j2eeType=WebModule,name=//server/__wstx-services,J2EEApplication=null,J2EEServer=server--
tldScanTime=2

--com.sun.appserv:j2eeType=WebModule,name=//server/,J2EEApplication=null,J2EEServer=server--
tldScanTime=1

--com.sun.appserv:j2eeType=WebModule,name=//server/_JWSappclients,J2EEApplication=_JWSappclients,J2EEServer=server--
tldScanTime=1

--com.sun.appserv:j2eeType=WebModule,name=//__asadmin/,J2EEApplication=null,J2EEServer=server--
tldScanTime=670

jmxcmd> get hasWebServices com.sun.appserv:j2eeType=WebModule,*
--com.sun.appserv:j2eeType=WebModule,name=//__asadmin/web1,J2EEApplication=null,J2EEServer=server--
hasWebServices=false

--com.sun.appserv:j2eeType=WebModule,name=//server/__wstx-services,J2EEApplication=null,J2EEServer=server--
hasWebServices=true

--com.sun.appserv:j2eeType=WebModule,name=//server/,J2EEApplication=null,J2EEServer=server--
hasWebServices=false

--com.sun.appserv:j2eeType=WebModule,name=//server/_JWSappclients,J2EEApplication=_JWSappclients,J2EEServer=server--
hasWebServices=false

--com.sun.appserv:j2eeType=WebModule,name=//__asadmin/,J2EEApplication=null,J2EEServer=server--
hasWebServices=false


llc added a comment - 01/Jun/07 04:17 PM

It works for me too, on a dual core machine. On quad core it fails.


jluehe added a comment - 04/Jun/07 08:26 AM

This does not seem to be a regression after all. Therefore, removing
"regression" from issue summary.

Per llc:

It's a very strange bug--different Attributes fail at different times on my
quad-core machine. The dual core seems not to fail.

Downgrading to a P4.


jluehe added a comment - 05/Jun/07 08:13 AM

Changing Summary line, since this is not a regression


sirajg added a comment - 06/Jun/07 08:33 AM
      • Issue 3073 has been marked as a duplicate of this issue. ***

kenaiadmin made changes - 25/Nov/10 11:52 PM
Field Original Value New Value
issue.field.bugzillaimportkey 3067 34671
Tom Mueller added a comment - 06/Mar/12 09:55 PM

Bulk update to change fix version to "not determined" for all issues still open but with a fix version for a released version.


Tom Mueller made changes - 06/Mar/12 09:55 PM
Fix Version/s not determined [ 11149 ]
Fix Version/s 9.1pe [ 10974 ]
guojje added a comment - 16/Mar/12 03:13 AM

it is absolutely a issues, how soon will it be fixed?


guojje added a comment - 19/Mar/12 05:39 AM

I have fixed it. it is a thread safe issues.

In class ManageMbean of commons-modeler project, the method createMbeanInfo does not aquire lock when it accessed the fields
(contains attributes,notification and so on).

so it is necessary to add syschronized(attributes) when access attributes.