jmx

Accessing Apache ActiveMQ via JMX throws Exception

◇◆丶佛笑我妖孽 提交于 2019-11-30 16:18:48
问题 I'm using a fresh ActiveMQ 5.8.0 installation, where I have a message in a queue called 'testing'. I also replaced the ACTIVEMQ_SUNJMX line in bin/activemq to enable JMX: ACTIVEMQ_SUNJMX_START="-Dcom.sun.management.jmxremote.port=1099 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false" Then I query JMX via the following code: try { JMXConnector connector = JMXConnectorFactory.connect(new JMXServiceURL("service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi

How to enable JMXMP in Tomcat?

走远了吗. 提交于 2019-11-30 15:35:04
I've downloaded the JMXMP extensions and installed them in Tomcat's lib directory. Now, how can I make it use them, i.e. let Tomcat accept JMXMP connections? Oracle's examples show how to do it with code, for which I'd have to write my own listener, which I'd rather keep as a last resort. Tomcat's JMX listener does not seem to include JMXMP support. Well, I wrote my own JMXMP Tomcat listener. Feel free to use: package webersg.tomcat; import java.lang.management.ManagementFactory; import javax.management.remote.JMXConnectorServer; import javax.management.remote.JMXConnectorServerFactory; import

Is it possible with JMX to register or show the MBeans form different VMs in one central MBean server?

余生颓废 提交于 2019-11-30 15:23:52
I'm looking for a solution to register the MBeans or the whole MBean Servers itself from different Java VMs in a central MBean Server which should also run in a separate VM. The goal is to have only one central MBean Server which contains all MBeans of the whole System. One additional requirement is and thats the difficulty :-), that the "client" MBean Servers must connect/register to the central MBean Server and not the other way. The central MBean Server don't need any knowledge of the "client" MBean Servers to register. I have only found JMX examples in which the "master" MBean Server

Support for Kerberos Authentication/Authorization on JMX Client/Server running on Java 6

拈花ヽ惹草 提交于 2019-11-30 14:34:50
I have my JMX server which registers beans reading from local file and make them available to other JMX clients on demand. Server can be accessed either using "jconsole" or by Java app running under Tomcat container. What i want is to add authentication in order to prevent "unknown" identity accessing JMX Server. To achieve this i have added Kerberos authentication @ server using following JVM options -Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.port=5555 -Dcom.sun.management.jmxremote.authenticate=true -Dcom.sun.management.jmxremote.ssl=false -Djava.security.auth.login

Is it possible to enable remote jmx monitoring programmatically?

ⅰ亾dé卋堺 提交于 2019-11-30 13:40:45
I need to programmatically start a new java process and dynamically set the JMX port. So instead of doing this -Djava.rmi.server.hostname=127.0.0.1 -Dcom.sun.management.jmxremote.port=9995 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false I would like to do the following System.setProperty("java.rmi.server.hostname", "127.0.0.1" ); System.setProperty("com.sun.management.jmxremote", "true" ); System.setProperty("com.sun.management.jmxremote.authenticate", "false" ); System.setProperty("com.sun.management.jmxremote.ssl", "false" ); System.setProperty("com

Change @ManagedResource objectName dynamically

帅比萌擦擦* 提交于 2019-11-30 13:29:15
I am creating prototype beans programatically/dynamically. I want those beans after initiation to be in the jmx console. How I can distinguish between them? I am using anotations in order to add my beans to the jmx and I have @ManagedResource(objectName="bean:name=MybBean") I need to inject the objectName dynamically. Any idea how could I do it? Here's my jmx configuration: <context:mbean-export server="mbeanServer" /> <bean id="mbeanServer" class="org.springframework.jmx.support.MBeanServerFactoryBean" /> <bean id="exporter" class="org.springframework.jmx.export.MBeanExporter" lazy-init=

Simple tool to monitor a Tomcat server using JMX

假如想象 提交于 2019-11-30 10:30:02
I am a computer science student currently doing an internship. My boss has asked me to write a simple tool to monitor a Tomcat server. I am just starting this project so I'm basically just playing around to see how things work. I would like to create a simple jsp page that displays the results of some basic JMX queries. I am using the Eclipse IDE. Can someone give me some tips to get started? You definitely don't have to re-invent the wheel, here. You can start with jconsole , which ships with your JDK: just run jconsole [pid] and jconsole will connect to the (locally) running process and let

Spring MBeanExporter - giving name to MBean

陌路散爱 提交于 2019-11-30 10:15:56
I'm trying to run a simple application with jmx-exported method. I do it like (spring-context and cglib for "@Configuration" are in classpath): package com.sopovs.moradanen.jmx; import org.springframework.context.annotation.AnnotationConfigApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.jmx.export.MBeanExporter; import org.springframework.stereotype.Component; @Component @Configuration public class SpringJmxTest { public static void main(String[] args) { new

How to configure Hibernate statistics in Spring 3.0 application?

百般思念 提交于 2019-11-30 09:48:25
How do we configure such that we obtain Hibernate statistics through JMX in Spring MVC based web applications. Is there any better way of tracking Hibernate performance. Set hibernate.generate_statistics to true (either in persistence.xml or in hibernate.cfg.xml or in your session factory bean configuration). Then register this bean: <bean id="hibernateStatisticsMBean" class="org.hibernate.jmx.StatisticsService"> <property name="statisticsEnabled" value="true" /> <property name="sessionFactory" value="#{entityManagerFactory.sessionFactory}" /> </bean> (If you are not using JPA, just specify

Is there any JMX - REST bridge available?

两盒软妹~` 提交于 2019-11-30 08:25:57
Hi I would like to monitor a Java application using the browser but at the same time utilising the existing JMX infrastructure. I know that JMX provides a HTTP interface but I think it provides a standard web gui and its not possible to mashup its functionality with an existing system. Are you aware of any REST interface for JMX? My research on google currently shows that there is one project which does something similar. Is this the only option? Jolokia is a new (at this time) JMX Agent you can install in your JVM and exposes the MBeanServer over HTTP in JSON format. Tomcat provides a JMX