265 views
1 Star2 Stars3 Stars4 Stars5 Stars (3 votes, average: 4.67 out of 5)
Loading ... Loading ...

25.02.13

First Steps with Jolokia

Posted in Blogroll, News, Tech at 2:36 am by Liv About Liviu Tudor

ExplodingCup6small javaIn a (rather old) previous post I have talked about using Sun (ahem Oracle!) JMX/HTML bridge to manage and monitor your applications. As it happens, that agent has been discontinued and due to various licensing issues (I’m guessing) one can’t even download it normally from a maven repo, and has to rely on all sorts of hacks to include the required jar in the application. Also, one of the downsides of that — while a small price to pay though! — is that you have to write some code to start the agent when your app starts.

In exchange of the (rather small) piece of code that you write to start the agent, you get in exchange a fully-fledged HTML-based app which allows you to inspect and change your managed beans. The trouble with that though — while a very handy tool otherwise! — is that it provides all the data in HTML and all the requests made to the agent are HTTP GET only. This means that if you need to query one attribute of one of your beans, you will have to employ some curl-ing (eeeeassy!) and some HTML parsing (ouch!). Do-able, even more so as the agent uses very simple HTML and the structure of the pages is always the same — but a bit cumbersome at times. Also, unfortunately complex data structures cannot be set or displayed easily using that tool.

Read the rest of this entry »

Disclaimer

538 views
1 Star2 Stars3 Stars4 Stars5 Stars (4 votes, average: 5.00 out of 5)
Loading ... Loading ...

25.09.12

(Small) Bug with Oracle’s HTML/JMX Interface

Posted in Blogroll, News, Tech at 3:39 am by Liv About Liviu Tudor

 network pc monitorsI posted before an article about how to use Oracle’s (well, Sun’s, since it was started really before the Oracle acquisition) HTML/JMX agent to monitor your apps via JMX here. For those of you who went ahead and decided to use that interface, you probably noticed a small (but rather annoying bug) in that component — or maybe you haven’t, in which case, you will know how to avoid it if you read this.

It’s not a big deal to be honest, as you are about to see — especially if you are dealing with clean code or code you’ve written yourself and understand the functionality ahead. But if you are trying to use the “help” facilities of Oracle’s JMX/HTML console you might find this rather annoying.

As a side note, I’d be more than glad to submit a patch for this somewhere, but bloody Oracle has discontinued this component :( So if you find out where I can submit the patch, drop me a line and let me know — much appreciated in advance!

Read the rest of this entry »

Disclaimer

304 views
1 Star2 Stars3 Stars4 Stars5 Stars (4 votes, average: 5.00 out of 5)
Loading ... Loading ...

18.09.12

RFC : DynamicMBean in JDK — Method getAttributes

Posted in Blogroll, Random Thoughts, Tech at 1:07 am by Liv About Liviu Tudor

In case you haven’t quite figured it out, the above RFC stands for Request For Clarifications in this case — as in, this post is meant to pretty much ask the tinterweb population out there if they know anything about this. (My searches so far have proved unsuccessful — though I am known to be a rubbish googler, sorry!)

Also, this question relates to a class (well, interface really) in the standard JDK — I’ve discovered this using JDK 1.6, however, it seems this is still just as vague in Java 7 — so as of now, this is rather an open question I’d say…

As you might have guessed from the name of this post, the question concerns the DynamicMBean interface in javax.management package. The JavaDoc for JDK 1.6 is here and the one for Java7 is here. More to the point, the question is regarding the getAttributes() method.

Read the rest of this entry »

Disclaimer

3,995 views
1 Star2 Stars3 Stars4 Stars5 Stars (4 votes, average: 5.00 out of 5)
Loading ... Loading ...

09.08.12

Application Monitoring and Management using Sun’s JMX/HTML Interface

Posted in Blogroll, News, Tech at 11:48 pm by Liv About Liviu Tudor

This is something I wanted to write about a while back – while there are articles on the net about using JMX in a Java application to keep an eye on how it ticks, or manage its running cycle, I think there is still a large number of users out there who are somewhat reluctant to use this part of the JDK to achieve this in their Java applications. Reasons I think are quite varied, and they span from the large availability of enterprise-wide monitoring tools out there (so much easier to outsource this part to another company so you can concentrate on building the application) to the fact that the JMX Console that gets shipped with the JDK is not the most scriptable to use (it’s a Swing app after all!) or the most friendly. (In particular, it uses RMI and trying to configure a firewall to allow access via JMX Console to your infrastructure proves a pain, since it uses dynamic ports.)

Few know though that there is a little package from Sun (ahem, Oracle I mean!) who provides a HTML layer for inspecting your MBean’s and invoking actions on them. While this might not sound like much (in fact, I am pretty sure Oracle’s JDMK is not the only HTML/JMX interface, so it’s not a big deal after all that Oracle provides one), it can have some (sweet) implications in your app management and monitoring infrastructure:

Disclaimer

1,092 views
1 Star2 Stars3 Stars4 Stars5 Stars (4 votes, average: 4.75 out of 5)
Loading ... Loading ...

22.12.11

Apache Commons Modeler — Simple/Sample Usage

Posted in Blogroll, Random Thoughts, Tech at 10:13 pm by Liv About Liviu Tudor

I’ve dealt in previous posts (here and on Cognitive Match‘s blog) with JMX and various things around it — as this is an area I have found more than useful in the JDK. It is therefore no surprise that recently I have turned my eyes to Apache Commons Modeler. The project lacks documentation, granted, and sometimes having the sources helps more than the JavaDoc (sorry, guys!) but nevertheless it is actually a handy tool. I am only guessing the reason why the project hasn’t maybe got the popularity it deserves amongst developers is because of Spring JMX — which in fact does pretty much what the Modeler does, however, there’s lots of developers “hooked” on Spring.

At the core of Modeler is the ModelMBean interface — for those of you unfamiliar with this, it allows a developer to wrap up any old Java class into an MBean which can be then managed via normal JMX means. In other words, you can take any class you want to export to JMX and without changing your class, without your class even “knowing” it’s going to be JMX‘d, you can do so — by the usage of a ModelMBean!

Read the rest of this entry »

Disclaimer