jmx

Using JMX to read ejb manifest jar and ejb-jar.xml in ejb jar inside ear

Hello, I have an ear deployed on weblogic console. I need to check contents of manifest file and ejb-jar.xml of a jar that is present in the deployed ear. Currently I am using the code below to access jar inside ear deployed : Hashtable env = new Hashtable(5); env.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFac...

How to make JMX simple

Hello. I need to expose about 60 operations in a 30 defferent classes to JMX. Making it with DinamycMBean is a bit annoing. I am looking for a fast and elegant way to do it. I know that spring has a nice way with annotations but i am not using spring in this project. Thanks ...

JMX Port not getting opened when server is started via service.msc (is visible when started over cmdline)

Hi Guys, I need to monitor a java application remotely via visualvm. I have added the port (value 5555), ssl and authenticate properties (both false)) in the prop file. It works ok when I start the process via cmdline, I can connect via jconsole/visualvm by specifying the hostname:port. However it does not connect to the same process ...

Using JMX and JConsole to change logging levels on the fly - problem

I'm trying to implement the solution described here I have everything configured to where I can see my log changing methods in the JConsole, but when I try to run one of them, I get an error that it can't find that class that contains the methods ("Log4jMBean" as described in the description linked above) I already had to augment the p...

java.lang:type=Runtime is not an instance of interface java.lang.management.RuntimeMXBean

final RuntimeMXBean remoteRuntime = ManagementFactory.newPlatformMXBeanProxy( serverConnection, ManagementFactory.RUNTIME_MXBEAN_NAME, RuntimeMXBean.class); Where the serverConnection is just basically connecting to a jmx server. What basically is going o...

Why does JBoss JMX console not show descriptions of Spring-defined MBeans?

I have a Spring bean that is exposed via JMX using Spring annotations, but the parameter names remain blank and the operation and parameter descriptions don't show up. Can this be fixed without resorting to tedious XML definition files? I implemented this closely following a blog post. Here's my simplified code: import org.springframew...

Closing JMX Connection for concurrent operations

I am opening a JMX Connection using getMBeanServerConnection() method and then closing it after use in a finally block. And, for a given JMX Connector, 2 successful calls to getMBeanServerConnection() usually returns the same MBeanServerConnection. Some of the operations are invoked concurrently, and each of them invokes getMB...

jmx-term python subprocess poisons shell

#!/usr/bin/env python from subprocess import * p = Popen( args=("java","-jar","jmxterm-1.0-alpha-4-uber.jar"), bufsize=0, stdin=PIPE, stderr=PIPE ) p.stdin.write("open localhost:12345\n") x = p.stderr.readline() This needs a java process listening for a jmx client on port 12345. The script "works": x is correct (when you...

Framework for Java distributed application health monitor?

I am working on a java distributed application that consists of a variety of RMI servers running on a collection of processors in an embedded system. The system reports status through a color-coded GUI which underneath periodically polls the RMI servers for their status (UP, DOWN, DEGRADED, etc.) using a defined Interface. Additionally, ...

JBoss MBean NotificationListener problems

Hi, I'm having some trubles with NotificationListener on JBoss. I'm have a MBean on an JBoss, I can connet and call their methods. But when I'm trying to add Notifications y get the next exception: org.jboss.invocation.JBossLazyUnmarshallingException: getArguments failed at org.jboss.invocation.MarshalledInvocation.getArguments(Ma...

How does JConsole decide what order to use JMX keys to render a tree?

Hi, When viewing JMX beans in JConsole it renders all the beans under a given domain part as a hierarchy. (JVisualVM has the same behaviour with the JConsole MBeans plugin.) I realise that JMX object names are not hierarchical, but nevertheless JConsole is picking the keys in some order so that it can render them hierarchically. Does...

Can't see JMX entries in jconsole when using Tomcat JDBC Connection Pool

Hi, we're evaluating switching over from the C3P0 connection pool to the Tomcat JDBC Connection Pool (as described here). It appears to work as a connection pool but I can't seem to see any JMX entries for it when I run jconsole. Out of the box C3P0 gives lots of operations and attributes via JMX, the Tomcat JDBC Connection Pool gives ...

Calculating Application's memory consumption using JMX

Hello, I want to write a memory monitoring and notification utility that monitors specific application in JVM. To be clear I am not interested in JVM memory consumption rather I want to monitor my application memory alone, and want to get notified (by email) when ever the memory exceeds certain levels. MemoryMxBean deals with JVM memor...

Can visualvm connect automatically via JMX to a remote process?

I have a Java process running on a remote machine, and the process sets up some mbeans. I also have jstatd running on that machine as the same user as the Java process. (The mbeans can be set up programmatically or using -Dcom.sun.management.jmxremote... etc, this doesn't appear to make a difference). VisualVM is able to make a jstatd...

Invoking a EJB from PHP

Is there any easy way to invoke a RMI method on a EJB from PHP? We have a java app and a PHP app that sometimes needs to talk to it. What we do now is have a java binary that PHP invokes when it needs to do something, but I would love to know if there is a way to do this directly from PHP? ...

ManagementFactory.getPlatformMBeanServer() vs MBeanServerFactory.createMBeanServer()

Can anyone please clarify what the differences are between the two? The Javadoc is really obscure for my proper understanding. One thing I have noticed is if I use ManagementFactory.getPlatformMBeanServer() to register my MBeans, I can view them in Jconsole. But, not so if I use MBeanServerFactory.createMBeanServer(). Why is that? I...

Disable a single consumer for a Queue from ActiveMQ

I have a queue with several consumers and I'd like to disable one from ActiveMQ. I've looked into using JMX but haven't been able to see anything that would allow me to do this. Ideally this would be without changing any of the code at the consumer. ...

With recent Sun JVMs (1.6), is it possible to get GC thread information?

With JRockit, you can get the full list of threads by any means, and all of these means include information about the Garbage Collection Thread(s): 1) Asking the Thread class for the information: Thread.getAllStackTraces(); 2) Using ThreadGroup to get that information: ThreadGroup root = Thread.currentThread().getThreadGroup(); whil...

How can I represent polymorphism in JMX?

I have some types like this: public interface Numbering { List<NumberingComponent> getComponents(); } public interface NumberingComponent { Object getValue(); } public interface StringNumberingComponent extends NumberingComponent { String getValue(); } public interface IntegerNumberingComponent extends NumberingComponent ...

Can jboss snmp adapter(snmp agent) be extended to support my defined MIB?

I have our own MIB files, and I know in many cases, I have to write snmp agent to support my own MIB. But this time, I think if I can make jboss snmp adapter(JBossSNMPAdapter) to support my MIB, it will be much easier. So that, through jboss snmp adapter, I can query by its oid. I know JBossSNMPAdapter already suppport MIB-II. I wonde...