Archive for the ‘Java’ Category

Integrating Spring MVC 3.0 with JSR 303 (aka javax.validation.*)

Annotated POJO validation comes to a JDK near you!
The new annotated validation spec (jsr 303) is pretty slick, especially when used along side Spring MVC 3.0, and when backed by ejb3 entities. I’m pretty impressed with how easily it integrates with Spring MVC’s framework, and with how seamlessly error messages are passed to the form [...]

Posted on February 8, 2010 at 12:35 am by Ant · Permalink · 7 Comments
In: Java · Tagged with: , , , , ,

Quartz Scheduled Jobs

Java, XML, and cron driven scheduling made easy.
Projects here and there often need some kind of mechanism to schedule jobs at odd hours, or intervals. Quartz is a robust, flexible tool you can use to accomplish simple to complex job scheduling. There are a number of ways to use/configure quartz, but I’ve grown accustomed to [...]

Posted on February 5, 2010 at 12:33 am by Ant · Permalink · 9 Comments
In: Java · Tagged with: , , ,

Ejb3 Basics: Deploying Message Driven Beans

Farewell to lazy auto queue generation in JBoss 5
MDB’s were never so easy to deploy and manage when ejb3 first came out. In Jboss 4, all you have to do was annotate a class with @MessageDriven, sprinkle some meta data here and there, stick it in the oven and wham! Instant “I cant believe I [...]

Posted on February 2, 2010 at 12:37 am by Ant · Permalink · Leave a comment
In: Java, Jboss · Tagged with: , , , , , ,

Ejb3 basics: Entities

Entity Beans? Better than 2.1, I promise.
Ejb3 Entity beans are a type of enterprise java bean construct used to model data used by the ejb framework. The basic idea is to manipulate simple java objects, which represent in concrete terms your database data, and then have the framework handle as much of the plumbing as [...]

Posted on January 29, 2010 at 12:47 am by Ant · Permalink · One Comment
In: Java · Tagged with: , ,

War deployment file structure

What’s a war deployment, do I need my own army?
When it comes to deploying an web based application we have a few options on the table. Well only one really if you stick to J2EE standards, not counting Ear deployments which also deploy web apps via wars. Outside the world of J2EE though, it becomes [...]

Posted on January 25, 2010 at 12:03 am by Ant · Permalink · One Comment
In: Java, Jboss · Tagged with: , , , ,

Java, XML and XStream

What’s an object/xml serializaing/deserializaing library?
If you’ve never worked with an object/xml serializer and are considering writing your own from scratch, you may want to consider using a library like XStream. XStream is very good at moving java into xml and back. It allows a high level of control over how the xml can be organized [...]

Posted on January 22, 2010 at 12:36 am by Ant · Permalink · 8 Comments
In: Java, Technobable, xml · Tagged with: , , , ,

Using Jboss Datasource files

If you’re using jboss and you’re storing database connection info in a properties file, you might be doing something wrong. Specifically, you’re probably not using the data source files jboss ships with to configure all that plumbing.
What’s a Datasource file?
Simply put, its a file that contains all the connection properties an application needs in order [...]

Posted on January 20, 2010 at 9:44 am by Ant · Permalink · Leave a comment
In: Java, Jboss · Tagged with: , , , ,

Ejb3 Basics: Bean Managed Transactions

I’m Lazy, why would I want to do my own transaction management?
While its true that the ejb3 container is usually pretty smart about persisting and handling transactions, its also not as smart as a real human being and probably isn’t able to handle complex database transactions and rollbacks. This is where bean managed transactions [...]

Posted on January 14, 2010 at 4:50 pm by Ant · Permalink · 2 Comments
In: Java, Jboss · Tagged with: , , , , ,

Using Jboss System Properties

So if I have a jboss application set up on different environments, is there an easy way for me to load environment specific properties on a per instance basis?
Yes there is, read on.
So normally, in most applications you might end up with some property values you’ll want to override based on the environment. For example, [...]

Posted on January 11, 2010 at 8:47 pm by Ant · Permalink · 2 Comments
In: Java, Jboss · Tagged with: , ,