1 2 Previous Next 23 Replies Latest reply on Sep 21, 2010 5:26 AM by deruelle_jean Go to original post
      • 15. Re: ManagedObjects for MBeans
        starksm64

         

        "jason.greene@jboss.com" wrote:
        Another issue that needs to be solved is association of a WAR deployment managed object to a tomcat Manager JMX entry. One possible way to correlate is to use the docBase property on the JSR-77 WebModule object.

        Even better would be a way to set the context root on the ManagedDeployment of the WAR.

        Is there an easy way for the AbstractWarDeployer to add a new ManagedProperty to the ManagedDeployment?

        ManagedDeployment properties are just the flattened view of all ManagedObject properties associated with the deployment. Where are you looking to use this?

        I'm still going over your changes.


        • 16. Re: ManagedObjects for MBeans
          jason.greene

           

          "scott.stark@jboss.org" wrote:

          Where are you looking to use this?


          The console guys need a way to associate the ManagedDeployment of the WAR with the corresponding tomcat components. Currently, I recommended they use the docBase value on the WebModule jmx object, mapping that to the name of WAR deployment after stripping the url protocol portion.

          • 17. Re: ManagedObjects for MBeans
            jason.greene

            For background, here is the mapping info I sent to the jopr team.

            The component mappings are:

            MBean, WebApplicationManager = Tomcat Session Manger
            MBean, Servlet = Servlet metrics
            MBean, WebApplication = Tomcat Deployment Info

            The WebApplication and Servlet components are underneath a
            ManagedDeployment with the name that is a combination of the host and
            the context root.

            The WebApplicationManager components are underneath a ManagedDeployment
            with the same name as the context root.

            To correlate these all together you should be able to strip the host
            portion of the deployment name (so the first "//[^/]*/" portion, in this
            case //localhost/)

            To match to the deployment you should be able to match the docBase
            property of the WebApplication component to the deployment name, by
            stripping the URL protocol.

            For example:

            war deployment name =
            vfsfile:/Users/jason/devel/jbossas/branches/Branch_5_x/build/output/jboss-5.1.0.GA/server/default/deploy/jmx-console.war/

            WebApplication.docBase =
            /Users/jason/devel/jbossas/branches/Branch_5_x/build/output/jboss-5.1.0.GA/server/default/deploy/jmx-console.war/

            Here is what the tomcat MBean component tree looks like for jmx console:

            ManagedDeployment: //localhost/jmx-console
            ManagedComponent:
            name=jboss.web:J2EEApplication=none,J2EEServer=none,
            j2eeType=WebModule,name=//localhost/jmx-console
            type=MBean, WebApplication
            ManagedComponent
            name=jboss.web:J2EEApplication=none,J2EEServer=none,
            WebModule=//localhost/jmx-console,j2eeType=Servlet,
            name=HtmlAdaptor
            type=MBean, Servlet
            ...

            ManagedDeployment: /jmx-console
            ManagedComponent(
            name=jboss.web:host=localhost,path=/jmx-console,type=Manager,
            type=MBean, WebApplicationManager

            • 18. Re: ManagedObjects for MBeans
              starksm64

              I have expanded the ProxyManagedDeploymentFactory to support multiple mbeans under a single MBeanDeployment so that a single ManagedDeployment results. Now all three of the war related mbean types are found under a single ManagedDeployment, for example, the jmx-console has the following ProfileServiceDebugServlet view:

              ManagedDeployment: //localhost/jmx-console
              +++ ManagedComponent(name=jboss.web:host=localhost,path=/jmx-console,type=Manager, type=(ComponentType{type=MBean, subtype=WebApplicationManager}), compName=jboss.web:host=localhost,path=/jmx-console,type=Manager, attachment: null
              ++++++ properties: [sessionIdLength, maxInactiveInterval, expiredSessions, entropy, sessionCounter, maxActiveSessions, className, processingTime, algorithm, processExpiresFrequency, rejectedSessions, sessionAverageAliveTime, randomFile, modelerType, duplicates, pathname, sessionMaxAliveTime, activeSessions, name, maxActive, distributable]
              +++ ManagedComponent(name=jboss.web:J2EEApplication=none,J2EEServer=none,j2eeType=WebModule,name=//localhost/jmx-console, type=(ComponentType{type=MBean, subtype=WebApplication}), compName=jboss.web:J2EEApplication=none,J2EEServer=none,j2eeType=WebModule,name=//localhost/jmx-console, attachment: null
              ++++++ properties: [privileged, compilerClasspath, crossContext, swallowOutput, antiResourceLocking, caseSensitive, cookies, workDir, loader, unloadDelay, path, managedResource, objectName, servlets, tldScanTime, realm, namingContextListener, configFile, modelerType, saveConfig, stateManageable, state, eventProvider, cacheTTL, cachingAllowed, cacheObjectMaxSize, startupTime, statisticsProvider, javaVMs, manager, staticResources, override, docBase, defaultContextXml, server, startTime, defaultWebXml, deploymentDescriptor, mappingObject, parentClassLoader, processingTime, useNaming, delegate, antiJARLocking, valveObjectNames, cacheMaxSize, logger, engineName, allowLinking, children, reloadable, welcomeFiles]
              +++ ManagedComponent(name=jboss.web:J2EEApplication=none,J2EEServer=none,WebModule=//localhost/jmx-console,j2eeType=Servlet,name=DisplayOpResult, type=(ComponentType{type=MBean, subtype=Servlet}), compName=jboss.web:J2EEApplication=none,J2EEServer=none,WebModule=//localhost/jmx-console,j2eeType=Servlet,name=DisplayOpResult, attachment: null
              ++++++ properties: [objectName, minTime, statisticsProvider, loadTime, classLoadTime, processingTime, requestCount, modelerType, errorCount, stateManageable, eventProvider, engineName, maxTime]
              +++ ManagedComponent(name=jboss.web:J2EEApplication=none,J2EEServer=none,WebModule=//localhost/jmx-console,j2eeType=Servlet,name=jsp, type=(ComponentType{type=MBean, subtype=Servlet}), compName=jboss.web:J2EEApplication=none,J2EEServer=none,WebModule=//localhost/jmx-console,j2eeType=Servlet,name=jsp, attachment: null
              ++++++ properties: [objectName, minTime, statisticsProvider, loadTime, classLoadTime, processingTime, requestCount, modelerType, errorCount, stateManageable, eventProvider, engineName, maxTime]
              +++ ManagedComponent(name=jboss.web:J2EEApplication=none,J2EEServer=none,WebModule=//localhost/jmx-console,j2eeType=Servlet,name=ProfileServiceDebugServlet, type=(ComponentType{type=MBean, subtype=Servlet}), compName=jboss.web:J2EEApplication=none,J2EEServer=none,WebModule=//localhost/jmx-console,j2eeType=Servlet,name=ProfileServiceDebugServlet, attachment: null
              ++++++ properties: [objectName, minTime, statisticsProvider, loadTime, classLoadTime, processingTime, requestCount, modelerType, errorCount, stateManageable, eventProvider, engineName, maxTime]
              +++ ManagedComponent(name=jboss.web:J2EEApplication=none,J2EEServer=none,WebModule=//localhost/jmx-console,j2eeType=Servlet,name=default, type=(ComponentType{type=MBean, subtype=Servlet}), compName=jboss.web:J2EEApplication=none,J2EEServer=none,WebModule=//localhost/jmx-console,j2eeType=Servlet,name=default, attachment: null
              ++++++ properties: [objectName, minTime, statisticsProvider, loadTime, classLoadTime, processingTime, requestCount, modelerType, errorCount, stateManageable, eventProvider, engineName, maxTime]
              +++ ManagedComponent(name=jboss.web:J2EEApplication=none,J2EEServer=none,WebModule=//localhost/jmx-console,j2eeType=Servlet,name=DisplayMBeans, type=(ComponentType{type=MBean, subtype=Servlet}), compName=jboss.web:J2EEApplication=none,J2EEServer=none,WebModule=//localhost/jmx-console,j2eeType=Servlet,name=DisplayMBeans, attachment: null
              ++++++ properties: [objectName, minTime, statisticsProvider, loadTime, classLoadTime, processingTime, requestCount, modelerType, errorCount, stateManageable, eventProvider, engineName, maxTime]
              +++ ManagedComponent(name=jboss.web:J2EEApplication=none,J2EEServer=none,WebModule=//localhost/jmx-console,j2eeType=Servlet,name=InspectMBean, type=(ComponentType{type=MBean, subtype=Servlet}), compName=jboss.web:J2EEApplication=none,J2EEServer=none,WebModule=//localhost/jmx-console,j2eeType=Servlet,name=InspectMBean, attachment: null
              ++++++ properties: [objectName, minTime, statisticsProvider, loadTime, classLoadTime, processingTime, requestCount, modelerType, errorCount, stateManageable, eventProvider, engineName, maxTime]
              +++ ManagedComponent(name=jboss.web:J2EEApplication=none,J2EEServer=none,WebModule=//localhost/jmx-console,j2eeType=Servlet,name=ClusterView, type=(ComponentType{type=MBean, subtype=Servlet}), compName=jboss.web:J2EEApplication=none,J2EEServer=none,WebModule=//localhost/jmx-console,j2eeType=Servlet,name=ClusterView, attachment: null
              ++++++ properties: [objectName, minTime, statisticsProvider, loadTime, classLoadTime, processingTime, requestCount, modelerType, errorCount, stateManageable, eventProvider, engineName, maxTime]
              +++ ManagedComponent(name=jboss.web:J2EEApplication=none,J2EEServer=none,WebModule=//localhost/jmx-console,j2eeType=Servlet,name=ClusteredConsoleServlet, type=(ComponentType{type=MBean, subtype=Servlet}), compName=jboss.web:J2EEApplication=none,J2EEServer=none,WebModule=//localhost/jmx-console,j2eeType=Servlet,name=ClusteredConsoleServlet, attachment: null
              ++++++ properties: [objectName, minTime, statisticsProvider, loadTime, classLoadTime, processingTime, requestCount, modelerType, errorCount, stateManageable, eventProvider, engineName, maxTime]
              +++ ManagedComponent(name=jboss.web:J2EEApplication=none,J2EEServer=none,WebModule=//localhost/jmx-console,j2eeType=Servlet,name=HtmlAdaptor, type=(ComponentType{type=MBean, subtype=Servlet}), compName=jboss.web:J2EEApplication=none,J2EEServer=none,WebModule=//localhost/jmx-console,j2eeType=Servlet,name=HtmlAdaptor, attachment: null
              ++++++ properties: [objectName, minTime, statisticsProvider, loadTime, classLoadTime, processingTime, requestCount, modelerType, errorCount, stateManageable, eventProvider, engineName, maxTime]
              


              This is based on a single ProxyManagedDeploymentFactory in the profileservice-jboss-beans.xml that combines the three types of mbeans:

               <bean name="WarManagedDeploymentFactory"
               class="org.jboss.profileservice.management.ProxyManagedDeploymentFactory">
               <property name="factoryName">War</property>
              
               <property name="defaultViewUse">STATISTIC</property>
               <property name="rootMOPatterns">
               <set elementClass="org.jboss.profileservice.management.ProxyDeploymentInfo">
               <!-- Manager -->
               <bean class="org.jboss.profileservice.management.ProxyDeploymentInfo">
               <property name="compType">MBean</property>
               <property name="compSubtype">WebApplicationManager</property>
               <property name="pattern">jboss.web:host=localhost,type=Manager,*</property>
               <property name="nameBuilder">
               <inject bean="WarManagerMBeanDeploymentNameBuilder"/>
               </property>
               </bean>
               <!-- WebModule -->
               <bean class="org.jboss.profileservice.management.ProxyDeploymentInfo">
               <property name="compType">MBean</property>
               <property name="compSubtype">WebApplication</property>
               <property name="pattern">jboss.web:J2EEApplication=none,J2EEServer=none,j2eeType=WebModule,*</property>
               <property name="nameBuilder">
               <inject bean="SimpleMBeanDeploymentNameBuilder"/>
               </property>
               <property name="componentInfo">
               <map keyClass="java.lang.String" valueClass="java.lang.String">
               <!-- Process the servlets components -->
               <entry>
               <key>servlets</key>
               <value>MBean:Servlet</value>
               </entry>
               </map>
               </property>
               </bean>
               </set>
               </property>
               </bean>
              



              • 19. Re: ManagedObjects for MBeans
                jason.greene

                I have updated the WAR deployer to include a ContextMO object which contains the context-root of the deployment. This is can now be used as a more reliable way to map to these JMX mbeans:

                ManagedDeployment: vfsfile:/devel/jbossas/branches/Branch_5_x/build/output/jboss-5.1.0.GA/server/default/deploy/jmx-console.war/
                +++ ManagedComponent(name=ContextMO, type=(ComponentType{type=WAR, subtype=Context}), compName=null, attachment: org.jboss.web.deployers.AbstractWarDeployer$ContextMO
                ++++++ properties: [contextRoot = /jmx-console]
                




                • 20. Re: ManagedObjects for MBeans
                  pilhuhn

                  I don't think this is enough as a context root can live under different vhosts - and tomcat is emitting statistics for each vhost separately -- and users want this information.

                  • 21. Re: ManagedObjects for MBeans
                    deruelle_jean

                    Can you tell me how and when this ContextMO is added ? I tried in debug mode and it seems AbstractWarDeployer.build isn't called in my case on AS 5.1

                    • 22. Re: ManagedObjects for MBeans
                      emuckenhuber

                      ManagedObjects are only getting processed when the ManagementView is loaded. Which triggers MainDeployer.getManagedDeployment which builds all the managed objects.

                      • 23. Re: ManagedObjects for MBeans
                        deruelle_jean

                        OK thanks !

                        1 2 Previous Next