JBoss EAP 6.3.0的jboss.xml

时间:2015-01-16 06:01:52

标签: xml jboss-eap-6

这是我的jboss.xml,我不确定JBoss EAP 6.3.0是否正确(标签)。我用于jndi-names的名字格式正确?请帮帮我。

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS 3.2//EN"
                       "http://www.jboss.org/j2ee/dtd/jboss_3_2.dtd">                                              
<jboss>
    <enterprise-beans>
        <entity>
            <ejb-name>D</ejb-name>
            <local-jndi-name>java:ejb/D</local-jndi-name>
            <resource-ref>
                <res-ref-name>D</res-ref-name>
                <jndi-name>ejb/D</jndi-name>
            </resource-ref>
        </entity>
        <entity>
            <ejb-name>JVTInventorySession</ejb-name>
            <local-jndi-name>java:ejb/jvtnventorysession</local-jndi-name>
            <resource-ref>
                <res-ref-name>jvtnventorysession</res-ref-name>
                <jndi-name>ejb/jvtnventorysession</jndi-name>
            </resource-ref>
        </entity>
        <entity>
            <ejb-name>XVTInventoryMDB</ejb-name>
            <local-jndi-name>java:ejb/xvtinventorymdb</local-jndi-name>
            <resource-ref>
                <res-ref-name>xvtinventorymdb</res-ref-name>
                <jndi-name>ejb/jvtnventorysession</jndi-name>
            </resource-ref>
        </entity>
        <security-domain>SC</security-domain>
       </enterprise-beans>
</jboss>

1 个答案:

答案 0 :(得分:0)

将Entity Beans迁移到JBoss EAP 6时,您应该将大部分配置放在ejb-jar.xml中,如下所示:

<ejb-jar id="ejb-jar_ID" version="3.2"
      xmlns="http://java.sun.com/xml/ns/javaee"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
                          http://www.oracle.com/webfolder/technetwork/jsc/xml/ns/javaee/ejb-jar_3_2.xsd">

    <enterprise-beans>
        <entity>
            <ejb-name>D</ejb-name>
            <home>com.a.b.DHome</home>
            <remote>com.a.b.DRemote</remote>
            <ejb-class>com.a.b.DBean</ejb-class>
            <persistence-type>Bean</persistence-type>
            <prim-key-class>com.a.b.DPK</prim-key-class>
            <reentrant>false</reentrant>
        </entity>
    </enterprise-beans>
</ejb-jar>

jboss.xml中,您通常只需要ejb-name和jndi-name

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS 3.2//EN" "http://www.jboss.org/j2ee/dtd/jboss_3_2.dtd">
<jboss>  
  <enterprise-beans>
    <entity>
      <ejb-name>D</ejb-name>
      <jndi-name>ejb/entity/D</jndi-name>
    </entity>   
  </enterprise-beans>  
</jboss>

DTD本身提供了有关可用元素的更多信息