From my experience with Jboss and Sun AS, you should just forget about AS independence.
In sql, for example, you can do quite a lot without using vendor-specific functions. Well, this is not the case as in Java EE. For Jboss and SAS, even hello world applications will require different configurations. And more applications are growing, more vendor-specific features that you should use.
In particular, if you look at the official Sun Java EE tutorial, you will find that from the very beginning it uses SAS configuration files (sun-web.xml, sun-ejb-jar.xml, etc.).
But all of the above applies only if you use the full set of Java EE features (for example, EJB, JMS, mbeans). I found that if you only have servlets / jsps packaged in one military archive, such an application can still be very portable.
source share