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.
Announcement
Announcement Module
Collapse
No announcement yet.
AMS not detecting exported beans
Page Title Module
Move
Remove
Collapse
X
-
AMS not detecting exported beans
Tags: None
-
Okay so that's your own custom implementation then. Is there a jira logged for the bug yet?
Regards
Leave a comment:
-
We have implemented an osgi fragment for the com.springsource.management.adapter.jmx bundle. This fragment uses custom BeanFactoryPostProcessor that replaces jmxManagedResourceExporter in the context of the bundle with the ours exporter. Out exporter overrides managedResourceAdded method replacing the first paramter of type ManagedResourceName with the new one that can uniquely identify managed resource of the certain type (class).
Leave a comment:
-
Spring DM EE contains instrumented version of spring jars, so you don't need to replace ones.
So what are those specific bundles for which we will need the patches? Are these patches only available with the enterprise version?
Leave a comment:
-
Thanks for this useful information. So we cannot have these metrics exported with the dm server that I am using..okay..but I am not sure if the dm-server-1.0.2.SR02 that I am using is community or an evaluation version of the enterprise version. Any clue on that please?
spring dm server enterprise edition has a bug, that does not allow to export performance metrics correctly without patching internal spring dm server bundles.
Leave a comment:
-
Have you seen this link? You are trying to have metrics for your custom component, so you are responsible for creating metrics you are going to see.
To be able to have performance metrics automatically you have to use stereotype annotations i.e. @Service, @Component, @Controller, etc., but as I mentioned we were unable to make spring dm server community edition export such metrics, and the 1.0.2 version of spring dm server enterprise edition has a bug, that does not allow to export performance metrics correctly without patching internal spring dm server bundles.
Leave a comment:
-
Hi
I have another doubt if you could please help.
If you see my code, I am having a processMessages method that is annotated for monitoring. It is just a listener i.e. an onMessage() . I am able to see this in my Control Actions in AMS, but I am not sure how to monitor it.
Once I deploy my MDP in dmserver, it will continuosly listen to the queue. This is working fine. If I monitor this method what all things can I expect AMS to give to me and how can I configure AMS to give me all that for this method?
thanks
Leave a comment:
-
Hi
Thanks a lot. With the suggested settings I was able to get the things in AMS. Could you please suggest the settings for the ActiveMQ as well? Now that I am able to monitor my MDP, what needs to be done to get the ActiveMQ as well?
Thanks
Leave a comment:
-
Unfortunately we were unable to have custom components deployed into a community version of spring dm server with replaced jars to be detected by means of ams.
You can try to
1. add system property -Dspring.managed.application.name=MyApp as startup parameter of the spring dm server
or
2. modify springsource-dm-server-plugin.jar in both ams server and ams agent changing springsource-dm-server-plugin.jar\etc\hq-plugin.xml. You have to add
Code:<property name="template" value="${OBJECT_NAME}:${alias}" />
Code:<filter name="template" value="${OBJECT_NAME}:${alias}" />
Leave a comment:
-
Hi
I have a similar problem. I have a queue listener (using DMLC) that is listening to an ActiveMQ(actually FuseMQ 5.3.0.4). Please suggest how can I get my bundle detected by AMS.
I am using AMS 2.0, community version and dm-server-1.0.2.SR02 (this one comes with the STS installer itself). I have replaced all the bundles with their instrumented versions in the dm-server-1.0.2.SR02\repository\bundles\ext folder. Is that all that we need to or am I missing anything? Below is my code for clarity:
Spring config file:
Code:<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schem...-beans-2.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd"> <bean id="connectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory"> <property name="brokerURL"> <value>tcp://localhost:61616</value> </property> </bean> <!-- JMX --> <context:mbean-export /> <bean id="testq" class="org.apache.activemq.command.ActiveMQQueue"> <constructor-arg index="0" value="testq" /> </bean> <bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate"> <property name="connectionFactory" ref="connectionFactory"/> </bean> <bean class="org.springframework.jms.listener.DefaultMessageListenerContainer"> <property name="connectionFactory" ref="connectionFactory" /> <property name="destination" ref="testq" /> <property name="messageListener" ref="purePojoMdp" /> <property name="concurrentConsumers" value="5" /> <property name="maxConcurrentConsumers" value="15" /> </bean> <bean id="receiver" class="JMSReceiver" /> <bean id="purePojoMdp" class="org.springframework.jms.listener.adapter.MessageListenerAdapter"> <property name="delegate" ref="receiver" /> <property name="defaultListenerMethod" value="processMessages" /> </bean> </beans>
Code:import java.util.HashMap; import org.springframework.jmx.export.annotation.ManagedOperation; import org.springframework.jmx.export.annotation.ManagedResource; import com.springsource.management.adapter.jmx.ManagedMetric; import com.springsource.management.agent.inventory.resource.metric.MetricCategory; import com.springsource.management.agent.inventory.resource.metric.MetricType; @ManagedResource(objectName = "spring.application:application=ams.test,type=MessageListener,name=JMSListener") public class JMSReceiver { public JMSReceiver() {} @ManagedOperation public void processMessages(HashMap message) { try { String name = (String)message.get("name"); Thread.sleep(7500); System.out.println("Received Message:" + name); } catch(Exception e) { e.printStackTrace(); } } }
Code:Manifest-Version: 1.0 Bundle-Version: 1.0.0 Tool: Bundlor 1.0.0.BUILD-20090616142719 Bundle-Name: ReceiverBundle Bundle-ManifestVersion: 2 Import-Package: com.springsource.management.adapter.jmx,org.apache.act ivemq,org.apache.activemq.command,org.springframework.jms.core,org.sp ringframework.jms.listener,org.springframework.jms.listener.adapter,o rg.springframework.jmx.export.annotation Bundle-SymbolicName: ReceiverBundle Import-Bundle: com.springsource.management.agent.inventory;version="[2.5.6.SEC01,2.5.6.SEC01]", com.springsource.management.agent.monitoring;version="[2.5.6.SEC01,2.5.6.SEC01]"
Code:<?xml version="1.0" encoding="UTF-8"?> <classpath> <classpathentry kind="src" path="src"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> <classpathentry kind="con" path="com.springsource.server.ide.jdt.core.MANIFEST_CLASSPATH_CONTAINER"/> <classpathentry kind="output" path="bin"/> </classpath>
Last edited by pa7751; Sep 29th, 2009, 08:03 AM.
Leave a comment:
-
Yes, we are using spring dm enterprise edition. We have managed to resolve the problem. All we had to do is to set spring.managed.application.name system property when starting spring dm. We were able to see exposed service by means of jconsole, but not AMS.
Leave a comment:
-
Are you using dm Server Enterprise Edition? If so, beans marked with @Service should get automatically exposed in JConsole under the "spring.application" domain and should be picked up automatically by AMS as services under the dm Server (using the values provided by the " type" and "name" key properties of the MBean).
If you are not using dm Server Enterprise Edition, but are using AMS 2.0, you should still be able to expose your own services to AMS. Details on the ObjectName format and ModelMBean descriptor fields required can be found here: http://static.springsource.com/proje...ith%20AMS.html
Leave a comment:
Leave a comment: