In this series I want to address some topics that are old and well known, but still seem to puzzle developers and administrators in a j2ee environment. Think of anything in or around an application server. When talking of application servers I mostly refer to websphere. Sadly I have no real experience using any other. Yet I aim to keep a broad perspective, not to narrow the audience. The level should be beginner to intermediate.
Part1 Starting your own threads.
As long as I worked with application servers, people have always told me not to start my own threads, because the j2ee specification states that this is forbidden. These threads are also referred to as 'naked' and 'unmanaged'. The danger they pose is doing things that the application server knows nothing about. It could cause resource leaks, no debugging, failing to stop a server or security problems.
Yet there is a number of open source frameworks that do just this, and no one seems to object. Think of quartz, or Log4j (the watchdog that monitors changes in log4j settings). And even the jdk itself is guilty: use of java.util.Timer also causes so called unmanaged threads.
Filed under Concurrency Control, Java, Middleware, websphere | 3 Comments »
Logging should be simple and straightforward. It is an essential part of everyday administrative operations and it provides vital information for debugging production incidents. Adequate logging saves time and money. When hosting a number of applications, say 10+, you will want to separate application logs from each other and from platform logs and traces. Logging frameworks like the jdk logger and log4j, cooperating with the j2ee container provide the means to do this, using configuration files. So far, so good.
(more...)
Tags: websphere
Filed under Java, Middleware | No Comments »
A colleague asked me whether jconsole could connect to a running IBM Webpshere 6.1 instance. This way you could gather performance data and work with Mbeans like with any other 1.5+ JVM. I had never tried this, but I quickly saw that jconsole is provided with the websphere jvm, so I said I would give it a try.
The forum posts all complained that it wasn´t possible, but I combining several entries I got together a working solution. This is typical of websphere, it´s a little harder, but in the end you can get there.
(more...)
Filed under Java, Middleware, Performance | 6 Comments »