WAFFLE: Local groups bug

The other day I was trying to create a new release build for Waffle, but one of the unit tests was failing. The test was testing the .Net version of the WindowsComputerImpl.Groups which returns the list of local groups. The test was failing because this Groups property was returning zero groups on my machine even though my computer has several local groups. I took a look at how Groups property was implemented and I found Continue reading

GWT/GXT and Session Timeouts

One of the applications we develop at work is a GWT/GXT web application hosted in tomcat.  Recently we started getting complaints about strange behavior when the user’s session timed out. The RPC calls would fail so all sorts of strange error messages would popup, but the user was not redirected back to the login page.

This strange behavior was occurring because, after the initial application load, the only traffic to the server were our RPC calls. When an RPC call is made after the session timeout the call simply fails. The redirect from tomcat is ignored.  Continue reading

Reading Objects from an LDAP Directory using Spring

The title of this post is “Reading Objects from an LDAP Directory using Spring”, but I’m going to present a specific example. This example can easily be modified to read any object from an LDAP Directory as a Spring bean.

So, for my example I’m going to use a problem that I had to solve recently. I needed to move some database configuration for several web apps from being defined as a tomcat Resource to being read from an LDAP directory. Why would you want to do this, I hear you ask? Well, imagine you have several Tomcat instances possibly on several different machines. Anytime you need to make any database configuration changes (or even on installation) you have to duplicate the changes on every tomcat installation. By moving some configuration into a centralized location it’s much easier to maintain and administer.

Now, this doesn’t sound like it would be that difficult of a task, but it turns out it wasn’t quite as simple as I thought. The web apps I needed to modify use Spring+Hibernate, so our Spring configuration used to look something like this.  Continue reading

Redirecting System.out to a JTextArea

I was recently working on a small Demo UI for a Metro web service client. Creating the UI was fairly simple, but I was thinking that it would be nice to show the raw SOAP messages in the UI. Getting Metro to output the SOAP messages was easy, but the Metro was outputting them to System.out. I thought, “Surely there must be a way to redirect System.out to a JTextArea. After all, if Eclipse can do it, then so can I!” So here’s what I came up with.  Continue reading