users@javaee-spec.java.net

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

From: David Blevins <david.blevins_at_gmail.com>
Date: Tue, 4 Sep 2012 15:34:29 -0700

On Aug 29, 2012, at 5:36 AM, Antonio Goncalves wrote:

> 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).

The Embedded EJB Container and EJBs in .WARs features were pretty big departures from the status-quo and there wasn't a lot of group experience with them outside of OpenEJB ("EJBs in WARs" existed as "Collapsed EAR", for example). We wanted to give everyone the benefit of having experience in these areas before pushing the ideas further, so we took a conservative perspective on each and set EJB Lite as the minimum required feature set.

We could easily go further in each area as people are comfortable.

For full profile, there's no reason we can't have tests in the TCK that test for @Remote and more. For those that know the TCK, this could simply mean making a "ejbs in war" vehicle for some of the existing tests.

The only obstacle for doing that would be we be the handful of ejb tests that rely on "java:comp/env" being isolated to a particular EJB. For EJBs in .WARs we chose to adopt the Servlet definition of "java:comp/env" and all EJBs share the namespace of the WAR as opposed to having their own component-scoped namespace (one of those areas of "we each did our own thing" that had been biting us for some time).

I'd agree with Markus that "jars that contain jars" should probably be where we draw the line. That would unfortunately exclude rar files from being included in war files (though MDBs could still work with just the rar deployed separately).

I really wish there were non-russian-doll alternatives for war and rar. First thing we do under the covers is extract them anyway. Having a plain jar and classpath usable "web archive" would be great for testing with an embedded container. Having a plain jar rar file would be great for the same reason and for including them in a war file. I'm likely in the minority on that however :)


-David