[javaee-spec users] [jsr342-experts] War vs EAR packaging

From: Antonio Goncalves <>
Date: Wed, 29 Aug 2012 14:36:18 +0200

Hi all,

Today I'm working on an existing Java EE 6 application running on JBoss
7.1. I was surprised to see an MDB packaged in a war file... and it's
working ;o)

It looks like JBoss has taken some liberty from the spec and allows MDBs
(non web profile component) to be packaged in a war instead of an ear. But
to be honest, I like it. So I'm wondering : when should I use an ear file ?
The first answer would be "when I want to package several war together". As
a developper why would I have other constraints ? Why couldn't I package an
MDB in a war file ? And what about @Remote interfaces in a war file ? Why
not ?

Are there technical limitations/constraints that can't be solved (on the
app server implementation side I mean) that would not allow to package any
component in a war file ? The ear file would just stay to package war files
(like a russian doll packaging mode).

Any thoughts ?