Skip to content

Category Archives: Java

JBoss Seam 2.1 Presentation at Java Meetup

Here’s my presentation on JBoss Seam 2.1 from the Boston Java meetup group Introduction To JBoss Seam 2.1 View more presentations from Priyatam M.

our new rtc is up again!

Changed our servers to bluehost, our new rtc is up again!

Mapping a clob type in hibernate and oracle 9i/10g

The easiest way to map a CLOB type of Oracle to a pojo in Hibernate, is to setup a user defined type in Hibernate, which converts Oracle’s ClobType to a String and vice versa. So you’re pojo’s property is going to be a “String” type. There are only two steps to setting this up: 1) [...]

Headless Javascript Unit Testing

I gave a presentation at work a couple of months ago covering JavaScript scoping considerations for a team of Java developers new to JavaScript. During the presentation, I used Rhino to run the examples. I have seen other projects that use Rhino for unit testing, but they seemed a little heavy weight for what I [...]

The next generation of building Swing Applications

A lot of you (including me) have forgotten about Swing, ever since Web 2.0 has taken precedence over rich clients. However, good is coming back! I was browsing through the Java 7 features the other day and came across Swing Application Framework. It brings in the best of the breed concepts of Web and Desktop [...]

Horrible Java Generics syntax

Class Formatter public interface Formatter <t extends Foo> { public List<list<string>> format(List<t> foos); } Class FooFormatter implements Formatter and is strongly typed public class FooFormatter<foo> implements Formatter { public List<list<string>> format(List<foo> beans) { return null; } } When you compile the above (or see the red marks in your IDE), you get the following compiler [...]

Converting checked exceptions to Runtime, as a language feature

You might already know how frustrating it is to add a try catch block on those java.io api and date parsing API. The reality is, when such exceptions occur, something terrible most probably happened and you don’t want your application to proceed normally. Ofcourse, you can have a try catch block and convert checked exceptions [...]

Disabling Ganymede Plugins

In Ganymede, the Manage Configuration option Eclipse users were used to using is gone. Help->Software Updates is for just that now. So how do you go about disabling a plugin now? Well the good news is you no longer have to wait 5 minutes for the Manage Configuration window to load! Ganymede Eclipse now provides [...]

EasyMock IllegalStateException

I had a case this morning reworking a test after I’d modified a method signature, from: expect(mockRestProxy.getProxiedResource((String) anyObject())) .andReturn("{policies}"); to expect(mockRestProxy.getProxiedResource((String) anyObject(), userIdentity)) .andReturn("{policies}"); I received a stacktrace like this: java.lang.IllegalStateException: 2 matchers expected, 1 recorded. at org.easymock.internal.ExpectedInvocation.createMissingMatchers(ExpectedInvocation.java:41) at org.easymock.internal.ExpectedInvocation.<init>(ExpectedInvocation.java:33) at org.easymock.internal.ExpectedInvocation.<init>(ExpectedInvocation.java:26) at org.easymock.internal.RecordState.invoke(RecordState.java:64) at org.easymock.internal.MockInvocationHandler.invoke(MockInvocationHandler.java:24) at org.easymock.internal.ObjectMethodsFilter.invoke(ObjectMethodsFilter.java:45) at $Proxy0.getProxiedResource(Unknown Source) … To quote the [...]

Bringing the Browser To The Server (Just Discovered This)

John Resig posted an awesome article a little over a year ago, and I’m just getting to it. I’ve been developing a javascript presentation, primarily focusing on scope and functions, to a group of Java developers. I’ve used JSUnit and Firebug to work with javascript quite a bit, but frankly, I don’t really like either [...]