A Deployment Descriptor Schema and Document Type Definitions Reference

Examine the EJB XSD-based deployment descriptors, namespace declarations for WebLogic Server, EJB DTD-based deployment descriptors, and DOCTYPE headers for deployment descriptors from pre-9.0 releases of WebLogic Server.

WebLogic Server deployment descriptors are XML Schema Definition-based (XSD). In pre-9.0 releases of WebLogic Server, deployment descriptors were Document Type Definition-based (DTD). For backward compatibility, WebLogic Server supports XSD- or DTD-based deployment descriptors; you can deploy applications that use DTD-based descriptors without modifying them.

Note:

If you are using metadata annotations in your EJB 3.x implementation, refer to EJB Metadata Annotations Reference in Developing Enterprise JavaBeans for Oracle WebLogic Server.

For information on the elements in WebLogic Server EJB deployment descriptors, see the following sections:

For information on the EJB 1.1 deployment descriptor elements, see Important Information for EJB 1.1 Users.

This appendix includes the following topics:

XML Schema Definitions and Namespace Declarations

An XSD deployment descriptor file requires a namespace declaration in the root element of the file. Namespace declarations in the root element of a deployment descriptor file apply to all elements in the descriptor unless a specific element includes another namespace declaration that overrides the root namespace declaration.

The contents and arrangement of elements in your deployment descriptor files must conform to the appropriate XSD.

Note:

If you use DDConverter to convert your DTD-based deployment descriptors to XSD-based, the correct namespace declaration is automatically written to your descriptor files.

Oracle recommends that you always include the schema location URL along with the namespace declaration in your XML deployment descriptor files; if you do not include the schema location in your XML deployment descriptor files, you may not be able to edit the descriptor files with a third-party tool.

weblogic-ejb-jar.xml Namespace Declaration and Schema Location

The correct text for the namespace declaration and schema location for the WebLogic Server weblogic-ejb-jar.xml file is as follows.

<weblogic-ejb-jar xmlns="http://xmlns.oracle.com/weblogic/weblogic-ejb-jar" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.oracle.com/weblogic/weblogic-ejb-jar  http://xmlns.oracle.com/weblogic/weblogic-ejb-jar/1.6/weblogic-ejb-jar.xsd"> 
... 
</weblogic-ejb-jar>

weblogic-cmp-jar.xml Namespace Declaration and Schema Location

The correct text for the namespace declaration and schema location for the WebLogic Server weblogic-cmp-jar.xml file is as follows.

<weblogic-rdbms-jar xmlns="http://xmlns.oracle.com/weblogic/weblogic-rdbms-jar" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.oracle.com/weblogic/weblogic-rdbms-jar/1.2/weblogic-rdbms-jar.xsd"> 
... 
</weblogic-rdbms-jar>

ejb-jar.xml Namespace Declaration and Schema Location

The correct text for the namespace declaration and schema location for the Enterprise JavaBeans 2.1 ejb-jar.xml file is as follows.

<ejb-jar xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd"> 
... 
</ejb-jar>

Document Type Definitions and DOCTYPE Header Information

WebLogic Server ignores the DTD locations embedded within the DOCTYPE header of XML deployment files, and instead uses the DTD locations that were installed along with the server. However, the DOCTYPE header information must include a valid URL syntax in order to avoid parser errors.

In prior releases of WebLogic Server, the contents and arrangement of elements in your deployment descriptor files must have conformed to the appropriate DTD.

When editing or creating XML deployment files, it is critical to include the correct DOCTYPE header for each deployment file. In particular, using an incorrect PUBLIC element within the DOCTYPE header can result in parser errors that may be difficult to diagnose.

The header refers to the location and version of the Document Type Definition (DTD) file for the deployment descriptor. Although this header references an external URL at java.sun.com, WebLogic Server contains its own copy of the DTD file, so your host server need not have access to the Internet. However, you must still include this <!DOCTYPE...> element in your weblogic-ejb-jar.xml and weblogic-cmp-jar.xml files, and have them reference the external URL because the version of the DTD contained in this element is used to identify the version of this deployment descriptor.

XML files with incorrect header information may yield error messages similar to the following, when used with a tool that parses the XML (such as appc):

SAXException: This document may not have the identifier `identifier_name'

where identifier_name generally includes the invalid text from the PUBLIC element.

The correct text for the PUBLIC elements for the WebLogic-Server-specific weblogic-ejb-jar.xml file is listed, by WebLogic Server release, in Table A-1.

Table A-1 PUBLIC Elements of weblogic-ejb-jar.xml

WebLogic Server Release XML File PUBLIC Element String

8.1.x

weblogic-ejb-jar.xml

'-//BEA Systems, Inc.//DTD WebLogic 8.1.0 EJB//EN' 'http://www.bea.com/servers/wls810/dtd/weblogic-ejb-jar.dtd'

7.0.x

weblogic-ejb-jar.xml

'-//BEA Systems, Inc.//DTD WebLogic 7.0.0 EJB//EN' 'http://www.bea.com/servers/wls700/dtd/weblogic-ejb-jar.dtd'

6.1.x

and

6.0.x

weblogic-ejb-jar.xml

'-//BEA Systems, Inc.//DTD WebLogic 6.0.0 EJB//EN' 'http://www.bea.com/servers/wls600/dtd/weblogic-ejb-jar.dtd'

5.1.0

weblogic-ejb-jar.xml

'-//BEA Systems, Inc.//DTD WebLogic 5.1.0 EJB//EN'

'http://www.bea.com/servers/wls510/dtd/weblogic-ejb-jar.dtd'

The correct text for the PUBLIC elements for the WebLogic-Server-specific weblogic-cmp-jar.xml file is listed, by WebLogic Server release, in Table A-2.

Table A-2 PUBLIC Elements of weblogic-cmp-jar.xml

WebLogic Server Release XML File PUBLIC Element String

8.1.x

weblogic-cmp-jar.xml

'-// BEA Systems, Inc.//DTD WebLogic 8.1.0 EJB RDBMS Persistence//EN' 'http://www.bea.com/servers/wls810/dtd/weblogic-rdbms20-persistence-810.dtd'

7.0.x

weblogic-cmp-jar.xml

'-// BEA Systems, Inc.//DTD WebLogic 7.0.0 EJB RDBMS Persistence//EN' 'http://www.bea.com/servers/wls700/dtd/weblogic-rdbms20-persistence-700.dtd'

6.1.x

and

6.0.x

weblogic-cmp-jar.xml

'-// BEA Systems, Inc.//DTD WebLogic 6.0.0 EJB RDBMS Persistence//EN' 'http://www.bea.com/servers/wls600/dtd/weblogic-rdbms20-persistence-600.dtd'

See Deployment Descriptor Schema and Document Type Definitions Reference for more information on the weblogic-cmp-jar.xml file.

The correct text for the PUBLIC elements for the Sun-Microsystems-specific ejb-jar.xml file is listed, by Enterprise JavaBeans version, in Table A-3.

Table A-3 PUBLIC Elements of ejb-jar.xml

EJB Version XML File PUBLIC Element String

2.0

ejb-jar.xml

'-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN'

'http://java.sun.com/dtd/ejb-jar_2_0.dtd'

1.1

ejb-jar.xml

'-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN'

'http://www.java.sun.com/j2ee/dtds/ejb-jar_1_1.dtd'