Page 1 of 3 123 LastLast
Results 1 to 10 of 27

Thread: AMS not detecting exported beans

  1. #1

    Default AMS not detecting exported beans

    I'm trying to setup AMS to monitor our application. I've followed all the steps of the tutorials and AMS auto-discovers the application along with the Spring Application Context and the Spring Bean Factory.

    However, any beans that I've set with the @ManagedResource attribute/@ManagedMetric attribute doesn't show up on the list.

    Now when I connect via JConsole and goto the MBeans tab, I see that the ApplicationContext and BeanFactory show up under spring.application and all the classes that I've marked with @ManagedResource show up under the fully qualified package name.

    Any help to point me in the right direction would be greatly appreciated.

    Thanks.

  2. #2

    Default

    Does that mean that the @ManagedResources you are exporting do not have the domain "spring.application" in their ObjectNames? They must have that domain in order to be auto-discovered by AMS. In the future, we will be removing this restriction in favor of (most likely) a recognized key property value.

    Thanks,
    Jennifer

  3. #3

    Default

    Hello Jen,
    Thanks for the reply. It would also be great if you could add this to the documentation.

    I have changed the domain name of the @ManagedResource as follows:

    @ManagedResource(objectName="spring.application:na me=MarketDataManager",description = "Market Data Manager")

    and I still am unable to get AMS to auto-discover the bean. In fact, the auto-discovery of the Spring Application seems flaky.

    Thanks.

  4. #4

    Default

    Hello,
    The "source-level metadata type" section of https://www.covalent.net/resource/do...ith%20AMS.html (this file is also available in the doc directory of your AMS server) covers the expected format of the ObjectName. Looks like you are missing the "type" key property.

    Also, what are you doing to trigger auto-discovery of your new MBeans? By default, AMS auto-discovers servers every 15 minutes, but new services within an existing server (such as ApplicationContext, BeanFactory, etc) are only auto-discovered once every 24 hours. You can change this interval in AMS_HOME/agent-2.0.0.RC1/agent.properties autoinventory.runtimeScan.interval.millis property. However, if you're still in the evaluation phase, the quickest way to trigger auto-discovery of services is to restart the agent.

  5. #5

    Default

    Hello,
    After reading the docs and this thread, I've been attempting to use SpringSource AMS v2.0.0.rc1 to manage a managed resource bean exported, via jmx, from a bundle in SpringSource dm server v1.0.1.RELEASE. I'm not entirely certain of the service type I'm looking for, but I can't find anything even close to my service. The annotation I'm using for my exported bean is as follows:

    @ManagedResource(objectName = "spring.application:type=KeyGenerator,name=Armadil lo Key Generator",description="Generates keys")

    and it shows up in JConsole under:

    spring.application/KeyGenerator/Armadillo Key Generator

    I've tried restarting the agent. Is there anything else I need to do? Do I need to write a plugin?

    Thank you.

  6. #6

    Default

    That should be enough to get your service discovered. I assume the agent has auto-discovered the dm Server, but your service just does not show up under the server's resource listing (it's a common misconception that new services will show up in the Auto-Discovery portlet - just want to make sure you are not expecting to see it there).

    Can you post your agent.log (from AMS_HOME/agent.../logs)? Also, how are you using the bundle in dm Server (part of a PAR, shared services WAR, etc)? Lastly, does your MBean have any @ManagedAttributes, @ManagedOperations, or @ManagedMetrics?

  7. #7

    Default

    I was thinking the auto-discovery portlet might be for just for new platforms. I've been checking the Resources > Browse page to check the services.

    The bundle I'm using is solely for evaluating AMS, and is independently deployed via the Tool Suite. My KeyGenerator does have one of each @ManagedAttribute, @ManagedOperations, and @ManagedMetrics.

    The attached agent.log file is the logged output from the following: started agent; started dm server; stopped agent; started agent again to force discovery.

    Thank you very much.
    Attached Files Attached Files

  8. #8

    Default

    Sorry, forgot to mention two things. I am seeing the dm server and a dispatcherServlet for my bundle as a service. Also, in my bundle's trace file, during initialization, I get the following a couple times:

    Code:
    [2009-03-18 09:44:22.876] async-delivery-thread-1  e.management.agent.discovery.domain.DefaultDomainManager.unknown W Unable to discover the domain associated with ApplicationContext: ServerOsgiBundleXmlWebApplicationContext(bundle=com.spintop.cart.gui.images.redirector, config=osgibundle:/META-INF/spring/*.xml).  The application context and all of its beans will not be exported to the management model.

  9. #9

    Default

    Seems like you've got 2 issues here:
    1. Since you are using dm Server and not dm Server Enterprise Edition, the instrumented jars are only able to export MBeans for Spring beans created by WebApplicationContexts. dm Server EE publishes additional information that allows the instrumented jars to publish MBeans based on bundle lifecycle. This explains why you are missing some MBeans, and explains the message you are seeing in your bundle's trace file. You can download an evaluation copy of dm Server Enterprise Edition from springsource.com. However, it bundles AMS 1.0.6 by default (which does not allow you to export your own components to the mgmt model using the Spring JMX annotations). You will likely encounter issues attempting to use both versions of the instrumented jars (1.0.6 and 2.0.0RC1) in dm Server EE. We are currently working to provide support for bundles using AMS 2.x in dm Server. Of course, deploying a WAR that uses AMS 2.x in dm Server should work fine.
    2. The MBean you do have created (which I presume came from a WebAppContext) is not being displayed in the AMS dashboard. I didn't see anything odd in your agent.log. Can you attach the AMS_HOME/server.../logs/server.log as well?

    Thanks.

  10. #10

    Default

    Attached is my server.log file.
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •