Programming WebLogic Enterprise JavaBeans
Deployment Descriptor Schema and Document Type Definitions Reference
In this release of 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, this release of WebLogic Server supports XSD- or DTD-based deployment descriptors; you can deploy applications that use DTD-based descriptors without modifying them.
The following sections describe EJB XSD-based deployment descriptors and namespace declarations for this release of WebLogic Server as well as EJB DTD-based deployment descriptors and DOCTYPE headers for deployment descriptors from pre-9.0 releases of WebLogic Server.
- XML Schema Definitions and Namespace Declarations
- Document Type Definitions and DOCTYPE Header Information
For information on the elements in WebLogic Server EJB deployment descriptors, see the following sections:
- weblogic-ejb-jar.xml Deployment Descriptor Reference
- weblogic-cmp-jar.xml Deployment Descriptor Reference
For information on the EJB 1.1 deployment descriptor elements, see Important Information for EJB 1.1 Users.
XML Schema Definitions and Namespace Declarations
The contents and arrangement of elements in your deployment descriptor files must conform to the appropriate XSD.
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.
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://www.bea.com/ns/weblogic/weblogic-ejb-jar/1.0/weblogic-ejb-jar.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.bea.com/ns/weblogic/weblogic-ejb-jar/1.0/weblogic-ejb-jar.xsd" http://www.bea.com/ns/weblogic/weblogic-ejb-jar/1.0/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://www.bea.com/ns/weblogic/10.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.bea.com/ns/weblogic/10.0/weblogic-rdbms20-persistence.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
In prior releases of WebLogic Server, the contents and arrangement of elements in your deployment descriptor files must have conformed to the appropriate DTD.
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.
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, 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.
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.
See weblogic-cmp-jar.xml Deployment Descriptor 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.