Antonio Goncalves is a senior software architect living in Paris. Initially focused on Java development since the late 1990s, his career has taken him to different countries and companies where he works now as a Java EE consultant in software architecture. As a former BEA consultant he has a great expertise in application servers such as Weblogic, JBoss and, of course, GlassFish. He is particularly fond of Open Source and is a member of the OOSGTP (Open Source Get Together Paris). He is also the co-creator of the Paris Java User Group and talks on Les Cast Codeurs podcast. Antonio wrote a first book in French on Java EE 5 back in 2007. Since then he has join the JCP and is an Expert Member of various JSRs (Java EE 6, JPA 2.0 and EJB 3.1). He then published a second book for Apress: Beginning Java EE 6 Platform with GlassFish 3. For the last years Antonio has been talking at international conferences mainly about Java EE, including JavaOne, The Server Side Symposium, Devoxx, Jazoon… He has also written numerous technical papers and articles for IT Web sites (DevX, JaxEnter) or IT magazines (Programmez, Linux Magazine). Antonio is a DZone MVB and is not an employee of DZone and has posted 33 posts at DZone. You can read more from them at their website. View Full User Profile

Java EE 7 Deployment Descriptors

  • submit to reddit

As you might know by now, Java EE 7 will be released in a few days. There are many new features and I will not cover these novelties now. I just want to mention that most of the XML deployment descriptor namespaces have been updated. Nothing that will change your life as a developer, but as I mentioned on the Aquarium blog “It’s a symbol. For many years we were wondering what would happen to namespaces. Most of us thought it would be renamed to But no, it went back to where it originally belonged, to the JCP. Lately the JCP has moved towards greater transparency (i.e. and having the JCP namespaces strenghens this move“.

Basically, instead of having use And of course, most of the XSD version numbers have been updated. So here are some of the new Java EE 7 namespaces.

CDI 1.1

The CDI deployment descriptor (beans.xml) is mandatory, even if it stays totally empty. Note that in CDI 1.1 (JSR 346) there is a new bean-discovery-mode element that informs CDI to discover all beans, none, or only annotated ones.

<beans xmlns=""
       version="1.1" bean-discovery-mode="all">

Bean Validation 1.1

Bean Validation 1.1 (JSR 349) is the only specification that hasn’t updated the namespace and still uses Note that Bean Validation and CDI specifications are both lead by RedHat

        xsi:schemaLocation=" validation-configuration-1.1.xsd"


        xsi:schemaLocation=" validation-mapping-1.1.xsd"

JPA 2.1

Only mandatory deployment descriptor in Java EE 7, the JPA 2.1 (JSR 338) persistence.xml files introduces new standard properties for schema generation (more on that in a coming post).


<persistence xmlns=""


<entity-mappings xmlns=""

EJB 3.2

Not many changes in EJB 3.2 (JSR 342) compared to 3.1. So the ejb-jar.xml gently follows these minor updates.

<ejb-jar xmlns=""

Servlet 3.1

Like the previous release, the web.xml in Servlet 3.1 (JSR 340) is optional as well as the web-fragment.xml.

<web-app xmlns=""

JSF 2.2

In JSF 2.2 (JSR 344) the faces-config.xml is still optional. Note that the namespaces of the component libraries have also been updated

<faces-config xmlns=""


<html xmlns=""

JAX-WS 2.2

The WS-* landscape is defined in several specifications (JAX-WS 2.2a with JSR 224, Web Services 1.4 with JSR 109 and Web Services Metadata 2.1 with JSR 181). The webservices.xml deployment descriptor has been updated with the new namespace.

<webservices xmlns=""


When you develop a Java EE 7 application make sure to use the new namespaces. I’ve just listed here the most common deployment descriptors but Java EE 7 has several extra ones (javaee_7.xsd, application_7.xsd, application-client_7.xsd,batchXML_1_0.xsd, jobXML_1_0.xsd…)).

Published at DZone with permission of Antonio Goncalves, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)