Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 27

Thread: AMS not detecting exported beans

  1. #11

    Default

    Nothing useful there either, unfortunately. Looks like I'll have to try to repro. If you don't mind, could you private message me the bundle containing the Armadillo Key Generator? Else I'll try to duplicate it locally, though we have several local tests that seem to pass, so I'm not sure what is causing your specific situation...

    Thanks,
    Jennifer

  2. #12

    Default

    Sorry it has been awhile. I created a simple bundle to see if I could get it to work, but am still having same problem. The goal is to have AMS give us metric data on the CounterService's current count. Right now the only groups that show up under dm Server in AMS are:

    SpringSource dm Server 1.0 Cache
    SpringSource dm Server 1.0 Global Request Processor
    SpringSource dm Server 1.0 JSP Monitor
    SpringSource dm Server 1.0 Servlet Monitor
    SpringSource dm Server 1.0 Thread Pools
    SpringSource dm Server 1.0 Web Module Stats

    And in them I see the servlet data for CounterWebService, but nothing of CounterService. Thank you.

    Attached is the test bundle I've been working with. Thank you.
    Attached Files Attached Files

  3. #13
    Join Date
    Nov 2008
    Posts
    9

    Default

    Hi there,

    We have almost the same problem. We have the service which is deployed into the Spring DM Server enterprise edition. We are able to see our service and itsd corresponding metrics by means of jconsole, but we have problems to manage our spring bean services in the AMS. Our service is rather simple. Here is the code

    Code:
    import java.text.SimpleDateFormat;
    import java.util.Calendar;
    
    import org.springframework.jmx.export.annotation.ManagedOperation;
    import org.springframework.stereotype.Service;
    
    @Service
    public class TestServiceImpl implements TestService {
    
        @ManagedOperation
        public String getTime() {
            return new SimpleDateFormat("yyyy.MM.dd HH.mm.ss").format(Calendar.getInstance().getTime());
        }
    }
    Could you please suggest how to configure the AMS and DM to be able to manage separate beans? And where in the AMS we can manage them.

    Thanks in advance

  4. #14

    Default

    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

  5. #15
    Join Date
    Nov 2008
    Posts
    9

    Default

    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.

  6. #16

    Default

    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>
    JMSReceiver.java
    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();
    		}
    	}
    }
    MANIFEST.MF
    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]"
    .classpath file
    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>
    Although I am able to see the "ActiveMQ 4.0 testq localhost Queue" and the "SpringSource dm Server 1.0" in AMS console, these do not show any metrics for the things that I am trying to monitor i.e. my MDP application and the testq. Please advise how can I monitor these. Do we need to get the enterprise versions of the softwares or am I missing anything?
    Last edited by pa7751; Sep 29th, 2009 at 08:03 AM.

  7. #17
    Join Date
    Nov 2008
    Posts
    9

    Default

    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}" />
    just after the
    Code:
    <filter name="template" value="${OBJECT_NAME}:${alias}" />

  8. #18

    Default

    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

  9. #19
    Join Date
    Nov 2008
    Posts
    9

    Default

    We haven't work with activemq+ams together, but maybe this link will help.

  10. #20

    Default

    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

Posting Permissions

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