jump to navigation

The Classpath (TM) July 6, 2007

Posted by Phill in Application Servers, General J2EE.

An application that I’ve been working on recently has had a bit of trouble with the classpath. Basically, deploying the project originally required modifying the application server classpath (in this case, BEA WebLogic) to include the antlr.jar on the classpath. The problem was – bearing in mind this is an inherited project – just before he left, the other guy decided to put antlr.jar in the WEB-INF/lib directory instead, and remove it from the app server classpath.

This has actually caused all manner of headaches, what with our local test server not having the jar file in the classpath, but the deployment server having it on the classpath … in other words, our test environment didn’t mirror our client’s environment, meaning we couldn’t use the same .ear file for them.

Ok, I know this story is boring. But the point is: don’t, and I mean DO NOT, if you can avoid it at all, put stuff into the Application Server classpath. Anything which goes outside your application is a risk – it’s one more thing which can potentially go wrong.

In an ideal world, an .ear file would contain absolutely everything – you could just package it up and – Bam! – you could deploy your application anywhere. Obviously this is not the case, but I think the closer we can get to that the better. It’s not always possible, but it makes things so much easier…

%d bloggers like this: