Xml 对于容器事务,根元素后面文档中的标记必须格式良好

Xml 对于容器事务,根元素后面文档中的标记必须格式良好,xml,ejb-2.x,jboss-4.2.x,Xml,Ejb 2.x,Jboss 4.2.x,对于容器事务,我得到的错误是“根元素后面的文档中的标记必须格式良好” <container-transaction> <method> <ejb-name>EmployeeBean</ejb-name> <method-intf>EmployeeHome</method-intf> <method-name>remove</method-name>

对于容器事务,我得到的错误是“根元素后面的文档中的标记必须格式良好”

<container-transaction>
    <method>
        <ejb-name>EmployeeBean</ejb-name>
        <method-intf>EmployeeHome</method-intf>
        <method-name>remove</method-name>
        <method-params>
        <method-param>java.lang.Object</method-param>
        </method-params>
    </method>
        <trans-attribute>Required</trans-attribute>
</container-transaction>
ejb-jar.xml代码如下所示:

<container-transaction>
    <method>
        <ejb-name>EmployeeBean</ejb-name>
        <method-intf>EmployeeHome</method-intf>
        <method-name>remove</method-name>
        <method-params>
        <method-param>java.lang.Object</method-param>
        </method-params>
    </method>
        <trans-attribute>Required</trans-attribute>
</container-transaction>
http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd"> 雇员详情 雇员详情 雇员豆 com.test.intrfc.EmployeeHome com.test.intrfc.EmployeeRemote com.test.classes.EmployeeBean 容器 com.test.classes.EmployeePK 错误的 2.x 雇员情绪 雇员ID 雇员姓名 股份额 股票价值 雇员ID 通过雇员的名称查找雇员bean findByEmployeeName java.lang.String 从EmployeeRemote中选择对象(a) 其中a.employeeName=?1

<container-transaction>
    <method>
        <ejb-name>EmployeeBean</ejb-name>
        <method-intf>EmployeeHome</method-intf>
        <method-name>remove</method-name>
        <method-params>
        <method-param>java.lang.Object</method-param>
        </method-params>
    </method>
        <trans-attribute>Required</trans-attribute>
</container-transaction>

雇员豆
员工之家
去除
java.lang.Object
要求的

这句来自
ejb-jar_2_1.xsd
的话应该会给你答案:

<container-transaction>
    <method>
        <ejb-name>EmployeeBean</ejb-name>
        <method-intf>EmployeeHome</method-intf>
        <method-name>remove</method-name>
        <method-params>
        <method-param>java.lang.Object</method-param>
        </method-params>
    </method>
        <trans-attribute>Required</trans-attribute>
</container-transaction>
method intf元素允许方法元素 区分具有相同名称和名称的方法 在家庭和家庭中多次定义的签名 组件接口(例如,在企业bean的 远程和本地接口,或者在企业bean的 家庭和远程接口等);组件和web 服务端点接口等

<container-transaction>
    <method>
        <ejb-name>EmployeeBean</ejb-name>
        <method-intf>EmployeeHome</method-intf>
        <method-name>remove</method-name>
        <method-params>
        <method-param>java.lang.Object</method-param>
        </method-params>
    </method>
        <trans-attribute>Required</trans-attribute>
</container-transaction>