Deployment Descriptor XML Schema
Jump to navigation
Jump to search
This section provides the XML Schema for the EJB 2.1 deployment descriptor. The comments in the XML Schema specify additional requirements for the syntax and semantics that cannot be easily expressed by the XML Schema mechanism.
The content of the XML elements is in general case sensitive (i.e., unless stated otherwise). This means, for example, that
<transaction-type>Container</transaction-type>
must be used, rather than:
<transaction-type>container</transaction-type>.
All valid ejb-jar deployment descriptors must conform to the XML Schema definition below or to the DTD definition from a previous version of this specification.
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://java.sun.com/xml/ns/j2ee" xmlns:j2ee="http://java.sun.com/xml/ns/j2ee" xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified" version="2.1"> <xsd:annotation> <xsd:documentation> @(#)ejb-jar_2_1.xsds 1.23 08/01/03
</xsd:documentation> </xsd:annotation> <xsd:annotation> <xsd:documentation> This is the XML Schema for the EJB 2.1 deployment descriptor. The deployment descriptor must be named "META-INF/ejb-jar.xml" in the EJB’s jar file. All EJB deployment descriptors must indicate the ejb-jar schema by using the J2EE namespace:
http://java.sun.com/xml/ns/j2ee and by indicating the version of the schema by using the version element as shown below: <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" version="2.1"> ... </ejb-jar>
The instance documents may indicate the published version of the schema using the xsi:schemaLocation attribute for the J2EE namespace with the following location: http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd </xsd:documentation> </xsd:annotation> <xsd:complexType name="transaction-typeType"> <xsd:annotation> <xsd:documentation> The transaction-typeType specifies an enterprise bean’s transaction management type. The transaction-type must be one of the two following: Bean Container </xsd:documentation> </xsd:annotation> <xsd:simpleContent> <xsd:restriction base="j2ee:string"> <xsd:enumeration value="Bean"/> <xsd:enumeration value="Container"/> </xsd:restriction> </xsd:simpleContent> </xsd:complexType>
</xsd:schema>