On the web
Nick Stephen's blog
Archives
« November 2009
SunMonTueWedThuFriSat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
     
       
Today
Click me to subscribe
Search

Links
 

Today's Page Hits: 148

20081107 Friday November 07, 2008

Using Microsoft's winrm to access an xVM Server's public APIs over a secure JSR 262 ws-management connection

I just thought I'd respond to Jean-Francois's excellent blog articles on accessing JMX instrumentation through web-services and more especially, using JSR 262 Web Service Connector for JMX to accesss JMX instrumentation.

This shows how simple it is to access the xVM's upcoming public management APIs using a Windows client using winrm, Microsoft's ws-management client. It can connect to the xVM management stack using ws-management via a secured https connection with http basic authentication.

[Read More]

( Nov 07 2008, 06:19:04 PM CET ) Permalink

20071119 Monday November 19, 2007

keytool - backdating a self-signed certificate

Have you ever had to deal with clock-skew across machines? When distributing self-signed certificates to create a network of trust between machines, clock-skew can be a real problem if one machine thinks that the other machine's certificate isn't yet valid...

Here's a new feature in Java 7 that can help you to create self-signed certificates that are immune to this...

[Read More]

( Nov 19 2007, 03:20:28 PM CET ) Permalink

20070622 Friday June 22, 2007

Java and too many jars

One of the projects I'm helping architect is a pretty huge undertaking. It's got lots of separate functional blocks being deployed into classloaders in each Java SE JVM, and since they're being developed by lots of different teams, we're seeing the same kind of common infrastructure jars (hibernate, apache commons logging, jwsdp, etc.etc.) being loaded multiple times into some of the VMs. [Read More]

( Jun 22 2007, 03:37:26 PM CEST ) Permalink

20070529 Tuesday May 29, 2007

JMX MXBean Notifications, User Data, and Open Types

The MXBean runtime support classes in Java 6 provide all the help you need in order to be able to declare complex types for attributes and operations, but don't provide any help for converting complex types for other uses, such as for the payload of a Notification. This blog article shows how to add helper methods to convert an existing struct-like class into Open Data. [Read More]

( May 29 2007, 04:11:10 PM CEST ) Permalink

20070522 Tuesday May 22, 2007

JMX AttributeChangeNotifications, MXBeans, and a clever little helper class

This blog article introduces AttributeChangeNotifications and shows how to write a clever little helper class for generating attribute change notifications with the correct contents for the old and new attribute values, even for MXBeans with complex attribute types. [Read More]

( May 22 2007, 11:54:27 AM CEST ) Permalink

20070118 Thursday January 18, 2007

Java: Redirecting System.out and System.err to a rolling log file


This blog article shows how to redirect System.out and System.err to your Java Logging subsystem, so that such output gets integrated into your debug log stream in a rolling log file.
[Read More]

( Jan 18 2007, 02:13:47 PM CET ) Permalink Comments [7]

20070116 Tuesday January 16, 2007

JMX : extending the MBeanServer to support Virtual MBeans

Java Management eXtensions (JMX) provides a means for management interfaces to be exposed as MBeans allowing remote monitoring and management of your application.

This blog article shows how to extend the MBeanServer implementation with your own logic. In particular, it shows how to implement VirtualMBeans - MBeans that don't really exist - but the same technique can be used to do other interesting things, including MBeanServer cascading, fine-grained MBean access controls, auditing, or logging, to mention a few of them.
[Read More]

( Jan 16 2007, 06:00:00 PM CET ) Permalink Comments [4]

20061110 Friday November 10, 2006

JMX: Building a JMX Notification Hub

JMX Notifications allow MBeans to send asynchronous messages and are typically used to indicate a state change, a received event, or a problem.

However, it's necessary for clients to individually subscribe to each MBean that they are interested in receiving notifications from. When there are many such MBeans, or when the MBeans may be created dynamically, this can pose a problem for the client.

This article shows how to build a JMX Notification Hub MBean which provides a single place for clients to subscribe to receive notifications from many MBeans. [Read More]

( Nov 10 2006, 04:41:35 PM CET ) Permalink

20061031 Tuesday October 31, 2006

Java: Tracing classloader leaks

Frank Kieviet has written a very interesting article on how to use existing free tools to easily track down hanging references to code that has been unloaded from a JVM.

Anyone writing Java code that has to deal with code loading and unloading is probably familiar with problems related to releasing those last dangling references to the code being unloaded - without unloading the code, the classloader won't go away, the memory won't all be released, and the behavior of the JVM when the same code is loaded again cannot be guaranteed...

Somewhere where this particularly bites hard is with JNI code... due to the design of the JNI API, there's a constraint that it's forbidden to load the same JNI library into two different classloaders at the same time... so if you cannot release that last reference to your old classloader, you cannot reload the same code into the JVM without a restart.

There are of course tricks you can play to work around this - for example, you can rename the shared library file so that the JVM doesn't see it as being the same one (I believe that's what the MLet code in JMX does), but that adds complexity and is rather fragile.

The best thing to do is to track down those reference leaks in your code. Sometimes they can be pretty nasty, other times they're trivial to fix. They're just hard to find. Until now.

Thanks Frank!

( Oct 31 2006, 11:44:33 AM CET ) Permalink

20061023 Monday October 23, 2006

snmpv3? JMX!

An interesting tidbit from visit to a customer specializing in monitoring/management of large-scale deployments - few companies in their experience are deploying SNMPv3-based management solutions. [Read More]

( Oct 23 2006, 05:00:00 PM CEST ) Permalink

20061009 Monday October 09, 2006

Fancy a free in-depth J2EE training course?

There's a free online J2EE training course that's about to start which is available here... I'd encourage you to sign up if you want to learn about J2EE programming!

I'm more of a J2SE and JMX domain expert myself, the work we do is often used in management service tiers and management agent tiers, and it does me some good to make sure I track other technologies. I've signed up and will be following some but not all of the coursework...

( Oct 09 2006, 03:00:00 PM CEST ) Permalink

20060929 Friday September 29, 2006

Java - why does my JVM use CPU when idle?

Have you ever wondered why an otherwise idle Java process sits there in an endless loop scheduling a thread, calling poll, regularly eating a small amount of CPU?

I always used to think that this was because of things like the garbage-collector and the JIT compiler, but it's not...

[Read More]

( Sep 29 2006, 03:00:00 PM CEST ) Permalink

20060911 Monday September 11, 2006

JMX - building your own proxies - snapshot proxies

In my last blog entry, I described how it's possible to get synchronized access to multiple attributes of the same MBean via the use of a SnapshotProxy and a SynchronizedStandardMBean.

This blog entry describes the SnapshotProxy in more detail.

[Read More]

( Sep 11 2006, 04:00:00 PM CEST ) Permalink Comments [2]

20060908 Friday September 08, 2006

JMX - atomic access to multiple attributes on the same MBean

I was recently reading an excellent article by JMX Spec Lead Éamonn McManus called MXBeans in Java SE 6: Bundling Values Without Special JMX Client Configurations, which describes a great Java 6 platform feature related to management - that of supporting MXBeans - gone are your classpath issues with proprietory serialized Objects being sent over a JMX connection.

Although MXBeans are a very suitable general-purpose approach to this question, and MXBeans are what I'd recommend if you're able to use Java 6 and are able to choose your own data model, they're not the only way of getting access to MBean attributes in an atomic manner. This entry explains another approach to a slightly different problem-space - that of accessing different attributes in an atomic manner, rather than grouping the attributes together into a single, composite attribute.

[Read More]

( Sep 08 2006, 05:30:00 PM CEST ) Permalink