A Non-Blocking Process.waitFor()

When calling java.lang.Process.waitFor() the call will block (wait()) until the process actually exits. The waitFor() call is blocking, which is pretty irritating sometimes, for instance when #&%€! wine decides to hang itself, hereby stealing my tomcat execute threads and database connections in production
Well, here’s a quick and dirty solution to creating a non-blocking [...]

July 16, 2010  Tags:   Posted in: Programming  No Comments

Testing CXF with Autowiring using Spring

Here is how to create a test for a CXF web service implementation class. The test use spring-mock base classes and hereby support stuff like transactions and autowiring through annotations. Neat.
I have a base class like this:

import org.springframework.test.jpa.AbstractJpaTests;

public abstract class AbstractCxfWsBeanTest extends AbstractJpaTests {
public static final String[] SERVICE_CONFIG_LOCATION = new String[]{
[...]

June 20, 2010  Tags: , , , ,   Posted in: Programming  No Comments

One Pool to Rule Them All…in tomcat

I am developing a system that gets deployed as a bunch of separate webapps but all in the same tomcat instance. Not long ago, we opened up production for a lot more users, which quickly led to some resource exhaustion-primarily on the database backend. In other words, … we were beating oracle to death.
After some [...]

June 13, 2010  Tags: , , ,   Posted in: Programming  No Comments

How To Acess Target Object Behind a Spring Proxy

When annotating spring managed beans with stuff like @Transactional, spring will behind the scenes produce code, that ensures that transaction logic is applied before and after your code. Depending on the configuration, this is often done using a JDK proxy, which is a dynamically generated class implementing the bean interfaces. This dynamically generated code will [...]

June 5, 2009  Tags: ,   Posted in: Programming  8 Comments

Making a Java WebApp Return Proper SOAP Fault Responses

In several projects I have been co-developing, we had a webapp as part of the system, which exposed a webservice API as integration end-point to the system. The sole content of that webapp is the webservice, and as such, the web.xml contained only the mount of the webservice servlet (like CXF or Axis) and not [...]

August 29, 2008  Tags: , ,   Posted in: Programming  No Comments

The Need for java.lang.Thread and java.sql is Gone

At least for the application developer.
Back in the days of Java1, two cool parts of this new platform was the threading apis and the JDBC apis. These APIs have both had immense success. But I think we, as application developers, should forget about them. I know I mostly have.
There are good reasons, that these apis [...]

August 28, 2008  Tags: , ,   Posted in: Design, Programming  14 Comments

Applet Caching and the Control Panel on Linux

The Sun Java applet plugin will cache applets outside the browser cache, in its own cache directory. Clearing the cache in the browser will not clear the applet cache, which can be irritating when you need to be sure, that a fresh copy of a given applet is loaded.
What you need to do, is clear [...]

August 25, 2008  Tags: , ,   Posted in: Operating Systems  One Comment

System.currentTimeMillis, System.nanoTime and Their Resolution

When reading about Robust Java Benchmarking, I came across some things I had not thought about myself. It turns out, that even though System.currentTimeMillis() has the unit of milliseconds, the precision with which the method can return, is quite different on various operating systems.
Brent Boyer explains that Windows XP has a granularity of 15 ms, [...]

August 10, 2008  Tags:   Posted in: Programming  7 Comments

JavaFX – A Forever Unfinished RIA Technology

A couple of weeks ago, while I had a fun day with a bunch of my colleagues, showing them the wonders of flex development, another two of my bright colleagues used that same day, to uncover how far JavaFX is now, and what could be done with the technology today. And the answer was horrifying. [...]

July 9, 2008  Tags: ,   Posted in: Programming, Rich Internet Applications  7 Comments

What Is The Big Deal With Flex?

Are you a Java developer with the thought: “What the f*** is up with all the flex hype here in the Java camp? Is flex not just the same old closed flash world like always?”. If so, then this post is for you.
In my recent post Flex Leads to Clash Between Java and Flex [...]

June 8, 2008  Tags: ,   Posted in: Programming, Rich Internet Applications  13 Comments