admin@glassfish.java.net

Re: ApplicationConfig AMX Mbean

From: Lloyd L Chambers <Lloyd.Chambers_at_Sun.COM>
Date: Fri, 21 Mar 2008 10:38:43 -0700

Hong,

I don't think any further changes are needed to Application[Config].

I'm going to talk with Kedar today: my inclination is to make an
incompatible change and change the Libraries mixin interface to String
instead of String[].

Lloyd

On Mar 21, 2008, at 7:15 AM, Hong Zhang wrote:

> Anissa: please find the current definition of the application
> element in https://glassfish.dev.java.net/issues/show_bug.cgi?id=4413
> Lloyd: let me know if I need to change anything in Application
> config bean or ApplicationConfig amx bean. ApplicationConfig extends
> from ModuleConfig which extends from Description, so it should be
> able to handle description properly.
>
> Thanks,
>
> - Hong
>
> Lloyd L Chambers wrote:
>> Anissa,
>>
>> The HTMLAdapter is apparently not liking 'null', which is a valid
>> value. The API is working, it's just that the value is null and
>> the adapter apparently apparently can't handle that.
>>
>> In your code you should not have a problem getting or setting, as
>> evidenced by jmxmcd being able to do both.
>>
>> As far as the AMX MBean not showing up, this might be fixed now.
>> Or else AMX is not being called (not sure yet)
>>
>> Lloyd
>>
>> On Mar 20, 2008, at 7:03 PM, Anissa Lam wrote:
>>>
>>> So, do you see this 2 problems ?
>>>
>>> - The AMX Mbean will not show up after deployment. You have to
>>> restart the server. (I did amx-list and don't see the beans)
>>>
>>> - getDescription() throws AttributeNotFoundException.
>>> (I attach a screenshot. It shows the exception which is
>>> exactly what i am seeing in my code).
>>>
>>> thanks.
>>> Anissa
>>>
>>> Lloyd L Chambers wrote:
>>>>
>>>> Anissa,
>>>>
>>>> I deployed the app and it works OK except for "Libraries", which
>>>> is a String[]. Arrays aren't yet mapped to the underlying
>>>> ConfigBeans List<String>; this requires some special handling.
>>>>
>>>> The AvailabilityEnabled and Description attributes work just fine
>>>> thought--but they start out as 'null'.
>>>>
>>>>
>>>> jmxcmd> get *
>>>> ---amx:j2eeType=X-ApplicationConfig,name=hello1---
>>>> AttributeNames={AttributeNames,MBeanInfoIsInvariant,PropertyConfigObjectNameMap,WebServiceEndpointConfigObjectNameMap,ObjectName,Group,MBeanLogLevel,J2EEType,ContextRoot,InterfaceName,Description,Libraries,Enabled,MBeanLoggerName,ContaineeJ2EETypes,DAS,Name,DirectoryDeployed,ObjectType,DomainRootObjectName,NotificationInfo,FullType,AvailabilityEnabled,PropertyNames,ContainerObjectName,Location,EngineConfigObjectNameMap,Properties,ContaineeObjectNameSet}
>>>> AvailabilityEnabled=<null>
>>>> ContaineeJ2EETypes=X-PropertyConfig
>>>> ContaineeObjectNameSet=
>>>> ContainerObjectName=amx:j2eeType=X-DomainConfig,name=na
>>>> ContextRoot=/hello1
>>>> DAS=true
>>>> Description=<null>
>>>> DirectoryDeployed=false
>>>> DomainRootObjectName=amx:j2eeType=X-DomainRoot,name=amx
>>>> Enabled=true
>>>> EngineConfigObjectNameMap={}
>>>> FullType=X-DomainConfig.X-ApplicationConfig
>>>> Group=configuration
>>>> InterfaceName=com.sun.appserv.management.config.ApplicationConfig
>>>> J2EEType=X-ApplicationConfig
>>>> Libraries=<null>
>>>> Location=file:/v3/run/domains/domain1/applications/hello1/
>>>> MBeanInfoIsInvariant=true
>>>> MBeanLogLevel=INFO
>>>> MBeanLoggerName=MBeans
>>>> Name=hello1
>>>> NotificationInfo
>>>> =
>>>> {javax
>>>> .management.AttributeChangeNotification:jmx.attribute.change,""}
>>>> ObjectName=amx:j2eeType=X-ApplicationConfig,name=hello1
>>>> ObjectType=user
>>>> Properties={}
>>>> PropertyConfigObjectNameMap={}
>>>> PropertyNames={}
>>>> WebServiceEndpointConfigObjectNameMap={}
>>>>
>>>> jmxcmd> set AvailabilityEnabled=false
>>>> ---amx:j2eeType=X-ApplicationConfig,name=hello1---
>>>> AvailabilityEnabled=false
>>>> jmxcmd> set Libraries=""
>>>> ---amx:j2eeType=X-ApplicationConfig,name=hello1---
>>>> <no attributes found>
>>>> jmxcmd> set Libraries=/v3/test
>>>> ---amx:j2eeType=X-ApplicationConfig,name=hello1---
>>>> <no attributes found>
>>>> jmxcmd> get Libraries
>>>> ---amx:j2eeType=X-ApplicationConfig,name=hello1---
>>>> Libraries=<null>
>>>>
>>>> jmxcmd> set Description="Hello world test app"
>>>> ---amx:j2eeType=X-ApplicationConfig,name=hello1---
>>>> Description=Hello world test app
>>>>
>>>>
>>>>
>>>>
>>>> Lloyd
>>>>
>>>> On Mar 20, 2008, at 5:06 PM, Anissa Lam wrote:
>>>>> Hi Lloyd,
>>>>>
>>>>> Attached is the hello1.war.
>>>>> Just do 'asadmin deploy hello1.war'. you can access it by
>>>>> going to http://localhost:8080/hello1/index.jsp
>>>>>
>>>>> You should get the following 2 Beans AFTER server restart.
>>>>> amx:j2eeType=X-DeployedItemRefConfig,name=hello1,X-
>>>>> StandaloneServerConfig=server
>>>>> amx:j2eeType=X-ApplicationConfig,name=hello1
>>>>>
>>>>> Thats true, even though you can run the app, the beans won't
>>>>> show up unless you restart server. Same with undeploy.
>>>>>
>>>>> While you are looking at it, can you see why for the X-
>>>>> DeployedItemRefConfig bean, get/set VirtualServer attribute
>>>>> throws an exception ?
>>>>> I need the VS to help me get the port to construct the URL for
>>>>> launching the app.
>>>>>
>>>>> thanks
>>>>> Anissa
>>>>>
>>>>>
>>>>> Lloyd L Chambers wrote:
>>>>>>
>>>>>> Anissa,
>>>>>>
>>>>>> I'll look into it. What do I have to do to get an
>>>>>> <application>, just deploy an app? (Please send one if you
>>>>>> have one handy).
>>>>>>
>>>>>> Lloyd
>>>>>>
>>>>>> On Mar 20, 2008, at 4:30 PM, Anissa Lam wrote:
>>>>>>>
>>>>>>> Hi,
>>>>>>> I don't know exactly what should be in <application> since
>>>>>>> there is no dtd to refer to, but these 3 attributes are in
>>>>>>> V2's <web-module>
>>>>>>> - description
>>>>>>> - libraries
>>>>>>> - availabilityEnabled
>>>>>>>
>>>>>>> All of this shows up as attributes in ApplicationConfig, but
>>>>>>> when you try to get it, you will get
>>>>>>> javax.management.AttributeNotFoundException.
>>>>>>> I think we should fix it so that the attribute won't show up
>>>>>>> or return "" if it is not supported yet. Maybe libraries
>>>>>>> and availabilityEnabled is in this category.
>>>>>>>
>>>>>>> However, i think description should be fixed so that it
>>>>>>> really returns 'description' as whatever the uesr enters
>>>>>>> during deployment.
>>>>>>>
>>>>>>> thanks
>>>>>>> Anissa
>>>>>>>
>>>>>>
>>>>>> ---
>>>>>> Lloyd L Chambers
>>>>>> lloyd.chambers_at_sun.com
>>>>>> Sun Microsystems, Inc
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>> <hello1.war>
>>>>
>>>> ---
>>>> Lloyd L Chambers
>>>> lloyd.chambers_at_sun.com
>>>> Sun Microsystems, Inc
>>>>
>>>>
>>>>
>>>
>>> <appconfig.jpg>
>>
>> ---
>> Lloyd L Chambers
>> lloyd.chambers_at_sun.com
>> Sun Microsystems, Inc
>>
>>
>>
>

---
Lloyd L Chambers
lloyd.chambers_at_sun.com
Sun Microsystems, Inc