About Deployment Descriptors

See Also

Deployment descriptors are XML-based text files whose elements describe how to assemble and deploy a module to a specific environment. The elements also contain behavioral information about components not included directly in code.

Deployment descriptors specify two kinds of information:

There are different types of deployment descriptors: EJB deployment descriptors described in the Enterprise JavaBeans specification, web deployment descriptors described in the Servlet specification, and application and application client deployment descriptors described in the Java EE specification. For each type of module or application, there are two deployment descriptors:

Deployment Descriptors in the IDE

The IDE generates a deployment descriptor from the settings for EJB modules, web application modules, and enterprise applications, when you create an empty enterprise project. (Note that deployment descriptors are NOT created automatically for EE6 projects. See below.) It also reads your existing deployment descriptors when you import existing enterprise beans, enterprise applications, and web applications into the IDE. The deployment descriptors are located in the conf folder of your project directory, and are displayed under the Configuration Files node in the Projects window.

As you work with your projects, the IDE updates the general deployment descriptors to reflect changes you have made, such as adding business methods to an enterprise bean or adding a web application module to an enterprise application.

The IDE also automatically updates your server-specific deployment descriptors if the target server is the Tomcat Web Server or the GlassFish Server. For all other application servers, you have to write the deployment descriptors yourself.

You can open a graphical editor for a deployment descriptor by double-clicking its node in the Projects window. You can edit the deployment descriptor's XML by right-clicking its node and choosing Edit.

The IDE also automatically registers the DTDs and schemas for all the Java EE deployment descriptors, as well as the Sun Java System Application Server DTDs. You can therefore check and validate the XML in your deployment descriptors according to the DTDs and schemas. You can view the DTDs by choosing Tools > DTDs and XML Schemas from the main menu.

Deployment Descriptors in EE 6 Projects

By default, EE 6 applications use annotations instead of deployment descriptors. However, in some cases a deployment descriptor is still necessary, such as when customizing the application. In these situations you can have the NetBeans IDE create a deployment descriptor. Right-click the project's node in the Project Manager and select New > Standard Deployment Descriptor.

See Also
Configuring EJB Deployment Descriptors
Configuring Web Application Deployment Descriptors
About XML Catalogs

Legal Notices